GithubHelp home page GithubHelp logo

Comments (3)

eed3si9n avatar eed3si9n commented on August 26, 2024

I can't reproduce the error in my environment. Are you using the latest 0.8.5? I noticed that you're using *.scala build file. Is PathList in the scope?

from sbt-assembly.

polymorphic avatar polymorphic commented on August 26, 2024

Hmm, I am getting the same error with 0.8.6 and Scala 2.9.2/sbt 0.12. Here are the settings:

  mergeStrategy in assembly <<= (mergeStrategy in assembly) { (old) =>
    {
      case PathList("org", "apache", "commons", "collections", "bidimap", xs @ _*) => MergeStrategy.first
      case x => old(x)
    }
  }

and here's the error:

[info] Compiling 1 Scala source to /Users/dragos.manolescu/Repos/monitoring-pipeline/xml-stats-poller/project/target/scala-2.9.2/sbt-0.12/classes...
[error] /Users/dragos.manolescu/Repos/monitoring-pipeline/xml-stats-poller/project/XmlStatsPollerBuild.scala:36: star patterns must correspond with varargs parameters
[error] Error occurred in an application involving default arguments.
[error]           case PathList("org", "apache", "commons", "collections", "bidimap", xs @ _*) => MergeStrategy.first
[error]                                                                                     ^
[error] one error found

from sbt-assembly.

eed3si9n avatar eed3si9n commented on August 26, 2024

when @kul originally reported this bug I probably only tested this using build.sbt, and trusted that if a setting works in build.sbt, it would always work in build.scala.
it turns out that's not always the case! there's a bug in the pattern matcher pre-2.10 (SI-3488) that blows up when default parameters are used in conjunction with _*. In this case, the default parameters are coming likely from Project.apply.

The workaround is to separate out the settings into a method:

  lazy val lib = Project("lib", file("lib"), settings = Defaults.defaultSettings ++ assemblySettings) settings(
      mergeStrategy in assembly <<= (mergeStrategy in assembly) { (old) =>
        {
          case PathList("org", "apache", "commons", "collections", "bidimap", xs @ _*) => MergeStrategy.first
          case x => old(x)
        }
      }
    )

from sbt-assembly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.