-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
Ensure -D
property passing correctly resets when -D
is later removed
#1514
Conversation
Not sure what the mima tests are complaining about, but the failure in the CaffeineTests looks like a flake |
Changing a case class is always binary incompatible. This is OK I think in your case. We currently check all modules, to be aware of any change. |
Evaluator is part of the API which is used in |
@lefou we're only touching Evaluator.State though. Do any plugins really instantiate this? I mean in theory it's not private, but we've never been disciplined about privatizing things in the past. This definitely seems like something I expect Mill to use and nobody else |
Evaluator is part of the documentation (https://com-lihaoyi.github.io/mill/mill/Extending_Mill.html#_evaluator_commands_experimental) and also used outside mill main/core, e.g. contrib plugins make use of it, but probably also thirdparty plugins (e.g. scala steward). As we copy the evaluator, it's fair th assume, others do it, too. I belief providing a nice binary compatibility story is one of the (many) fundatental things to create a nice user experience. It's hard to get right and easily to screw up. Deprecation is a nice tool to show API removal/changes before it's too late. |
@lihaoyi Sorry, I didn't looked carefully. You're right, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
The issue here is that we were not properly resetting the system property when
-D
was removed, resulting in it incorrectly hanging around with the last set value.This PR stores the initial value of every system property, along with the keys for the system properties set with
-D
for each run. Now when a-D
key-value pair is removed, we can compare the key against theinitialSystemProperties
to decide whether we need to either remove the key value or to restore it to its original valueTested manually using a simple
build.sc
:On main, removing
-D
flags leaves the properties hanging around with the last set value:With this PR, removing the `-D flags has the properties either cleared or reset to their initial value:
Review by @lefou