aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/cmdline
Commit message (Collapse)AuthorAge
* Make SkyKey an interface, and start the migration of not creating SkyKey ↵Gravatar janakr2017-05-04
| | | | | | wrapper objects: for OwnedArtifacts, which are the most numerous during builds, and for Labels for TransitiveTraversalValues, which are the most numerous during queries. PiperOrigin-RevId: 154989520
* Automated g4 rollback of commit 7beadb7277453efec7e12b925005e7f0e003b592.Gravatar nharmata2017-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Original CL was rolled backed incorrectly. See post-submit discussion on http://https://github.com/bazelbuild/bazel/commit/7beadb7277453efec7e12b925005e7f0e003b592. *** Original change description *** Automated g4 rollback of commit 38b835097f9ae9a6062172b8a33ec2e2d1edde20. *** Reason for rollback *** Breaking Bazel build on linux, see http://ci.bazel.io/job/bazel-tests/733/ Repro: bazel build //src/test/java/com/google/devtools/build/lib:packages_test Found by bisecting. *** Original change description *** Only allocate some formerly frequently allocated PathFragment objects once. This reduces both gc churn and retained memory usage. RELNOTES: None PiperOrigin-RevId: 154839279
* Automated g4 rollback of commit 38b835097f9ae9a6062172b8a33ec2e2d1edde20.Gravatar dmarting2017-05-02
| | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaking Bazel build on linux, see http://ci.bazel.io/job/bazel-tests/733/ Repro: bazel build //src/test/java/com/google/devtools/build/lib:packages_test Found by bisecting. *** Original change description *** Only allocate some formerly frequently allocated PathFragment objects once. This reduces both gc churn and retained memory usage. RELNOTES: None PiperOrigin-RevId: 154821457
* Only allocate some formerly frequently allocated PathFragment objects once.Gravatar nharmata2017-05-02
| | | | | | This reduces both gc churn and retained memory usage. PiperOrigin-RevId: 154718782
* Update outdated commentGravatar brandjon2017-04-13
| | | | | RELNOTES: None PiperOrigin-RevId: 152947523
* Refactor all ctor callsites of PathFragment to instead call a static ↵Gravatar nharmata2017-04-05
| | | | | | | | | | | | 'create' method. This paves the way for changing PathFragment to e.g. an abstract class with multiple subclasses. This way we can split out the windows-specific stuff into one of these concrete classes, making the code more readable and also saving memory (since the shallow heap size of the NonWindowsPathFragment subclass will hopefully be smaller than that of the current PathFragment). This also lets us pursue gc churn optimizations. We can now do interning in PathFragment#create and can also get rid of unnecessary intermediate PathFragment allocations. RELNOTES: None PiperOrigin-RevId: 152145768
* Extract a SpawnRunner interfaceGravatar ulfjack2017-04-04
| | | | | | | | | | | | | | | | | | | | | The RemoteSpawnRunner now implements the SpawnRunner interface. Note that Google's internal implementations were also retrofitted, and SpawnRunner is intended as a stable interface; that's also why I decided to move all params into SpawnExecutionPolicy, which is, unfortunately, not quite done yet. The specification of SpawnRunner is also still incomplete. In particular, it is still missing execution info keys, as well as inputs and outputs handling. This is a step towards unifying all SpawnStrategy implementations, with the SpawnRunner implementations performing the actual Spawn execution. There should be no user-visible semantic changes to the code, but one small fix: - GrpcActionCache was trying to download files even if there were none PiperOrigin-RevId: 152105696
* Fix Label.toShorthandString() with non-main/default repositoryGravatar Googler2017-03-20
| | | | | | | | (repository name was added twice in a non-shorthand result). -- PiperOrigin-RevId: 150437337 MOS_MIGRATED_REVID=150437337
* Global cleanup change.Gravatar Googler2017-03-09
| | | | | | -- PiperOrigin-RevId: 149652245 MOS_MIGRATED_REVID=149652245
* Description redacted.Gravatar Nathan Harmata2017-03-09
| | | | | | -- PiperOrigin-RevId: 149585165 MOS_MIGRATED_REVID=149585165
* Allow ' ', '(', ')' and '$' in labels Gravatar Damien Martin-Guillerez2017-03-06
| | | | | | | | | | | | | | | | | | | | | | | This just add the special characters in labels and fixes the associated tests, left is the hard part to test adding those characters everywhere. This is experimental and several characters will break at several location especial in the runfiles manifest file. Follow-ups: Resolve quoting then test, test more and add even more tests. Issue found during development: Parentheses are not accepted in exclude pattern in globs Building a binary includes build-runfiles that relies on the runfiles manifest format so the added test would fails with a java_binary instead of a library. -- Change-Id: I9c87273a90318b931c61bdb86f1066962819960a Reviewed-on: https://cr.bazel.build/9055 PiperOrigin-RevId: 149108027 MOS_MIGRATED_REVID=149108027
* Pass the repository name through to build info factoriesGravatar Kristina Chodorow2017-03-06
| | | | | | | | | | | | I was fixing the Android tests and I noticed that the bazel_workspace_status_test was failing. It was like when you have a thread coming out of a sweater and you start pulling and pretty soon you have no sweater. Long story short, my "Android tests fix" cl ended up needing ~1k more lines changed (on top of the existing enormous CL). So, I'm creating some smaller CLs with the changes that I can extract from the mega CL. Again. Prep for #1681. -- PiperOrigin-RevId: 149106039 MOS_MIGRATED_REVID=149106039
* Rollback of commit 822c37816ac669e51bec3853b41849a19ec5e230.Gravatar Nathan Harmata2017-03-01
| | | | | | -- PiperOrigin-RevId: 148844518 MOS_MIGRATED_REVID=148844518
* Reimplement blaze query using an async evaluation model. Use a concurrent ↵Gravatar Nathan Harmata2017-02-28
| | | | | | | | | | | | | | | | | | | backend for SkyQueryEnvironment's implementation in order to achieve parallelism. Advantages: -New design has no flaws that the old design had. -Code is structured so that deadlocks due to thread starvation are impossible (yup!). Disadvantages: -The meat of this change needs to all be in a single CL because every single QueryFunction and QueryExpression needs to be rewritten in the async style. Still TODO: -Fully embrace the async model in all QueryFunctions (e.g. 'rdeps', 'allpaths'). -Use concurrency in BlazeQueryEnvironment to achieve parallel evaluation for (non SkyQuery) 'blaze query' and genquery. -- PiperOrigin-RevId: 148690279 MOS_MIGRATED_REVID=148690279
* Fix allowed characters in package and restore a commentGravatar Damien Martin-Guillerez2017-02-24
| | | | | | | | Follow-up to commit cae43035f9e6957ad05fec047d015a98aa53f97b -- PiperOrigin-RevId: 148450575 MOS_MIGRATED_REVID=148450575
* Fix Cpp action cachingGravatar Ulf Adams2017-02-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This combines both previous changes and extends them to work both with and without kchodorow@'s rollout of the exec root rearrangement. Unfortunately, each of these changes individually breaks something somewhere, so they must all go into a single commit. Change 1: CppCompileAction must return false from inputsKnown for .d pruning This is necessary (but not sufficient) for the action cache to work correctly. Consider the following sequence of events: 1. action is executed 2. .d pruning is performed 3. action cache writes entry with post-pruning inputs list 4. action gets regenerated (e.g., due to server restart) 5. the action cache calls inputsKnown(), which returns true 6. action cache checks entry from step 3 against pre-pruning inputs list, which results in a cache miss The action cache needs to know that the current list is not the final list, so inputsKnown() in step 5 must return false if .d pruning is enabled. Change 2: Fix artifact root discovery for external artifacts The SkyframeExecutor was assuming that all exec paths were coming from the main repository. Instead, rely on external exec paths to start with "../". Additional change 3: In addition, update the PackageRootResolverWithEnvironment and the HeaderDiscovery to use the single unified repository name guessing implementation. Previously, the PackageRootResolverWithEnvironment was poisoning the source artifact cache, which then caused subsequent lookups to return a bad artifact. Add a precondition to double-check that artifacts looked up by exec path have the correct source root. For compatibility with kchodorow@'s upcoming exec root refactor, if the exec path starts with "external", then assume it's coming from an external repository. This must be removed when that change is successfully rolled out, or it will break if anyone creates a package called 'external'. Additional change 4: On top of all of that, PackageRootResolverWithEnvironment and SkyframeExecutor must use the same source root computation as the Package class itself. I extracted the corresponding code to Root, and added comments both there and in Package to clearly indicate that these methods have to always be modified in sync. Fixes #2490. -- PiperOrigin-RevId: 148439309 MOS_MIGRATED_REVID=148439309
* Some refactoring of LabelValidator Gravatar Damien Martin-Guillerez2017-02-22
| | | | | | | | | | Removed obsoleted TODOs and use more character matcher for package name validation -- Change-Id: I7e8b69e34b0befe8a81c7c32924299790b6c56d0 Reviewed-on: https://cr.bazel.build/9052 PiperOrigin-RevId: 148195881 MOS_MIGRATED_REVID=148195881
* Rollback of commit 4b73e972d909bcd533f2f9940f95a00b9b73bdde.Gravatar Dmitry Lomov2017-02-17
| | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Broke tests on CI: http://ci.bazel.io/job/bazel-tests/570/ *** Original change description *** Roll forward execroot change RELNOTES[INC]: Previously, an external repository would be symlinked into the execution root at execroot/local_repo/external/remote_repo. This changes it to be at execroot/remote_repo. This may break genrules/Skylark actions that hardcode execution root paths. If this causes breakages for you, ensure that genrules are using $(location :target) to access files and Skylark rules are using http://bazel.io/docs/skylark/lib/File.html's path, dirname, etc. functions. Cust... -- PiperOrigin-RevId: 147833177 MOS_MIGRATED_REVID=147833177
* Roll forward execroot changeGravatar Kristina Chodorow2017-02-16
| | | | | | | | | | | | | | | | | RELNOTES[INC]: Previously, an external repository would be symlinked into the execution root at execroot/local_repo/external/remote_repo. This changes it to be at execroot/remote_repo. This may break genrules/Skylark actions that hardcode execution root paths. If this causes breakages for you, ensure that genrules are using $(location :target) to access files and Skylark rules are using http://bazel.io/docs/skylark/lib/File.html's path, dirname, etc. functions. Custom crosstools that hardcode external/<repo> paths will have to be updated. Issue #1262. -- PiperOrigin-RevId: 147726370 MOS_MIGRATED_REVID=147726370
* Be very deliberate about the concept of a TargetPattern's "directory".Gravatar Nathan Harmata2017-01-16
| | | | | | -- PiperOrigin-RevId: 144494739 MOS_MIGRATED_REVID=144494739
* Some little changes to prep for rolling forward the execroot changeGravatar Kristina Chodorow2017-01-05
| | | | | | | | | | This are random little nits that aren't dependent on changing the directory structure, so it makes the (rather large) CL that is coming cleaner. -- PiperOrigin-RevId: 143690681 MOS_MIGRATED_REVID=143690681
* Fix Label() for @short repository labelsGravatar Justine Tunney2017-01-04
| | | | | | -- PiperOrigin-RevId: 143555554 MOS_MIGRATED_REVID=143555554
* Introduce BlazeInterners, a Blaze-specific wrapper around Guava's Interners ↵Gravatar Nathan Harmata2016-11-24
| | | | | | | | | | | that makes an appropriate call to Interners.InternerBuilder#concurrencyLevel. For current readers of this CL, I used this class everywhere in the Blaze codebase. For future readers of this CL, this class should be used to create an Interner in the Blaze codebase. -- MOS_MIGRATED_REVID=140063271
* Allow labels like @foo//:foo to be shortened @fooGravatar Justine Tunney2016-11-22
| | | | | | | | | Fixes #1924 RELNOTES: Labels like "@foo//:foo" can now be written as "@foo" in build files -- MOS_MIGRATED_REVID=139848658
* Add # support for LabelValidator as discussed in #2006Gravatar Meng Zhang2016-11-18
| | | | | | | | | | | | As suggested by @damienmg in #2006 send this out to run it with internal test. Closes #2059 . Progress towards #374. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/2059 MOS_MIGRATED_REVID=139562084
* Make TargetPattern evaluation during query evaluation more parallel-friendly ↵Gravatar Nathan Harmata2016-11-15
| | | | | | | by introducing TargetPattern#parEval, which allows TargetPatterns' evaluations to explicitly have parallel implementations (no need to secretly use a FJP). -- MOS_MIGRATED_REVID=139101922
* Rollback of commit 82d43279f93d95e4c41b4bc598a3cc05ddd1ae1a.Gravatar Laszlo Csomor2016-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks TensorFlow and other Bazel jobs on ci.bazel.io *** Original change description *** Change execution root for external repositories to be ../repo Some of the important aspect of this change: * Remote repos in the execution root are under output_base/execroot/repo_name, so the prefix is ../repo_name (to escape the local workspace name). * Package roots for external repos were previously "output_base/", they are now output_base/external/repo_name (which means source artifacts always have a relative path from their repository). * Outputs are under bazel-bin/external/repo_name/ (or similarly under genfiles). Note that this is a bit of a change from how this was implemented in the previous cl. Fixes #1262. RELNOTES[INC]: Previously, an external repository would be symlinked into the execution root at execroot/local_repo/external/remote_repo. This changes it to be at execroot/remote_repo. This may break genrules/Skylark actions that hardcode execution root paths. If this causes breakages for you, ensure that genrules are using $(location :target) to access files and Skylark rules are using http://bazel.io/docs/skylark/lib/File.html's path, dirname, etc. functions. Roll forward of bdfd58a. -- MOS_MIGRATED_REVID=133709658
* Change execution root for external repositories to be ../repoGravatar Kristina Chodorow2016-09-20
| | | | | | | | | | | | | | | | | | | | | | | Some of the important aspect of this change: * Remote repos in the execution root are under output_base/execroot/repo_name, so the prefix is ../repo_name (to escape the local workspace name). * Package roots for external repos were previously "output_base/", they are now output_base/external/repo_name (which means source artifacts always have a relative path from their repository). * Outputs are under bazel-bin/external/repo_name/ (or similarly under genfiles). Note that this is a bit of a change from how this was implemented in the previous cl. Fixes #1262. RELNOTES[INC]: Previously, an external repository would be symlinked into the execution root at execroot/local_repo/external/remote_repo. This changes it to be at execroot/remote_repo. This may break genrules/Skylark actions that hardcode execution root paths. If this causes breakages for you, ensure that genrules are using $(location :target) to access files and Skylark rules are using http://bazel.io/docs/skylark/lib/File.html's path, dirname, etc. functions. Roll forward of bdfd58a. -- MOS_MIGRATED_REVID=133606309
* Make the code that is using execRoot paths use execRoot pathsGravatar Kristina Chodorow2016-09-09
| | | | | | | | | | | Chipping away at making the big CL for #1262 smaller. Only runfiles paths are different right now, so this makes getPathUnderExecRoot and getSourceRoot return the same thing. Also corrected a couple places where Label.EXTERNAL_PATH_PREFIX and Label.EXTERNAL_PACKAGE_NAME were being used incorrectly. -- MOS_MIGRATED_REVID=132671081
* Allow Skyframe graph lookups and value retrievals to throw InterruptedException.Gravatar Janak Ramakrishnan2016-08-16
| | | | | | | The only place we now don't handle InterruptedException is in the action graph created after analysis, since I'm not sure that will be around for that much longer. -- MOS_MIGRATED_REVID=130327770
* Rename some PackageId and RepositoryName fields/methods in prep for deep ↵Gravatar Kristina Chodorow2016-07-28
| | | | | | | | | | | | | execroot change This is in prep for making the execution root path for external repositories ../repo_name (instead of external/repo_name). Right now, the getRunfilesPath() returns that path, so that is renamed getExecRoot() (since the runfiles are really just a reflection of the execRoot structure). getSourceRoot() replaces getPathFragment, which has always been a confusing name (it's not clear from the name what the difference is between it and getPackageFragment()). It returns the relative path to source files for external repositories (external/repo_name). Also renamed/moved to more sensible class a few static RepositoryName fields. -- MOS_MIGRATED_REVID=128594419
* Call precomputed() on static CharMatcher instances.Gravatar Googler2016-07-26
| | | | | | | Removes a noticeable hotspot from LabelValidator.validateTargetName(). -- MOS_MIGRATED_REVID=128359980
* Add missing public visibility to ↵Gravatar Damien Martin-Guillerez2016-07-25
| | | | | | | | | | | | | src/main/java/com/google/devtools/build/lib/cmdline:srcs Tested with bazel build --nobuild //tools/cpp/test:test_cc_configure-ubuntu-15.10-dbg Fixes #1554 -- Change-Id: Ib15a08780f98ed410ae6601645b4c7d87b1c8871 Reviewed-on: https://bazel-review.googlesource.com/#/c/4152/ MOS_MIGRATED_REVID=128336692
* Move cmdline lib to its own packageGravatar Kristina Chodorow2016-07-21
| | | | | -- MOS_MIGRATED_REVID=128097235
* java_proto_library: add support for avoiding generating code for protos that ↵Gravatar Carmi Grushko2016-07-15
| | | | | | | are already compiled into a proto runtime. -- MOS_MIGRATED_REVID=127489419
* Make repository name warning less noisyGravatar Kristina Chodorow2016-07-01
| | | | | | | This way it won't print if the repo maintainer doesn't set the repo name. -- MOS_MIGRATED_REVID=126300205
* Reorganize Skylark Reference documentation.Gravatar Dmitry Lomov2016-06-29
| | | | | -- MOS_MIGRATED_REVID=126081020
* Fix some GC churn issues when dealing with Labels:Gravatar Eric Fellheimer2016-06-27
| | | | | | | | - reduce use of #substring(), which must copy the sub-region of the string - specialize hashCode() implementation so that we don't need to push objects into an array. -- MOS_MIGRATED_REVID=125798978
* Update the javadoc of TargetPattern#getDirectory in the presence of commit ↵Gravatar Nathan Harmata2016-06-23
| | | | | | | 8096c4274ac57267dace4166ac05d5665b098d95. -- MOS_MIGRATED_REVID=125582515
* Make execution root symlink builder handle PackageIdentifiersGravatar Kristina Chodorow2016-06-23
| | | | | | | Part of the rollforward for #1262. -- MOS_MIGRATED_REVID=125562871
* Rollback of commit bdfd58a8ca2ed5735d6aaa5b238fb0f689515724.Gravatar Laurent Le Brun2016-06-20
| | | | | -- MOS_MIGRATED_REVID=125160288
* Make the execution root match the runfiles tree structure for external ↵Gravatar Kristina Chodorow2016-06-17
| | | | | | | | | | | | | | | | | | | | | repositories One interesting side effect of how this is implemented is that for external repositories, bin/ and genfiles/ are combined. External repo output is under bazel-out/local-fastbuild/repo_name for each repo. Fixes #1262. RELNOTES[INC]: Previously, an external repository would be symlinked into the execution root at execroot/local_repo/external/remote_repo. This changes it to be at execroot/remote_repo. This may break genrules/Skylark actions that hardcode execution root paths. If this causes breakages for you, ensure that genrules are using $(location :target) to access files and Skylark rules are using http://bazel.io/docs/skylark/lib/File.html's path, dirname, etc. functions. -- MOS_MIGRATED_REVID=125095799
* Short-circuit equality comparison for unequal PackageIdentifiers by ↵Gravatar Shreya Bhattarai2016-05-27
| | | | | | | | | precomputing the hash. See commit 102a9a101a52f4ca92c9e97387ae159e54e87b05 for Nathan's original investigation into Label interning contention. -- MOS_MIGRATED_REVID=123314470
* Precompute Label#hashCode and use it to implement a fast-path for #equals. ↵Gravatar Nathan Harmata2016-05-19
| | | | | | | | | Label#equals was a cpu hotspot revealed during profiling. The additional field for the precomputed hash code has no memory cost since each Label instance was already wasting 4 bytes due to object alignment requirements. -- MOS_MIGRATED_REVID=122626707
* Switch to using ../repo-name syntax for runfilesGravatar Kristina Chodorow2016-05-04
| | | | | -- MOS_MIGRATED_REVID=121475668
* Introduce Label.EXTERNAL_PACKAGE_FILE_NAME as a convenience. Note that we ↵Gravatar Nathan Harmata2016-04-27
| | | | | | | already have Label.EXTERNAL_PACKAGE_NAME. -- MOS_MIGRATED_REVID=120828276
* Fix target parsing bug with targets in the empty package (e.g. "blah" was ↵Gravatar Nathan Harmata2016-04-22
| | | | | | | | | | | | | incorrectly not being parsed as "//:blah"). Also add tests for parsing absolute labels in the empty package. The empty package has been a thing in Bazel for a while now. Note that the old error message in this case "couldn't determine target for filename 'blah'" was almost always misleading and unhelpful since we were (almost certainly incorrectly) assuming the user intended for 'blah' to be an input file in the empty package. Now the error message would be "no such target '//:blah'") which is similarly misleading and unhelpful but probably marginally less so. If we desire to improve this, a future cleanup can introduce smarter error messages. -- MOS_MIGRATED_REVID=120566819
* Automated [] rollback of commit 857cda2c45a5cc68c3fa398311c48c571a64915d and ↵Gravatar Damien Martin-Guillerez2016-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | commit 790d2f6009d47fe92cf0cd92a1473bbf0141f32e. *** Reason for rollback *** Broke non-Bazel projects on ci.bazel.io Fixes #1168 *** Original change description *** Move the runfiles for external repositories to under the x.runfiles/ directory This also sets the Bazel workspace name to io_bazel_source. Fixes #848. Relevant to #1116, #1124, RELNOTES[INC]: All repositories are now directly under the x.runfiles directory in the runfiles tree (previously, external repositories were at x.runfiles/main-repo/external/other-repo. This simplifies handling remote repository runfiles considerably, but will break existing references to external repository runfiles.... *** -- MOS_MIGRATED_REVID=120535721
* Move the runfiles for external repositories to under the x.runfiles/ directoryGravatar Kristina Chodorow2016-04-20
| | | | | | | | | | | | | | | This also sets the Bazel workspace name to io_bazel_source. Fixes #848. Relevant to #1116, #1124, RELNOTES[INC]: All repositories are now directly under the x.runfiles directory in the runfiles tree (previously, external repositories were at x.runfiles/main-repo/external/other-repo. This simplifies handling remote repository runfiles considerably, but will break existing references to external repository runfiles. --- Furthermore, if a Bazel project does not provide a workspace name in the WORKSPACE file, Bazel will now default to using __main__ as the workspace name (instead of "", as previously). The repository's runfiles will appear under x.runfiles/__main__/. -- MOS_MIGRATED_REVID=120224534
* Enable all Label instantiations to use a single intern pool to optimize ↵Gravatar Googler2016-04-01
| | | | | | | | | memory usage Label instances do not share a single intern pool today, as some other objects, such as SkyKey and PackageIdentifier. This change allows all Label instantiations to use a single intern pool for better memory usage. -- MOS_MIGRATED_REVID=118780952