Force deleting sources/javadoc to fix sbt/sbt#1750#17
Force deleting sources/javadoc to fix sbt/sbt#1750#17dwijnand merged 3 commits intosbt:2.3.x-sbtfrom dwijnand:fix/1750
Conversation
There was a problem hiding this comment.
I'm explicitly specifying the Artifact details here instead using methods on PomModuleDescriptorBuilder (which I was doing in a previous attempt) because that sets the type to "source" and "javadoc" which makes it look artifacts at
~/.ivy2/cache/com.dwijnand/sbt-gh1750-bippy_2.11/sources/sbt-gh1750-bippy_2.11-0.1.0-SNAPSHOT-sources.jar
~/.ivy2/cache/com.dwijnand/sbt-gh1750-bippy_2.11/javadocs/sbt-gh1750-bippy_2.11-0.1.0-SNAPSHOT-javadoc.jar
rather than
~/.ivy2/cache/com.dwijnand/sbt-gh1750-bippy_2.11/srcs/sbt-gh1750-bippy_2.11-0.1.0-SNAPSHOT-sources.jar
~/.ivy2/cache/com.dwijnand/sbt-gh1750-bippy_2.11/docs/sbt-gh1750-bippy_2.11-0.1.0-SNAPSHOT-javadoc.jar
given the ivy/artifact pattern
(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[organisation]/[module](/[branch])/[type]s/[artifact]-[revision](-[classifier])(.[ext])
I then found this correspondence map in sbt, so decided to just define the types here as "src" and "doc" instead. Let me know if I should fix this some other way..
There was a problem hiding this comment.
a really good question. I think the differences represent something we'll want to clean-up/unify. It may be a good idea to move that correspondence map onto this side and then use it in sbt, so we can correct those issues as needed.
There was a problem hiding this comment.
Do you know who owns those magic strings? Who likes "source" and who prefers "src"?
There was a problem hiding this comment.
AFAIK it's an sbt's understanding of ivy when code was first written vs. ivy thing. I believe it's trouble all of our brewing, however it is ALSO the case that inside of maven repositories "-src" vs. "-sources" is a thing and you need to support both, depending on which project is pushing the sources.
|
Restarting Travis. |
|
Some history I found, for the present day and future reviewers here. A more generic fix for this was attempted in sbt/sbt#641 and reverted in sbt/sbt#1234 due to the fall out in sbt/sbt#1091. Is this going to cause that effect? I'm not sure but I hope not.. |
There was a problem hiding this comment.
Ok, so not to be annoying, BUT...
- This implies we have the performance overrides in this project, which we may actually want to do.
- IIRC there's an open ticket and PR to disable downloading source/javadoc to the Ivy main REPO, so we're not out of line just putting all that functionality in here.
I'd prefer if we have ONE of the hackeries in this repo that we just keep them BOTH together so they can reference each other.
There was a problem hiding this comment.
Also, option #2 would be to actually modify this behavior so it's a FLAG to the default cache manager, one which sbt can set when constructing Ivy, rather than having it ALWAYS be the case here.
There was a problem hiding this comment.
(Do you mean apache/ant-ivy#6 ?)
Do you have a preference on which change to make? I'm not sure which I prefer so I'll go with what you prefer.
There was a problem hiding this comment.
Are the options mutually exclusive? Can we merge apache/ant-ivy#6 and also use the same flag here?
There was a problem hiding this comment.
That PR is the + or - the equivalent of https://github.com/sbt/sbt/blob/v0.13.9/ivy/src/main/scala/sbt/ivyint/SbtChainResolver.scala#L67 (or at least with regards to the use case I've been looking at).
So if we merged that we would then have to programmatically enable that setting in sbt.
Despite there being two sbt-driven changes here, which together interact, their primary nature is different:
- Don't always look for srcs/docs from remote you maniac
- If we have a new descriptor then, in an effort to have a clean shop, let's always delete srcs/docs locally.
Given I'm not 100% that that PR would allow sbt to drop it's fail-fast, I'm leaning towards a "alwaysDeleteSrcsDocs" flag on DefaultRepositoryCacheManager provided sbt has access to enabling it somehow.
Or we could follow the lead on of that PR and set it in ivySettings.
There was a problem hiding this comment.
Yeah, let's put it into ivySettings, and I guess I'd be ok with it always on for sbt no matter what.
|
Travis is very confused about where the branch it's meant to build is found (it's not looking in my clone). Closing and reopening in an attempt to fix. |
|
If we can get this behind a settings flag, I'm all for it. |
|
sbt/sbt#2163 got merged, which uses the ivy built from d21bcdd (pre sbt comments commit). For consistency I'm going to merge my branch, but I'll follow up with another PR with the agreed upon changes discussed here. |
Force deleting sources/javadoc to fix sbt/sbt#1750
Replaces (wip) #15 PR.