-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Cannot test with r3.1
and then c3.1.0
#14306
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
Comments
I reproduced it manually an got the following error.
I see that the older compiler cannot read this artifact because we generated non-release version of TASTy. @prolativ does this make sense from the testing framework perspective? The same example passes on |
@nicolasstucki This looks like a broader question how we understand the correspondence between versions of TASTy and scala. E.g. scala 3.1.0 emits TASTy 28.1-0, so do 3.1.1-RC1, 3.1.1-RC2 and 3.1.1, and so will all nonsnapshot 3.1.x versions. However in our master branch TASTy minor and experimental versions are temporarily bumped to higher values and then downgraded during release. This makes sense when we're preparing a new 3.x.0 release because the TASTy format has not been fixed for this release. But I'm wondering if later snapshot versions like 3.1.2-RC1-SNAPSHOT should produce experimental TASTy instead of the stable version as theoretically they cannt change the format. |
As far as I remember there were problems when we tried to compile something like |
A possible solution would be to not fetch the published artifacts but have a submodule for each supported version containing the release branches (for example https://github.com/lampepfl/dotty/tree/release-3.0.2) and then compile it locally. This would allow us to compile locally a version of the compiler that is equivalent to the released version but would be marked as a snapshot. Therefore it would be able to consume nonstable artifacts. This would also help in another direction we haven't considered in the past. If a test fails and we need to debug it we might need to debug what the released version of the compiler receives to fully understand the interaction between the two compilers. Therefore if we have a submodule we could modify it (for example to enable the Printers) and run the tests on that version. I have already hit this situation. |
That makes sense. Although all the previously released versions of the compiler that we would like to use in tests should are probably cached in our CI in order not to make the builds last too long |
I'm wary of using submodules here, we already have a hard time managing our current usage of submodules without adding even more complexity in the mix. I would definitely prefer an escape hatch for the tests than this. |
Maybe we don't actually need submodules and additional tags/branches like |
In that scenario would it be possible to edit the code of the "released" version of the compiler to allow debugging? |
checkout to a branch -> adjust tasty version in TastyFormat.scala -> publishLocal |
This all still looks really complicated, almost like we're reinventing a build tool in our test framework when we already have sbt scripted tests. |
The goal of our tests is to check what will actually happen when users use these flags, if we start hacking our own compiler code, we're straying away from this. I agree that 3.1.2-XX-SNAPSHOT should output 3.1 tasty since we haven't changed the tasty format. |
We only need this while debugging the code. It is never going to be on master. Therefore we won't be straying away. |
@smarter could you try to port the tests in https://github.com/lampepfl/dotty/pull/14302/files into scripted tests? Not sure how to do it properly. Then we could compare the 2 approaches. |
I think sbt scripted tests would suffer from the same problems we have here. To bring things up together into one solution:
|
An alternative that might be simpler is to allow stable compiler versions to compile as if they were unstable. We could add a The advantage of this approach is that we would never be able to publish a TASTy marked as stable from a non-stable version of the compiler. Keeping this strong guarantee seems paramount for the correct behavior published stable artifacts. |
IMO we have two separate problems which we are unnecessarily trying to solve with a single mechanism:
I think the
Here we're compiling some code with
What's more, I would then suggest the following solutions to the problems I mentioned at the beginning of this comment:
|
After an internal discussion it has been agreed that:
Things to be discussed (preferably in this thread):
|
This looks like a lot of changes/complications, is all of this really needed just to let us test the -scala-output-version flag? If we go back earlier in the discussion you mentioned:
To me this still makes sense: -Yscala-release 3.1 would mean that even an experimental compiler can act as a release compiler. Is this not good enough for other reasons? |
should this be closed? |
Yes, but we should create another issue to track the confusion between the tasty experimental version and the tasty generated by an experimental compiler. |
With the comment in #14633 (comment) and the similar issue in #16204, is this something that can be closed? |
I think so, as the problem as stated in the issue title is not a concern anymore |
Compiler version
300a8b6
Minimized example
Output
Expectation
Should pass.
Should also show the error (see #14303).
The text was updated successfully, but these errors were encountered: