-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Use sbt for PR validation [ci: last-only] #5190
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
Conversation
|
Ah, we still need But this doesn't explain the test failure. The |
|
@szeiger Related discussion about pull-binary-libs: https://issues.scala-lang.org/browse/SI-8379 |
We could also rewrite the tests to generate the necessary bytecode programmatically. We can use ASMifier to reify the ASM code that would create a given class, and then whittle that down the miminum needed to provoke the original bug. Of course, we might just be able to include Java source files and use the separate compilation test case feature of partest |
|
It looks like we have our first successful PR validation build on sbt. Remaining issues:
The following are non-issues (at least for this PR) IMHO:
|
|
re scaladoc. We have issues generating scaladoc from sbt in cats. I know the issue/solution but have not PR'd anything- ref chat https://gitter.im/sbt/sbt?at=574b4bde10f0fed86f49499c In case you hit any issues before I PR anything, please shout. |
|
@inthenow Scaladoc generation has been working in the Scala build for months. The remaining issue here is about running tests on the scaladoc tool (using partest from sbt) |
|
Marking "Put the build artifacts in the same location as the ant build or change the Jenkins configuration" as solved. Some build artifacts were produced by the ant build and then archived by Jenkins because they contain additional details about build errors. The sbt build logs everything to the console instead, so these files should not be necessary anymore. The warning can be safely ignored and the Jenkins configuration changed after this PR has been merged. |
|
Ready for review. |
| } | ||
|
|
||
| // This project provides the STARR scalaInstance for bootstrapping | ||
| lazy val bootstrap = (project in file("target/bootstrap")).settings( |
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.
neat!
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.
i wonder about the various ways to create Files that we see in build.sbt:
file("target/...")file(".") / "target" / ...(baseDirectory in ThisBuild).value / "target" / ...buildDirectory.value / "quick" / ...
does it matter, should we unify / clean up a bit?
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 should be able to get rid of many of those when we move to a more standard sbt layout after ant is gone. (The first 3 all do the same, the last one is different)
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.
here: if you tell me we're fine for now then that's fine with me :)
|
I would really like to reduce the additional noise in the output. Maybe suppress [info]-level output? I know it's annoying to fix, but if we postpone it I'm afraid we'll just end up living with it. |
|
I just tried to use the native SBT import in IntelliJ to see if the changes in this PR had been enough to get it working. (It wasn't working before because of our custom It does successfully complete, but ends up with the wrong directory mappings: Not a blocker for this PR, just a pity. |
Oh, that's a side effect of a change I made previously: IntelliJ looks up |
|
@adriaanm What noise are you referring to specifically? The OSGi tests are noisy but I didn't bother trying to change that (not sure that I could - I only managed to turn some of that noise off in Slick's OSGi tests) because you don't normally run them manually and the console output replaces the JUnit XML logs from the ant build. |
|
Most lines that start with |
| def annotationName = "partest" | ||
| }, true, Array()) | ||
| ) | ||
| testOptions in IntegrationTest += Tests.Argument("-Dpartest.scalac_opts=" + (scalacOptions in Compile).value.mkString(" ")), |
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.
it looks like space separation might not work if there are multiple scalac options
-Dpartest.scalac_opts=-optimize -deprecation
maybe surround the options by single quotes? just guessing..
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.
No, there's no parsing of quoted arguments happening anywhere. This is a single Argument for partest which does a .split(' ') on the RHS of the -D def to get the scalac args. There is currently no way use spaces inside of scalac args but that's a limitation of partest (and is also present when launching it from ant or the command line).
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.
OK, thanks!
|
/rebuild |
|
@adriaanm I turned that off in https://github.com/scala/scala/pull/5152/files#diff-991b9473f196f6364820f0c3652eb3faR32 . Perhaps you are on a branch doesn't have that change it its hiatory yet? |
|
sigh The reference to speclib/intrumented.jar is hardcoded in partest itself |
|
@retronym I've just pushed another commit with a workaround for your scalacheck bootstrapping problem (provided that it passes CI and doesn't cause new problems). |
I was looking at the output of this PR, so I guess this that'll take care of itself when we merge. |
|
No, it's in the history and I see the code. It may be scoped too narrowly to catch everything. I'll investigate. (BTW, noise has already been considerably reduced by running everything from a single sbt invocation; now you only get the resolver spam once at the beginning) |
869e10a to
9167173
Compare
|
Everything should be fixed now. |
|
Fix all the things!! :party: |
9167173 to
5aa79ad
Compare
|
Squashed, rebased and switched to partest 1.0.15 |
project/MiMa.scala
Outdated
| // It would be nice to use sbt-mima-plugin here, but the plugin is missing | ||
| // at least two features we need: | ||
| // * ability to run MiMa twice, swapping `curr` and `prev`, to detect | ||
| // both forwards and backwards incompatibilities |
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.
I think this isn't true as of 0.1.9: lightbend-labs/mima@2844ffa
- Support directories in `-doc-external-doc`: It is documented as accepting a “classpath_entry_path” for the keys but this only worked for JARs and not for individual class files. When checking for external-doc mappings for a Symbol, we now find the root directory relative to a class file instead of using the full class file path. The corresponding tests for SI-191 and SI8557 are also fixed to support individual class files instead of JARs in partest. This is required for the sbt build which runs partest on “quick” instead of “pack”. - Fix version and repository handling for bootstrapping. The bootstrap `scalaInstance` can now be resolved from any repository added to the project (not just the bootstrap repositories) by using a different workaround for sbt/sbt#1872. - Workaround for sbt/sbt#2640 (putting the wrong `scalaInstance` on partest’s classpath). The required `ScalaInstance` constructor is deprecated, so we have to disable deprecation warnings and fatal warnings until there is a better fix. - Add MiMa to the sbt build (port of the old `test.bc` ant task). The sbt-mima plugin doesn’t have all the features we need, so we do it manually in a similar way to what the plugin does. Checks are done in both directions for the `library` and `compiler` projects. The base version has to be set in `build.sbt`. When set to `None`, MiMa checks are skipped. MiMa checks are run sequentially to avoid spurious errors (see lightbend-labs/mima#115). - Port the OSGi tests to the sbt build. The set of JARs that gets copied into build/osgi as bundles is a bit different from the ant build. We omit the source JARs but add additional modules that are part of the Scala distribution, which seems more correct. - Get rid up `pull-binary-libs.sh` for the sbt build. Add artifacts are resolved from the special bootstrap repository through Ivy. The special `code.jar` and `instrumented.jar` artifacts are copied to the location where partest expects them (because these paths are hardcoded in partest). Other extra JARs for partest in `test/files/lib` are referenced directly from the Ivy cache. - Move common settings that should be available with unqualified names in local `.sbt` files and on the command line into an auto-plugin. - Add an `antStyle` setting to sbt to allow users to easily enable ant-style incremental compilation instead of sbt’s standard name hashing with `set antStyle := true`. - Disable verbose `info`-level logging during sbt startup for both, `validate/test` and `validate/publish-core` jobs. Update logging is no longer disabled when running locally (where it is useful and doesn’t generate excessive output). - Pass optimization flags for scalac down to partest, using the new partest version 1.0.15\6. - Call the new sbt-based PR validation from `scripts/jobs/validate/test`. - Disable the tests `run/t7843-jsr223-service` and `run/t7933` from scala#4959 for now. We need to set up a new test project (either partest or junit) that can run them on a packaged version of Scala, or possibly move them into a separate project that would naturally run from a packaged Scala as part of the community build.
5aa79ad to
f2d0f1e
Compare
|
Offending jarlister tests disabled, updated to a new partest 1.0.16, MiMa comments added. |
|
LGTM! 🎈 |

Picking up the work on #4933