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

Let prepareOffline accept a all flag #1591

Merged
merged 2 commits into from
Dec 10, 2021
Merged

Conversation

lefou
Copy link
Member

@lefou lefou commented Nov 28, 2021

This should support more control in inheriting modules.

Also, fetch only essential dependencies in Java and Scala modules,
and keep the full fetch behind a all flag, which can be set as parameter.

This is a binary-incompatible change and I have no idea how to preserve compatibility.
Although I could keep the old signature and just forward to the newer,
Loading plugins that also inherit older OfflineSupportModules seem to fail nevertheless.
Also I think Mill isn't checking for multiple commands with the same name,
so I fear just because it works on my machine, it may still lead to some failures for others.
Only fix would be to invent a new name for the command (and deprecate the old).
As Mill 0.10.x is binary-incompatible anyways, I think this one should be ok.

Fix #1576

@lefou lefou force-pushed the prepare-offline branch 3 times, most recently from 8f4d232 to 6e3181b Compare November 28, 2021 23:14
@lefou lefou added the compat-breaker This PR is good to merge, but breaks compatibility and needs to wait till we prepare a major release label Dec 6, 2021
@lefou
Copy link
Member Author

lefou commented Dec 6, 2021

Any opinion about the solution and the incompatible change? @lolgab

This should support more fine-control in inheriting modules.

Also, fetch only essential dependency in Java and Scala module,
and keep the full fetch behint hints: all, source, ...
@lefou
Copy link
Member Author

lefou commented Dec 9, 2021

Maybe, a cleaner but less flexible approach would be to just add a boolean all parameter. So we have only a binary option: resolve some or resolve all.

@lefou
Copy link
Member Author

lefou commented Dec 9, 2021

Then, it's up to the those modules with special needs to provide additional targets

@lihaoyi
Copy link
Member

lihaoyi commented Dec 9, 2021

Yeah I suppose it depends on how much flexibility we expect to need; either a small set of flags if we don't expect to need to add much more, or the PrepareOfflineModule approach I described above if we expect to have lots of different things we'd want to call under foo.prepareOffline.xyz.

@lefou lefou changed the title Let prepareOffline accept a hint parameter Let prepareOffline accept a all flag parameter Dec 9, 2021
@lefou lefou changed the title Let prepareOffline accept a all flag parameter Let prepareOffline accept a all flag Dec 9, 2021
@lefou
Copy link
Member Author

lefou commented Dec 9, 2021

@lihaoyi I changed the implementation to accept a simple all flag.

@lefou lefou merged commit db422f7 into com-lihaoyi:main Dec 10, 2021
@lefou lefou deleted the prepare-offline branch December 10, 2021 07:36
@lefou lefou added this to the after 0.10.0-M4 milestone Dec 10, 2021
pbuszka pushed a commit to pbuszka/mill that referenced this pull request Dec 26, 2021
This should support more control in inheriting modules.

Also, fetch only essential dependencies in Java and Scala modules,
and keep the full fetch behind an `all` flag, which can be set as parameter.

This is a binary-incompatible change and I have no idea how to preserve compatibility.
Although I could keep the old signature and just forward to the newer,
Loading plugins that also inherit older `OfflineSupportModule`s seem to fail nevertheless.
Also I think Mill isn't checking for multiple commands with the same name, 
so I fear just because it works on my machine, it may still lead to some failures for others.
Only fix would be to invent a new name for the command (and deprecate the old).
As Mill 0.10.x is binary-incompatible anyways, I think this one should be ok.

Pull request: com-lihaoyi#1591
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compat-breaker This PR is good to merge, but breaks compatibility and needs to wait till we prepare a major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve offline-support
2 participants