-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wip: fix scripted tests #1
wip: fix scripted tests #1
Conversation
…sbt 2.x and project matrix target is target/out/jvm/scala-3.3.3/ alternatively we could change the Universal plugin so that config / target := baseDirectory.value / "target" / config.name
68950b1
to
37b4c43
Compare
37b4c43
to
3992421
Compare
3992421
to
70564db
Compare
Either is fine. Thanks for this! I haven't done it yet, but I was thinking sbt should add some special scripted test command in the next 2.x version like |
windows tests are faling with the error below because of sbt/sbt@d0003bb
|
the commits setting |
After thinking for this a while, I think we should use the new default target (
I think that is a good idea |
import NativePackagerHelper._ | ||
Docker / mappings ++= directory("src/main/resources/docker-test") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eed3si9n should sbt.io.Mapper#directory
and other methods in sbt.io.Mapper
that return mappings (i.e (File, String)
) be changed to return ( (HashedVirtualFileRef, String)
) so it aligns with the changes to sbt.Keys#mappings
which changed from using File
to HashedVirtualFileRef
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately sbt.io.Mapper
is in sbt/io which does not have access to HashedVirtualFileRef
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT about reverting mappings
to (File, String)
? I gave it a try here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File
simultaneously is specific to user's environment, and not specific enough about the content, so it's inappropriate to participate in remote cache. For anything useful, mappings is going to be a critical input, so we have to make this change if we want remote caching to be a major feature of sbt 2.x. more details here
https://eed3si9n.com/sbt-remote-cache-with-bazel-compat/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sbt/sbt for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sbt/sbt for now?
yes, but which package/class, so that is available in build.sbt
files without import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can put in almost any place that makes sense for build.sbt
. The imports are https://github.com/sbt/sbt/blob/develop/main/src/main/scala/sbt/internal/BuildUtil.scala#L93-L100, and we control that with https://github.com/sbt/sbt/blob/develop/sbt-app/src/main/scala/sbt/Import.scala.
We can create Mapper
in sbt package and put it in https://github.com/sbt/sbt/tree/develop/main-actions/src/main/scala/sbt for example, and remove the Mapper alias in https://github.com/sbt/sbt/blob/ebee3a86d900758b7085bb40979124ad2a9e4587/sbt-app/src/main/scala/sbt/Import.scala#L57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I will give it a try later today
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eed3si9n I tried this in sbt/sbt#7939 but I don't think this is enough.
File simultaneously is specific to user's environment, and not specific enough about the content, so it's inappropriate to participate in remote cache. For anything useful, mappings is going to be a critical input, so we have to make this change if we want remote caching to be a major feature of sbt 2.x. more details here
eed3si9n.com/sbt-remote-cache-with-bazel-compat
I understand these concerns, but making user code so verbose will make adoption of sbt 2.x a pain as it is a downgrade in quality from sbt 1.x
WDYT about reverting mappings to
(File, String)
?
cant we keep mappings key as (File, String)
, but move the cache implementation details to the task implementation? Even if it make task implementation more verbose?
16bc1b4
to
8709c75
Compare
8709c75
to
64a813b
Compare
….x because with sbt 2.x and project matrix target is target/out/jvm/scala-3.3.3/
ca80d9c
to
b236cdc
Compare
b236cdc
to
182b814
Compare
@eed3si9n as you can see here, the only failing test is related to this issue. The ConcurrentModificationException |
Yea. It turns out |
I'm going to merge this as-is. |
Work in progress to fix scripted tests. Do you prefer to discuss here or in sbt#1647?
The biggest decision to make is what should
target
be? Keep backwards compatibility with./target/universal
? Use the new defaulttarget
(./target/out/jvm/scala-3.3.3/universal
)? Or something else like./target/out/universal
?