On Wed, 19 Jun 2013 09:17:11 -0400Explain?
Josh Suereth <joshua....@gmail.com> wrote:
> James -
>
> Not sure if you've seen how Ivy works, but by default "configurations" are
> just meaningless buckets to the dependency manager. It's the build system
> itself that provides meaning. sbt (and most ivy users) just happen to
> take the same conventions as maven to make users from those tools more
> familiar. sbt itself is using the flexibility of configurations to do more
> advanced dependency management than is available in maven, such as
> attaching which compiler plugins are used to the module definition.
>
> I agree with you that it's the BUILD TOOL's responsibility to figure out
> what to do with artifacts, and it's the DEP MGR's responsibility to resolve
> the correct artifacts and help figure out conflict resolution.
>
> I *believe* we were thinking of configurations similar to Ivy, where they
> are just big buckets. There's also the option to not support them, because
> they add some significant crazy to resolution.
In particular, a tool should never think about combining configurations. It should set up a configuration according to what it needs it for and then uses just that configuration for that role. If it needs to combine compile, provided, optional, test, and runtime for a test classpath, it should declare the 'test' configuration to extend all of those and let the dependency manager figure it out.
Not sure if you've seen how Ivy works, but by default "configurations" are just meaningless buckets to the dependency manager.
I *believe* we were thinking of configurations similar to Ivy, where they are just big buckets. There's also the option to not support them, because they add some significant crazy to resolution.
SO, in any case, that avoids the issue you bring up:* THe deployer of an package/module specifies the artifacts* The package manager resolves package/module artifacts and transitive dependencies* The build system needs to know how to pull in transitive dependencies and use them appropriately
I think the "open bucket" approach of Ivy works quite well here for flexibility, with a set of default conventions. However, the onus is on the build tool, and artifact deployer to agree on terms, and the user is stuck with annoying "excludes" if they disagree on the terms. Do you have a solution that helps ease the pain of where to place the information, and how to do most work by default?
On Wednesday, June 19, 2013 11:17:11 PM UTC+10, Josh Suereth wrote:Not sure if you've seen how Ivy works, but by default "configurations" are just meaningless buckets to the dependency manager.I've used Ivy, but not as deeply as maven.I *believe* we were thinking of configurations similar to Ivy, where they are just big buckets. There's also the option to not support them, because they add some significant crazy to resolution.They may make resolution more crazy, but you also lose a reasonable amount of useful functionality by not having the ability to specify certain information about how the dependency is used.It's fairly common to have your artifact requiring another to build and at runtime, but your users don't need it to build. Take logging frameworks as an example, where the Spring framework requires the Log4J API to build and run. An EE application which uses Spring does not need Log4J to compile, but the resulting WAR/EAR needs log4j packaged (unless the target environment provides it).If we don't have some way to support encoding this kind of thing into the dependency metadata, then I think we're choosing to drop some fairly common use cases. Having extra artifacts in your compile classpath usually wouldn't be a fatal problem though. The reverse situation where you need something at build time but not runtime also happens.SO, in any case, that avoids the issue you bring up:* THe deployer of an package/module specifies the artifacts* The package manager resolves package/module artifacts and transitive dependencies* The build system needs to know how to pull in transitive dependencies and use them appropriatelySort of, the build system either needs to know what situation transitive dependencies are needed, or just use them everywhere and hope the result is what should happen. In a "test" build phase there are multiple steps, you compile the test code and then you run the tests, but whether certain transitive dependencies are needed isn't necessarily the same for both.I think the "open bucket" approach of Ivy works quite well here for flexibility, with a set of default conventions. However, the onus is on the build tool, and artifact deployer to agree on terms, and the user is stuck with annoying "excludes" if they disagree on the terms. Do you have a solution that helps ease the pain of where to place the information, and how to do most work by default?The open bucket approach can work, but I'm not sure if all the "scope" things need to be in the dependency metadata. The fact library X needs junit to runs it's tests does not need to be in the repository's dependency metadata, it is purely a build concern of X. I can't think of any reason another artifact would care what X used to run it's tests with, so would argue that information does not belong in the exported dependency metadata. Maven has the entire POM with information that is only relevant at build time in the repo, which I think is wrong.
I've been trying to think about what dependency information needs to be available to dependant artefacts, and the only ones I could come up with was "is it required to build dependent artefacts" and "is it required (or optional) to execute code in this artifact". Can anyone think of use cases that doesn't cover or can think of other things that dependent artifacts need to know, so should be in the exported metadata?I'm not saying there aren't more, I just can't think of them.
Perhaps given the current approach to testing. However, one feature I'd love to add to sbt (once we can get major artifacts *off* of maven repositories) is the ability to run a projects tests via a different project. I.e. I want to resolve its test" configuration bucket and run those tests on some remote vm. That way, I can run my unit tests on the cross set of Windows 7, Windows 8, Windows Server 20XX, Ubuntu, Fedora, Mint, MacOSX and Java 6, Java 7 and Java 8-Preview.
So yes, I can half-understand your point. IMHO, all dependencies used by the build should be encodable into the dependency manager. Whether or not you use them is irrelevant to whether or not that can be useful.
* Do we need these on the system lib path for native loading?* Is your documentation available for this version?* Is there source code for this version?* What scalac compiler plugins are needed to compile code with your library (Note: We don't really denote this now)* I'd like to select the shared-library variant of your code (.so) vs. static libraries (.a)
Again, let's think a bit outside the box. It's hard to anticipate needs, but I still feel that Ivy's configuration system is, hands down, the best mechanism to represent a lot of "artifact grouping" concerns. It makes no real committments on the dependency resolution side, and allows build tools/ecosystems to define their conventions.However, now is the time to think through other possibilities, and examine their fit.