-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
Make meta builds (mill-build/build.sc
) opt-in and configurable
#2461
Comments
mill-build/build.sc
opt-in and configurablemill-build/build.sc
) opt-in and configurable
@lihaoyi wrote a comment to issue #2516, which belongs to this discussion:
I think we should not bind the build file name to the directory name of it's potential meta-build. These are two complete different things. My most important mantra is: A By adding a A meta-build is not necessarily tied to a single Choosing a different build script name, e.g. a A If a |
I think there's misunderstanding here. Currently, the The principle here is that the We can certainly add more shorthands like So the I don't think we should rely on meta-builds for shared/machine-global config. It's just not the right place for that kind of thing to live. If we want something like that, we should add specific support for it. |
Ok, thanks for clarifying. It also means, we currently always use We currently have two situations: The simple case: A default Mill setup for building The advanced case / the "long form": A import $meta.`mill-build` and we use the setup of the root module in Question is, if in this long form, every derivation from the defaults needs to be explicitly defined? In that case, my wish to not have a default-included |
Currently, this relies on We could certainly override I expect that we'll see a lot of people putting things in the
These projects could have put everything in |
Yeah, that's a valid point. Getting more but smaller files will also improve compilation speed after small changes. Also cache invalidation is probably already more granular because of that. How about only using a Additionally, we could support a pure |
Btw, with using plain Scala files, we should be finally able to define |
Yes that's what I imagined: that the whole of
That sounds like a good idea. |
Fixes #2461 For now it remains hard-coded as `mill-build/`, for simplicity. Given the `mill-` prefix, it's unlikely to collide with user-defined folders. Making it configurable would open another can of worms where the `import $meta.foo` can now collide with an `object foo`, which is very unintuitive. For now, we just parse the script files one additional time in `MillBuildBootstrap.scala`. This is a bit wasteful, but is probably fast enough for now, and we're already pretty sloppy parsing everything twice in `MillBuildRootModule#scriptSources` and `MillBuildRootModule#parseBuildFiles`, so parsing things three times isn't the end of the world. We can look into optimizing it in future if necessary
As a follow up on PR #2377, we need to come up with some way to configure the
mill-build/build.sc
aka "meta build".Meta builds need to be disabled, unless the
build.sc
explicitly enables it.Meta build location should not be hardcoded but configured when enabled.
The text was updated successfully, but these errors were encountered: