Skip to content
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

Migrate build.sc to Scala 3 #3152

Open
lihaoyi opened this issue May 14, 2024 · 9 comments · May be fixed by #3369
Open

Migrate build.sc to Scala 3 #3152

lihaoyi opened this issue May 14, 2024 · 9 comments · May be fixed by #3369

Comments

@lihaoyi
Copy link
Member

lihaoyi commented May 14, 2024

The goal of this ticket is to move Mill from Scala 2.13 to Scala 3.

Most of Mill's code should be easily portable with minimal changes (e.g. syntax tweaks), but there are three major areas which may require more work:

  1. The import $ivy parser is currently using FastParse's ScalaParse, and would need to be moved over to use a Scala 3 compatible parser similar to what Ammonite does

  2. The compiler plugin for auto-override would need to be migrated over

  3. The various macros like Caller, Task, and Applicative would need to be ported over

  4. The CodeSig analyzer used for fine grained invalidation on build.sc code changes may need to be ported over if Scala 3 generates very different bytecode (not sure, seems unlikely?)

  5. Any older dependencies that only support Scala 2 may need to be updated or replaced

The acceptance criteria is A PR that passes all existing tests on Scala 3, and either modify some existing tests to exercise Scala 3 language features, or add new tests to do so. We may not merge the PR immediately, but having the PR open with all tests passing should be enough for us to integrate the Scala 3 support and at our leisure. This would be a breaking change and would need a version bump, with associated downstream inconvenience

@lihaoyi
Copy link
Member Author

lihaoyi commented May 14, 2024

Some prior art, an attempt to move the Applicative macro to Scala 3: https://github.com/Iltotore/mill-scala-3

@lefou lefou pinned this issue May 15, 2024
@Quafadas
Copy link
Contributor

I have a personal interest / curiosity in learning about mills internals, and support here could be a good way to do it. I'm realistic that I would fail alone through constraints on both time and skill :-).

I would be happy to offer support, or bite off a little chunk on behalf of someone running point though. I don't have any interest in the bounty. I'm knocking around here or discord if anyone would imagine delegating a little chunk.

@lefou lefou added the bounty label May 17, 2024
@lolgab lolgab unpinned this issue May 17, 2024
@lefou lefou pinned this issue May 29, 2024
@lefou lefou unpinned this issue May 29, 2024
@Fiend-Star-666
Copy link

Hi @lefou , is this task still up for grabs?

@lihaoyi
Copy link
Member Author

lihaoyi commented Jul 11, 2024

Yes

@Fiend-Star-666
Copy link

Fiend-Star-666 commented Jul 11, 2024

Thanks for confirming, don't assign this to me for now. I'll try to make this change, if i see some success, would update on this thread asap.

@bishabosha
Copy link
Contributor

bishabosha commented Jul 31, 2024

I am also working on this
Edit: progress in PR #3369

@bishabosha bishabosha linked a pull request Aug 13, 2024 that will close this issue
20 tasks
@asarkar
Copy link

asarkar commented Aug 21, 2024

I came across this ticket after unsuccessfully attempting to use Scala 3 optional braces syntax in the build.sc. It'll be very helpful to note in the documentation that even if the project uses Scala 3 (which I'm), build.sc must be written using Scala 2 syntax. Tools like Gradle publish a compatibility matrix for each version release, but unless I'm wrong, mill isn't doing that yet, so, it's not at all clear what Scala version(s) is supported by the build.sc.

@lihaoyi
Copy link
Member Author

lihaoyi commented Sep 5, 2024

taking down the bounty since @bishabosha is working on this

@lihaoyi lihaoyi changed the title Migrate build.sc to Scala 3 (1000USD Bounty) Migrate build.sc to Scala 3 Sep 5, 2024
@lefou lefou removed the bounty label Sep 6, 2024
@asarkar
Copy link

asarkar commented Sep 6, 2024

@lihaoyi Would you offer any migration tools for automatic rewriting, similar to what the compiler does when a source argument is passed?

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 a pull request may close this issue.

6 participants