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

Bump MainArgs to 0.6.1 #2990

Merged
merged 10 commits into from
Jan 26, 2024
Merged

Bump MainArgs to 0.6.1 #2990

merged 10 commits into from
Jan 26, 2024

Conversation

lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented Jan 26, 2024

Also updated the bash launchers' special casing of -i to allow for it to be part of a combined token, as long as the combined token starts with -i

With the installLocalCacheed version of Mill, I can now run:

$ ./mill -ikw contrib.__.compile

and the flags -i, -k, and -w will all take effect independently

The auto-kebab-case name mapping applies to Mill's own CLI args, the args of user-defined T.commands, but not the names of the target/command themselves. e.g. you can call;

  • ./mill --noServer core.ivyDepsTree --withCompile --withRuntime or
  • ./mill --no-server core.ivyDepsTree --with-compile --with-runtime

but you cannot call

  • ./mill --no-server core.ivy-deps-tree --with-compile --with-runtime

It should be easy to add name-mapping for the target selector as well, or I could also disable the name-mapping for user-define command arguments if we decide that's not the right thing to do. I'm not sure TBH what the right thing to do here is; bash naming conventions is fundamentally incompatible with Scala naming conventions, so regardless what Mill decides there will be some inconsistencies between:

  • Bash naming conventions
  • Mill's own CLI flag naming conventions
  • Mill CLI task naming conventions
  • Mill CLI command argument naming conventions
  • Mill Scala object/method naming conventions
  • Mill Scala method argument naming conventions
  • Scala object/method naming conventions
  • Scala method argument naming conventions

I guess it just depend where we want to draw the line and tolerate the inconsistency. I feel like maybe something like ./mill --no-server core.ivy-deps-tree --with-compile --with-runtime would be the ideal outcome, where everything in Bash-land is consistent and everything in Scala-land is consistent.

Pull request: #2990

@@ -148,7 +148,7 @@ object Resolve {
allowRepeats = false,
allowLeftover = ep.argSigs0.exists(_.reader.isLeftover)
).flatMap { (grouped: TokenGrouping[_]) =>
val mainData = ep.asInstanceOf[MainData[_, Any]]
val mainData = ep.asInstanceOf[MainData[Any, Any]]
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure why this is necessary, something about type inference must have changed in 0.6.0 to make it source incompatible (even though it's binary compatible)

Copy link
Member

Choose a reason for hiding this comment

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

Seems, bumping the version to 0.6.0 was the right move.

@lihaoyi lihaoyi requested a review from lefou January 26, 2024 06:09
@lihaoyi lihaoyi changed the title Bump MainArgs to 0.6.0 Bump MainArgs to 0.6.1 Jan 26, 2024
@lihaoyi lihaoyi merged commit e171ad4 into com-lihaoyi:main Jan 26, 2024
38 checks passed
@lefou lefou added this to the 0.11.7 milestone Jan 26, 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.

None yet

2 participants