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

Distribute Mill Assembly via Maven Central #2560

Merged
merged 3 commits into from
May 31, 2023

Conversation

lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented May 30, 2023

Creates a stub dist module whose only purpose is to take the dev.assembly and put it on maven central, which the updated bootstrap script will download.

This should help reduce the number of external failure points in Mill bootstrap script; rather than having hard dependency on both Github and Maven Central, this PR reduces it to only a hard dependency on Maven Central. Maven Central is also by default a write-only package store. That means that short of sending them a lawyer letter, the packages published there are immutable (https://central.sonatype.org/faq/can-i-change-a-component). This is in contrast to Github release assets which are read/write.

With Github, a bug in our CI auto-upload system could easily override/delete/corrupt already-published assemblies, causing a widespread outage to anyone depending on the bootstrap script (e.g. in CI) until someone fixes it. It is also vulnerable to Github outages, which are not unheard of. Distribution via Maven Central removes both Github outages and over-writing-existing-artifacts as possible failure modes. While Sonatype can and does have outages, that would already cause a failure in Mill's bootstrapping, so it would be no worse than it already is today

The validity of the various URLs and bootstrap scripts etc. have been tested manually, but end-to-end testing will need to be done post-merge

@lihaoyi lihaoyi marked this pull request as ready for review May 30, 2023 03:06
Copy link
Member

@lefou lefou left a comment

Choose a reason for hiding this comment

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

Looks good to me. One nitpick below.

@@ -1254,7 +1259,7 @@ object dev extends MillPublishScalaModule {
)

lazy val allPublishModules = build.millInternal.modules.collect {
case m: PublishModule if m ne this => m
case m: PublishModule if (m ne this) && (m ne dist) => m
Copy link
Member

@lefou lefou May 30, 2023

Choose a reason for hiding this comment

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

Can we change the name of that target or add some comment to clarify its purpose?

@lihaoyi lihaoyi merged commit db6d7d2 into com-lihaoyi:main May 31, 2023
@lihaoyi
Copy link
Member Author

lihaoyi commented May 31, 2023

Tested this via the unstable version 0.11.0-M10-9-db6d7d, seems to work

@lefou lefou added this to the 0.11.0-M11 milestone May 31, 2023
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.

2 participants