forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bootstrap scheduler ignores invalid BUILD file symbols when parsing (p…
…antsbuild#16661) Part of the environment redesign from pantsbuild#7735. We decided (for now, subject to change) to model each environment's metadata via targets. This creates a chicken-and-egg problem with Pants's bootstrapping with `PluginResolver`. The `PluginResolver` runs a `VenvPex`, and thus needs to access several config files like `[GLOBAL].ca_certs_path` and `[python-bootstrap]`. To do that, we will need to load what `local_environment` targets the user has. That works fine, except that we will not yet have loaded most backends and any plugins, so it's very likely BUILD files will fail to parse due to unrecognized symbols. The solution is to simply ignore those symbols at the bootstrap stage. As shown by this PR's tests, any problematic symbols will be skipped; the valid targets still work. After the bootstrap stage, those BUILD files will be re-parsed and we will properly error on unrecognized symbols. The alternative approach I considered is creating a convention that environments should only be defined in specific BUILD files, without other targets. However, that is arbitrary to limit our users, and it would be hard to pull off because our code is based on `AddressFamilyDir`, which looks at all BUILD files in that directory, not only one of them. This does not yet properly handle `__defaults__`: pantsbuild#16669 [ci skip-rust] [ci skip-build-wheels]
- Loading branch information
1 parent
cf75d1a
commit a790721
Showing
6 changed files
with
128 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters