Skip to content

Add abstraction over non-bootstrapped/bootstrapped/optimised builds #3141

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

Merged
merged 5 commits into from
Sep 28, 2017

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is getting out of hand, we shouldn't be duplicating so much stuff in our build. We can make functions that return projects and use that to abstract over non-bootstrapped/bootstrapped/optimized, a bit like sbt-crossproject has functions to make jvm and js projects out of one thing.

@nicolasstucki
Copy link
Contributor Author

I started working on factoring out project components and abstracting over non-bootstrapped/bootstrapped/optimized.

@nicolasstucki nicolasstucki changed the title Make proper dotty-optimised project/artefacts Add abstraction over non-bootstrapped/bootstrapped/optimised builds Sep 20, 2017
@nicolasstucki nicolasstucki requested review from smarter and allanrenucci and removed request for OlivierBlanvillain September 20, 2017 14:33
@smarter
Copy link
Member

smarter commented Sep 20, 2017

@sjrd could you have a look and tell us if you think this is a sane way to do things or if there's a better way?

@sjrd
Copy link
Member

sjrd commented Sep 20, 2017

It looks decent as far as the bootstrapped/non-bootstrapped distinction goes. I am less convinced by the optimized distinction.

The reason is that you need the bootstrapped and non-bootstrapped projects to cohabit, since the former actually depends on the latter. The optimized versions, however, are just a variant of the bootstrapped thing, IIUC. That is better handled with a dynamic set, as was done before.

In general, things that can be done with a set should be. Reserve the multiple projects for things where the multiple projects actually to all live in a same run (typically because of dependencies). Otherwise your setup will not scale to other kinds of "configuration" tests. An example: you might want to test with and without applying -Xexperimental to the entire codebase (to take a scalac option I know; in dotty other things might apply).

@nicolasstucki
Copy link
Contributor Author

After discussing with @sjrd, we concluded that having the set would not be the best setup for the current use case. Hence the current definition with all three versions of the projects in the one that we need for now. In the future, we might migrate to the other version.

@smarter @allanrenucci WDYT?

@smarter
Copy link
Member

smarter commented Sep 21, 2017

Could you describe that usecase?

@nicolasstucki
Copy link
Contributor Author

I have two development use cases:

  • Running benchmarks locally: Having two distinct projects and is needed as I do not want to clean and recompile twice the whole compiler twice each time I do a change.
  • Comparing the dist jars: Again, if I do not have two separate projects I would need to clean and recompile twice each time I test some change. Additionally I would need to make copies of one set of artifacts before compiling the other, which makes the methodology quite brittle as already experienced.

@smarter
Copy link
Member

smarter commented Sep 28, 2017

I wonder if we could do something a bit more like sbt-crossproject, e.g:

lazy val compiler = dottyProject(NonBootstrapped, Bootstrapped, BootstrappedOptimized)
  .settings(dottyCompilerSettings)
  .bootstrappedSettings(bootstrappedCompilerSettings)
  ...
lazy val `dotty-compiler` = compiler.nonBootstrapped
lazy val `dotty-compiler-bootstrapped` = compiler.bootstrapped
lazy val `dotty-compiler-bootstrapped-optimized` = compiler.boostrappedOptimized

@nicolasstucki
Copy link
Contributor Author

nicolasstucki commented Sep 28, 2017

I will look to the crossproject idea later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants