Change how we detect the buildroot.
Review Request #3489 - Created Feb. 23, 2016 and submitted
|jsirois, kwlzn, mateor, patricklaw, stuhood, zundel|
Instead of looking for pants.ini we look for the pants runner script (or any file named 'pants') in the cwd and its ancestors. This is because we don't want to give the location of pants.ini any special extra meaning. We want pants to work with multiple cascading config files (instead of the clunky --config-file-override mechanism) or even no config file at all. A future change will implement configurable config file locations, and will explain in greater detail why that's a good thing...
CI passes here: https://travis-ci.org/pantsbuild/pants/builds/111261172
It looks like these other test locations expect pants.ini as the marker:
- base_test.py near
# We need a pants.ini, even if empty. get_buildroot() uses its presence.
- ReproOptionsTest looks like it may also implicitly rely on pants.ini, though I'm not as sure.
Would still prefer to see this be less hardcoded.
I continue to lightly object to using a single hardcoded file to locate. Would prefer that this be a default list of heuristics from which things could be removed.
- have a prioritized list of [
pants], such that if you wanted to
- special case an environment variable (similar to a PATH) to allow overriding the list to add or remove things
Should add an explanation for how to fix this, or link to a spot in the docs explaining how a user would fix it.
I agree with the comments raised by the other reviewers but I don't see anything further that would block.
find . -name pants -type fin our repo and it came back with just one ./pants at the root, just to be sure it would work for us.
seems to me that a file named
pantscould be more likely to exist in a pants repo subdir than one called
BUILDROOTis also more explicit - and it'd be really nice to have a single clear and explicit way to configure a buildroot.
so why not just jump to
BUILDROOTnow? may save us some time/grief in the long run.
I also don't quite see how depending on
pants(the path to the runner script) is any better philosophically than depending on
pants.ini(the path to the config).
Status: Closed (submitted)
Submitted as f5e2d61a127cc6225bb47f23cd2f2519c63dc535.