-
Notifications
You must be signed in to change notification settings - Fork 336
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
Add --favor-paths rez-env flag #1305
base: main
Are you sure you want to change the base?
Add --favor-paths rez-env flag #1305
Conversation
Adding FavorPathsOrder Added --favor-paths CLI argument Got tests to pass Got tests to pass
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Hi @ColinKennedy , thanks for this PR, super useful! We have been testing it in Windows and found one issue that I think should be easy to resolve. It looks like Rez implements a
canonical_path definition: rez/src/rez/utils/filesystem.py Line 528 in 71f2f61
In FavorPathsOrder you are checking if the package location is in the list of favor paths: this comparison should be done with To solve it there are a couple of obvious options,
or later on in the compoarison:
Hope this helps, I've tested both with our Windows setup and they work as expected. |
Closes: #1263
Added rez-env cli option,
--favor-paths
--favor-paths /foo:/bar
--favor-paths
,[config.local_packages_path]
is used. All other logic applies.packages_path
or it won't be used during orderingMiscellaneous
Introduced
SplitPaths
to show an alternative way we can be parsing our arguments. If you like that approach, I can add it to--paths
as well, which is currently being described insetup_parser
but then parsed again, in env.pycommand
.Question To Reviewers
I was thinking of also including a new
rez.config.Config
option for favor paths, so that people can set it via environment variable as well. I can think of some situations where this would be really desirable. Would that be okay to add?What's not in this PR, currently
In the original ticket thread, #1263 (comment), @nerdvegas mentions that we may need a kind of "stacked orderer". However I didn't encounter any limitations in practice.
ResolvedContext
takes a list of package orderers so it should be fine. However please let me know if not and I'll make necessary adjustments.