mill icon indicating copy to clipboard operation
mill copied to clipboard

Make `package.mill` discovery configurable

Open lefou opened this issue 8 months ago • 0 comments

Before https://github.com/com-lihaoyi/mill/pull/4969, sub-package discovery and usage needed to be enabled explicitly (with import $packages._).

Now, they will be used when found, which seems convenient in most cases. But it also makes reasoning about a build harder, since a potential new developer needs to inspect the possibly large project to get the full picture. There is also no current way to disable this features.

I propose the add a way to configure it, to make reasoning easier.

Explicitly enable the package discovery. Not finding one should be an error.

//| packages: true

Explicitly disable the package discovery. Mill should not search for and not use any package.mill.

//| packages: false

Future ideas: Explicitly configure the locations of all sub-packages. Mill should use exactly these packages. A missing one should be an error.

//| packages:
//|   - "foo/package.mill"
//|   - "bar/package.mill"
//|   - "bar/baz/package.mill"

lefou avatar Apr 25 '25 08:04 lefou