aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp/option_processor.h
Commit message (Collapse)AuthorAge
* Change the list of rc files accepted.Gravatar ccalvarin2018-08-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The old list was, in order: - %workspace%/tools/bazel.rc (unless --nomaster_bazelrc) - %binary_dir%/bazel.bazelrc (unless --nomaster_bazelrc) - system rc, /etc/bazel.bazelrc or in %ProgramData% for Windows (unless --nomaster_bazelrc) - the first of the following gets called the "user" bazelrc - path passed by flag --bazelrc - %workspace%/.bazelrc - $HOME/.bazelrc The new list is hopefully a bit more consistent, as: - system rc (unless --nosystem_rc) - workspace, %workspace%/.bazelrc (unless --noworkspace_rc) - user, $HOME/.bazelrc (unless --nohome_rc) - command-line provided, passed as --bazelrc or nothing if the flag is absent. This list removes two less than useful locations, duplication in the Workspace directory, and the rc next to the bazel binary. This location made sense at Google but is generally nonsensical elsewhere so we are removing it. It also stops the user local rc file from being overriden by passing in a custom file in --bazelrc. In both old and new, --ignore_all_rc_files disables all of the above. For a transition period, any file that you would have loaded but was not read will cause a WARNING to be printed. If you want the old file to still be read without moving its location, you can always import it into one of the new standard locations, or create a symlink. Closes #4502, except for cleanup to remove the warning after a transition period of 1 Bazel version has passed. RELNOTES[INC]: New bazelrc file list. PiperOrigin-RevId: 207189212
* Reduce the state kept in OptionProcessor.Gravatar jmmv2018-04-19
| | | | | | | | | | | | | | | Make the list of rc files a local variable as it need not be a class attribute, and drop the unused rcoptions_ field. This is a trivial refactoring and the remaining code is still too confusing. It'd be worth splitting OptionProcessor in two pieces: OptionProcessor to exclusively keep the virtual ParseOptions method and no state, and a new ParsedOptions type to act as the immutable return value of ParseOptions. This would decouple all state mutations. RELNOTES: None. PiperOrigin-RevId: 193557347
* Refactor where rc files are controlled.Gravatar ccalvarin2018-04-19
| | | | | | | In preparation for https://github.com/bazelbuild/bazel/issues/4502, make OptionProcessor::GetRcFiles contain the logic for both the user bazelrcs and the master bazelrcs. RELNOTES: None PiperOrigin-RevId: 193521683
* Refactor blazerc parsing out of OptionProcessor. This change should be a ↵Gravatar Googler2018-02-07
| | | | | | | no-op behavior-wise. RELNOTES: None PiperOrigin-RevId: 184843442
* Send Bazel startup options to server.Gravatar ccalvarin2017-08-16
| | | | | | | | | | | Send the startup options tagged with their origin so that the server has correct information about the command line as the client received it. Removes the unconditional stderr printing of all bazelrc startup options in the bazel client. Instead, the startup options are sent to the server and the same informational printing is gated on the --announce_rc option. This avoids unconditional log spam to stderr early in startup. If the server is unreachable or there are errors parsing startup options, the message is still printed to stderr. Fixes https://github.com/bazelbuild/bazel/issues/2530. RELNOTES: --announce_rc now controls whether bazelrc startup options are printed to stderr. PiperOrigin-RevId: 165211007
* PiperOrigin-RevId: 161791822Gravatar lpino2017-07-14
|
* PiperOrigin-RevId: 161571228Gravatar lpino2017-07-12
|
* Delete the unused OptionProcessor::ParseOptions(argc,argv).Gravatar lpino2017-07-11
| | | | PiperOrigin-RevId: 161523047
* Use a CommandLine struct to store the command line parsed by the ↵Gravatar lpino2017-07-11
| | | | | | | | OptionProcessor. This replaces the startup_args_, command_ and command_argument members to allow a more consistent representation of the command line throughout the class. PiperOrigin-RevId: 161408010
* Open source {workspace_layout,startup_options,option_processor}_test.Gravatar lpino2017-07-05
| | | | | | Additionally rewrite the option_processor_test to make it more flexible. PiperOrigin-RevId: 160958736
* Fix possible parsing of same rc file multiple times.Gravatar lpino2017-04-07
| | | | | | | Write a new function that dedupes a set of paths using its canonical form and use it to remove possible duplicates in the set of rc files that will be parsed. PiperOrigin-RevId: 152489149
* Env.vars: server won't ignore the client envGravatar Dmitry Lomov2017-03-08
| | | | | | | | | | | | | | | | | | Make the --ignore_client_env flag a no-op. The client will pass --client_env flags to the server even in --batch mode. This simplifies the code as well as ensuring that the server always uses the up-do-date client environment. We'll gradually get rid of all System.getenv calls in the server, because the server should always respect the client env. Roll forward of 149403129 with fixes. -- PiperOrigin-RevId: 149435060 MOS_MIGRATED_REVID=149435060
* Rollback of commit 94d8f4e9c8c8757aa7ab7c1a7c3e9afb34039127.Gravatar Klaus Aehlig2017-03-07
| | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** broke //src/test/shell/bazel:bazel_bootstrap_distfile_test *** Original change description *** Env.vars: server won't ignore the client env Make the --ignore_client_env flag a no-op. The client will pass --client_env flags to the server even in --batch mode. This simplifies the code as well as ensuring that the server always uses the up-do-date client environment. We'll gradually get rid of all System.getenv calls in the server, because the server should always respect the client env. -- PiperOrigin-RevId: 149416602 MOS_MIGRATED_REVID=149416602
* Env.vars: server won't ignore the client envGravatar Laszlo Csomor2017-03-07
| | | | | | | | | | | | | | | | Make the --ignore_client_env flag a no-op. The client will pass --client_env flags to the server even in --batch mode. This simplifies the code as well as ensuring that the server always uses the up-do-date client environment. We'll gradually get rid of all System.getenv calls in the server, because the server should always respect the client env. -- PiperOrigin-RevId: 149403129 MOS_MIGRATED_REVID=149403129
* Determine the .bazelrc's name based on the product name.Gravatar Julio Merino2017-01-20
| | | | | | | | | | | | | When looking up the .bazelrc file in the workspace or the home directory, construct its name using the built-in product name instead of hardcoding the name in the WorkspaceLayout class. This removes an additional hardcoded value and changes the code to do the right thing based on the product name. -- PiperOrigin-RevId: 145077783 MOS_MIGRATED_REVID=145077783
* Description redacted.Gravatar Julio Merino2016-12-09
| | | | | | -- PiperOrigin-RevId: 141483567 MOS_MIGRATED_REVID=141483567
* Provide a SplitCommandLine method in the option processorGravatar Luis Fernando Pino Duque2016-11-21
| | | | | | | | | | | | | that takes a given command line args and splits it into the corresponding {binary, startup_args, command, command_args}. The purpose of this function is to help split the responsibilities of the ParseOptions function by processing the startup options independently (i.e. rc files detection and processing) from the command options. This will be combined with ParseOptions in a subsequent CL. -- MOS_MIGRATED_REVID=139773786
* cpp: header hygienizationGravatar Thiago Farina2016-10-18
| | | | | | | | | | | * remove "using std::" declarations from header files * add missing "std::" to some string declarations at some header files * add "using std::string;" to some source files where necessary -- Change-Id: Ib64f62b5add499d6171fa922227194ac992fa542 Reviewed-on: https://bazel-review.googlesource.com/#/c/6630/ MOS_MIGRATED_REVID=136355671
* Roll-forward of the startup options refactoring.Gravatar Julio Merino2016-09-15
| | | | | | | | | | | | | | | This CL is a verbatim reproduction of the following CLs, modulo adjustments to cope with changes at HEAD: * commit 4a45d92130a6b1306a3840d006df165b8040a6cf: Use inheritance to support site-specific options. * commit dfb2c73eda3d2dd8787ea9b2d0a03b49dfa2acc5: Inject the product name via the per-product main.cc files. * unknown commit: Remove the internal/external startup_options duality. The cause that triggered the rollbacks was fixed separately in commit 69a8d7205287bedf3a6140ec9327e2fad1758c22 as prepartory work for this roll-forward, so things should work now. -- MOS_MIGRATED_REVID=133139218
* Rollback of startup options changes.Gravatar Greg Estren2016-09-13
| | | | | -- MOS_MIGRATED_REVID=132940326
* Use inheritance to support site-specific options.Gravatar Julio Merino2016-09-09
| | | | | | | | | | | | | | | | | | Rename BlazeStartupOptions to StartupOptions and turn the latter into a class that can be subclassed to implement site-specific options behavior. This lends itself to easier customization for the site-specific versions, especially if there is more than one, and gets rid of the strange build-time parameterization of the old blaze_startup_options*.cc files. Note that this change introduces various TODOs. This is intentional. This change is quite complex as it is and I want to focus it on reshuffling the class structure without actually touching the internals. The latter can be done in subsequent, more targetted changes that are easier to review and understand. -- MOS_MIGRATED_REVID=132555032
* --Gravatar Luis Fernando Pino Duque2016-07-25
| | | | MOS_MIGRATED_REVID=128348972
* Allow workspace-relative imports in .bazelrcGravatar Googler2015-12-03
| | | | | | | RELNOTES[NEW]: .bazelrc allows workspace-relative imports as "import %workspace%/path/to/rcfile" -- MOS_MIGRATED_REVID=109237460
* Rationalize copyright headersGravatar Damien Martin-Guillerez2015-09-25
| | | | | | | | | | | The headers were modified with `find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'` And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan. The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand. -- MOS_MIGRATED_REVID=103938715
* Added /etc/bazel.bazelrc as a global Bazel's master rc.Gravatar Damien Martin-Guillerez2015-06-15
| | | | | | | | | | This will allow system-wide configuration for system-wide installation of Bazel. -- Change-Id: I71b7232e648f2690766c3b9184f863dc888524c0 Reviewed-on: https://bazel-review.googlesource.com/#/c/1540/ MOS_MIGRATED_REVID=95994630
* Cleanup: Initialize field members through ctor initializer list.Gravatar Thiago Farina2015-06-12
| | | | | | | | | | | | | This seems to be a win as it avoids re-initialing the fields that have a default constructor (non-POD), besides being the best and idiomatic practice. More details in http://stackoverflow.com/a/9903927 -- Change-Id: I6c184e8a53b385756938084ec60aebc8184243a0 Reviewed-on: https://bazel-review.googlesource.com/#/c/1513/3 MOS_MIGRATED_REVID=95815524
* Store RcFile pointers, rather than inline objects.Gravatar Han-Wen Nienhuys2015-05-22
| | | | | | | | | | | | | Since RcFile hands out pointers to its string members, modifying vector<RcFile> may cause reallocation, which invalidates handed out pointers. Fixes #205. -- Change-Id: Id4eb0a4e8a52373130140f1de5697f4e4f4a6f95 Reviewed-on: https://bazel-review.googlesource.com/#/c/1360/ MOS_MIGRATED_REVID=94276823
* Cleanup: Pass std::string arguments by reference (this avoids makingGravatar Thiago Farina2015-05-18
| | | | | | | | | | | | | unnecessary copies) and label them const, per the Google style guide. Tested: $ ./bootstrap_test.sh all -- Change-Id: I17636703cf43283f71b9b913c130a51065bd896b Reviewed-on: https://bazel-review.googlesource.com/1350 MOS_MIGRATED_REVID=93876332
* Update include guards.Gravatar Han-Wen Nienhuys2015-05-15
| | | | | -- MOS_MIGRATED_REVID=93413161
* Move blaze_exit_code.h into util/ directory.Gravatar Thiago Farina2015-04-24
| | | | | | | | This is so util/ files do not depend on anything from higer level. -- Change-Id: I522be6722851f25e79d9c2b85275856cbbd978de MOS_MIGRATED_REVID=91882837
* Header cleanups.Gravatar Han-Wen Nienhuys2015-04-22
| | | | | -- MOS_MIGRATED_REVID=91681168
* Update from Google.Gravatar Han-Wen Nienhuys2015-02-25
-- MOE_MIGRATED_REVID=85702957