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
Fix using relative paths with --local-cache-dir
and --named-caches-dir
#10398
Conversation
…-dir` # Rust tests will be skipped. Delete if not intended. [ci skip-rust-tests]
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'm not certain that this is a good change. An alternative approach would be to eagerly fail if a relative path is used and to give instructions about using %(buildroot)s
.
But, I think I ultimately am in favor because we generally allow relative paths every where else, like with --pants-ignore
and --isort-config
. Thoughts?
Whatever we decide, we should be consistent with pantsbuild/setup#83, such as possibly reverting it.
Just my personal style would be to force everyone on to one approach (i.e. absolute paths) but provide really helpful assertion errors when devs try other common approaches (i.e. relative paths). I can't think of any relative path use case that is not solved by All that said, Gitlab does require all cached files to go in the buildroot so need a clear consistent way to move the three cache directories from their default locations to the buildroot/working directory. |
So, in the thread I started to recommended making paths absolute via interpolation of those variables, but I ended up deleting that because consistently resolving all file/dir options relative to either the location of the file they were declared in or on the CLI would be the least surprising thing, probably. |
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 think this is fine, and probably the least hassle to users.
[ci skip-rust-tests]
[ci skip-rust-tests]
Before, this would not actually write to anything:
While a user could use
${PWD}/test_cache}
or%(buildroot)s
in a config file, we generally allow relative paths with Pants, like--pants-ignore=test_cache
, so there's an argument that we should be consistent here.[ci skip-rust-tests]