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

Don't leak runtime cli imports into generated build scripts #2978

Merged
merged 1 commit into from
Jan 18, 2024
Merged

Conversation

lefou
Copy link
Member

@lefou lefou commented Jan 17, 2024

Since the cli option --import is supposed to affect only the runtime
classpath, there is no need to persist it's value in the generated scripts.

Instead, we hold it in an DynamicVariable at script evaluation time.

Pull request: #2978

Since the cli option `--import` is supposed to affect only the runtime
classpath, there is no need to persist it's value in the generated scripts.

Instead, we hold it in an `DynamicVariabele` at script avaluation time.
/**
* Hold additional runtime dependencies given via the `--import` cli option.
*/
private[runner] object CliImports extends DynamicVariable[Seq[String]](Seq.empty)
Copy link
Member

Choose a reason for hiding this comment

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

Huh I never knew extends DynamicVariable was a thing, but I guess it works

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I first had it as a val in the companion object of MillBuildBootstrap, but acyclic wasn't happy with that. So I moved it and tried to avoid all that nesting, without using a val in a new package object and ended up with this compact thing.

@lefou lefou merged commit efcaf99 into main Jan 18, 2024
38 checks passed
@lefou lefou deleted the cliimports branch January 18, 2024 03:20
@lefou lefou added this to the 0.11.7 milestone Jan 18, 2024
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