-
Notifications
You must be signed in to change notification settings - Fork 710
Infrastructure to filter commandline arguments #5237
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
Conversation
…grams from the new-build hash input to reduce redundant recompilation. See haskell#4247.
Some example usage code: merijn@b3e55d9 Probably the filters should be written in program specific modules, but moving them into the |
-- | A function that filters any arguments that don't impact the output | ||
-- from a commandline. Used to limit the volatility of dependency hashes | ||
-- when using new-build. | ||
programFilterArgs :: Maybe Version -> [String] -> [String] |
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.
name bikeshedding: I'd rather call this something like programNormalizeArgs
to emphasize this is about normalizing; "filter" would imply that we're only ever going to remove args (i.e. in the sense that the output [String]
would only be a sub-sequence of the original [String]
); but it's conceivable we may at some point do a bit more.
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.
I don't have a strong preference for the name, but I hate trying to come up with them, so I'm fine with whatever the majority wants.
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.
I am with Herbert regarding the name.
Changed the name of the `Program` field to hvr's suggestion. Added a `PackageDescription` argument so we have access to all the options specified in .cabal files and revisions.
Updated to deal with |
Updated this to match the naming issue and deal with |
Now updated so that is actually looks at the list of builtin programs Cabal knows about... |
Last call for comments or I'm merging this! |
This piggybacks any filters on Cabal's support for known programs, it allows us to specify a version specific argument filtering function for each program Cabal knows about.
See #4247.