aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/RunfilesSupport.java
Commit message (Collapse)AuthorAge
* Remove attribute read checks expecting a DATA transition.Gravatar gregce2018-05-25
| | | | | | | | | | | | | | This is a precursor to removing the DATA transition outright. While we could also have changed the Mode.DATA instances to Mode.TARGET (which would declare that we expect the attribute not to apply any transition), that would break existing definitions and make depot cleanup more delicate. Plus, these checks weren't being consistently applied across attributes anyway so they don't really offer much. A lot of this logic is really just leftover legacy from the pre-dynamic configuration days. PiperOrigin-RevId: 198085059
* Make SymlinkTreeAction properly use the configuration's environmentGravatar ulfjack2018-05-22
| | | | | | | | In particular, fix its use of client make variables. Fixes #4750. PiperOrigin-RevId: 197545415
* Deletes CODEC fields now that they are no longer needed.Gravatar shahan2018-02-28
| | | | PiperOrigin-RevId: 187397314
* Move CommandLine, CommandLineItem, and ParamFileInfo from ↵Gravatar tomlu2018-02-15
| | | | | | | | | lib.analysis.actions -> lib.actions. These are fundamental types that want to sit alongside types like Spawn. RELNOTES: None PiperOrigin-RevId: 185887971
* Use AutoCodec to generate CODECs for a few more provider types that areGravatar cpeyser2018-02-15
| | | | | | exported by cc_library. PiperOrigin-RevId: 185852115
* Remove code that allows RunfilesSupport.owningExecutable to be null.Gravatar Benjamin Peterson2018-02-15
| | | | | | | RunfilesSupport.owningExecutable can clearly never be null because the first thing the constructor does is reject it if it's null. Change-Id: Ie861d96a2a2ab6937f1e27a6745cf1cb2f50e0fb PiperOrigin-RevId: 185806352
* Automated rollback of commit 4260c30a03a9b83d48a5e8690aca19cd80be4c38.Gravatar ulfjack2018-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Try again with fixes. *** Original change description *** Automated rollback of commit 10b0d8aa6b73a024cc007c5e075cb329add878ef. *** Reason for rollback *** Breaks Google-internal targets, sadly. *** Original change description *** Ban middlemen from runfiles artifacts. Previous changes have removed all middlemen from runfiles artifacts. This CL locks it down and removes various now-redundant *WithoutMiddlemen() methods from Runfiles. I put a check for middlemen in ConflictChecker.put, which should be a chokepoint for runfiles arti... *** PiperOrigin-RevId: 184661375
* Rework implementation of --nobuild_runfile_manifests.Gravatar Benjamin Peterson2018-01-03
| | | | | | | | | | | | | When --nobuild_runfile_manifests is passed, don't create runfiles input or output manifests at all. This seems better than creating fake manifest artifacts that are actually a middleman. Fail fast for local tests and the run command when --nobuild_runfiles_manifests is passed. (These cases were failing with obscure errors before under --nobuild_runfile_manifests-I just improved the messaging. See https://github.com/bazelbuild/bazel/issues/4177.) Change-Id: I351d26f746ecbe47016b58e4662768a5b6a72ff2 PiperOrigin-RevId: 180659571
* Avoid expansion of NestedSets in MiddlemanFactory.Gravatar Benjamin Peterson2017-12-11
| | | | | | | | | | | | MiddlemanFactory wants to check if the middleman inputs set is empty or singleton. A NestedSet can answer both queries efficiently if the right APIs are used. My ultimate goal here is to avoid the expansion of runfiles artifacts nested sets until execution. Change-Id: I29a269df757ef41b1410bbb492cf24c926df6114 PiperOrigin-RevId: 178600943
* Remove some deadish Windows-related runfiles code.Gravatar Benjamin Peterson2017-12-04
| | | | | | | | | | | | | | | In particular, SymlinkTreeAction no longer needs to accept artifacts as an input. --experimental_enable_runfiles now immediately reports an error on Windows. This mostly unwinds e4974e4cc6aeb437d36b3b36eb20142b7120fb16 ("Separate runfiles middlemen into two layers") and 41f4456ac2348bef66739194853a1ddadcbb887e ("Make runfiles tree creation on Windows depend on the artifacts of the actual runfiles."). See https://groups.google.com/d/msg/bazel-dev/btOAgxv434g/bDhTOOePAgAJ. Change-Id: Iac3308669bfc07abfd1c91445922269d8fdc2a26 PiperOrigin-RevId: 177837504
* Automated rollback of commit 10b0d8aa6b73a024cc007c5e075cb329add878ef.Gravatar lberki2017-11-14
| | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks Google-internal targets, sadly. *** Original change description *** Ban middlemen from runfiles artifacts. Previous changes have removed all middlemen from runfiles artifacts. This CL locks it down and removes various now-redundant *WithoutMiddlemen() methods from Runfiles. I put a check for middlemen in ConflictChecker.put, which should be a chokepoint for runfiles artifacts. It's unfortunate we can't detect middlemen earlier than execution, but I can't see a way to efficiently check every runfiles artifact earlier. Cha... *** RELNOTES: None. PiperOrigin-RevId: 175650018
* Ban middlemen from runfiles artifacts.Gravatar Benjamin Peterson2017-11-10
| | | | | | | | | | | | | | Previous changes have removed all middlemen from runfiles artifacts. This CL locks it down and removes various now-redundant *WithoutMiddlemen() methods from Runfiles. I put a check for middlemen in ConflictChecker.put, which should be a chokepoint for runfiles artifacts. It's unfortunate we can't detect middlemen earlier than execution, but I can't see a way to efficiently check every runfiles artifact earlier. Change-Id: I57fcb51b02e40adf3ebc4591c26bf5492c89352f PiperOrigin-RevId: 175206157
* Replace all usages of Blaze's Preconditions class with guava.Gravatar tomlu2017-11-09
| | | | | | | | Blaze had its own class to avoid GC from varargs array creation for the precondition happy path. Guava now (mostly) implements these, making it unnecessary to maintain our own. This change was almost entirely automated by search-and-replace. A few BUILD files needed fixing up since I removed an export of preconditions from lib:util, which was all done by add_deps. There was one incorrect usage of Preconditions that was caught by error prone (which checks Guava's version of Preconditions) that I had to change manually. PiperOrigin-RevId: 175033526
* Make it an error to attempt to expand an attribute that does not existGravatar ulfjack2017-10-11
| | | | PiperOrigin-RevId: 171684595
* Move expansion functionality to a new classGravatar ulfjack2017-09-29
| | | | | | Progress on #2475. PiperOrigin-RevId: 170473111
* Make the state in RuleContext explicitGravatar ulfjack2017-09-28
| | | | | | | | | | | | | | | | | | | | | This isn't ideal - RuleContext should not have state, but this ended up happening between adding a cache and refactoring how make variables are discovered. I have carefully traced back all callers that provide custom make variable suppliers and added an init call to their rule initialization. Note that the ConfigurationMakeVariableContext is _cached_, so callers that call in without any make variable suppliers and then call again with them would get the context from the previous call. We now enforce that the ConfigurationMakeVariableContext is only initialized once, and that this happens before any usage, which is slightly better than the previous state, where initialization was silently ignored on any subsequent call. Progress on #2475. PiperOrigin-RevId: 170312285
* Simplify RuleContext APIGravatar ulfjack2017-09-27
| | | | | | | | | Use ConfigurationMakeVariableContext instead of passing in lists of MakeVariableSuppliers. Progress on #2475. PiperOrigin-RevId: 170182945
* Automated rollback of commit 743dc14f9f30b80d6d821612f77186afb025477d.Gravatar dslomov2017-09-19
| | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rollforward with a fix *** Original change description *** Automated rollback of commit 0ee3aa622fc13b8a5072ebddf5cd65823413b4ff. *** Reason for rollback *** Likely causing artifact conflicts for middleman artifacts in some cases due to accidental change of getMiddlemanDir() to getBinDir() in RunfilesSupport.createManifestMiddleman. *** Original change description *** Cleanup ActionConstructionContext. Do not expose the underlying Rule. RELNOTES: None. PiperOrigin-RevId: 169241011
* Automated rollback of commit 0ee3aa622fc13b8a5072ebddf5cd65823413b4ff.Gravatar ulfjack2017-09-19
| | | | | | | | | | | | | | | *** Reason for rollback *** Likely causing artifact conflicts for middleman artifacts in some cases due to accidental change of getMiddlemanDir() to getBinDir() in RunfilesSupport.createManifestMiddleman. *** Original change description *** Cleanup ActionConstructionContext. Do not expose the underlying Rule. RELNOTES: None. PiperOrigin-RevId: 169230095
* Move RuleConfiguredTarget to lib.analysis.configuredtargets.Gravatar gregce2017-09-19
| | | | | | This is a trivial change with a large file footprint. PiperOrigin-RevId: 169169864
* Cleanup ActionConstructionContext.Gravatar dslomov2017-09-19
| | | | | | | Do not expose the underlying Rule. RELNOTES: None. PiperOrigin-RevId: 169109552
* Fix --nobuild_runfile_manifests to keep transitive dependencies of the runfilesGravatar Googler2017-09-01
| | | | | | | manifest on "pruning manifests". We may need these at test execution time. RELNOTES: None. PiperOrigin-RevId: 167147362
* Add a --build_runfile_manifests flag which controls production ofGravatar Googler2017-08-22
| | | | | | | | foo_test.runfiles_manifest files. These are the largest local outputs in many builds, and unnecessary for remote test execution. RELNOTES: New --build_runfile_manifests flag controls production of runfiles manifests. PiperOrigin-RevId: 166001477
* Simplify RunfilesSupport interface by having it call ↵Gravatar Googler2017-08-21
| | | | | | | RuleContext.shouldCreateRunfilesSymlinks() itself. RELNOTES: None. PiperOrigin-RevId: 165774395
* Use FeatureConfiguration to compute value of CC_FLAGS make variableGravatar hlopko2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | This cl introduces new action_config type for Crosstool named 'generic'. This can be used to set the value of CC_FLAGS make variable using much more expressive mechanism (action_configs + features) than previous make_variable Crosstool messages. This has been requested by the C++ LPT. However, as FeatureConfiguration needs RuleContext, CC_FLAGS cannot be computed using configuration only anymore. Also, FeatureConfiguration is C++ rules specific class, and Bazel build-base cannot depend on it. Therefore we cannot use FeatureConfiguration for ExtraActions, for example. Because it cannot be made perfect, this cl is not updating all the possible places that expand make variables but limits the scope to: * genrule (the only widely used rule that often expands make variables) * *_test (CC_FLAGS is used by Tensorflow in the 'args' attribute) * cc_rules (people sometimes set 'copts' to something like: "-DCC_STRING=\\\"$(CC)\\\" -DCC_FLAGS_STRING=\"$(CC_FLAGS)\"" The long term plan is to use Skylark C++ API to get C++ command lines, so CC_FLAGS together with this inconsistent solution will be removed. RELNOTES: CC_FLAGS can be defined using 'generic' action_config in CROSSTOOL PiperOrigin-RevId: 157202883
* Use nested sets for configured target runfiles instead of flattened lists.Gravatar Googler2017-05-26
| | | | | RELNOTES: None PiperOrigin-RevId: 157124371
* Automated g4 rollback of commit e2edf2e141a09c025a958d580c7cac7b57c70d83.Gravatar Googler2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rollforward with fix. *** Original change description *** Automated g4 rollback of commit c78c947e6a8cbb323304f872a3dcabb989a3d76b. *** Reason for rollback *** Breaks android targets in the nightly - see [] *** Original change description *** Do not retain transitive data in AndroidLocalTestBase... *** ROLLBACK_OF=156745610 RELNOTES: None PiperOrigin-RevId: 157028029
* Automated g4 rollback of commit c78c947e6a8cbb323304f872a3dcabb989a3d76b.Gravatar cpeyser2017-05-23
| | | | | | | | | | | | | | *** Reason for rollback *** Breaks android targets in the nightly - see [] *** Original change description *** Do not retain transitive data in AndroidLocalTestBase. The argument strings and artifacts were both transitive and flattened, causing O(N^2) memory consumption. PiperOrigin-RevId: 156745610
* Do not retain transitive data in AndroidLocalTestBase.Gravatar Googler2017-05-15
| | | | | | The argument strings and artifacts were both transitive and flattened, causing O(N^2) memory consumption. PiperOrigin-RevId: 156083738
* Fix --run_under to work with labels that describe source or output filesGravatar Ulf Adams2017-02-17
| | | | | | | | | Before this change, running with --run_under=//foo:foo.sh gave an error, if foo.sh is an executable shell script. -- PiperOrigin-RevId: 147831484 MOS_MIGRATED_REVID=147831484
* Move some actions to language-specific packages, where they belong.Gravatar Lukacs Berki2016-11-23
| | | | | -- MOS_MIGRATED_REVID=140024976
* Add the repository name as a parameter to the output path functionsGravatar Kristina Chodorow2016-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't do anything yet, it's in preparation for the execroot rearranging change. The execroot will have one bazel-out per repo, so it'll look like: execroot/ repo1/ bazel-out/ local-fastbuild/ bin/ repo2/ bazel-out/ local-fastbuild/ bin/ genfiles/ repo3/ bazel-out/ local-fastbuild/ testlogs/ and so on. Thus, any output path (getBinDirectory() & friends) needs to know what the repo name is. This changes so many places in the code I thought it would be good to do separately, then just flip the functionality in the execroot-rearranging commit. While I was poking around, I changed all of the refs I could from getPackageRelativeArtifact() to getBin/GenfilesArtifact(), so that 1) rule implementation don't have to know as much about roots and 2) they'll be more isolated from other output dir changes. `bazel info` and similar just return roots for the main repository. The only "change" is passing around a target label in the Java rules. Continues work on #1262. -- MOS_MIGRATED_REVID=129985336
* Short-circuit runfiles tree creation if runfiles are disabled (for example, ↵Gravatar Lukacs Berki2016-08-04
| | | | | | | on Windows by default) -- MOS_MIGRATED_REVID=129319018
* Disable runfiles on Windows.Gravatar Dmitry Lomov2016-06-21
| | | | | | | | | | | | This adds a new configuration option that allows disabling the creation of symlink forest for runfiles. On Windows, symlink forest is disabled by default; only the runfiles manifest is created. For shell tests, a function 'rlocation' is provided that converts from runfiles location to a real location. Work towards #1212. -- MOS_MIGRATED_REVID=125439553
* Set Bazel's workspace nameGravatar Kristina Chodorow2016-04-27
| | | | | | | | | | RELNOTES: Bazel's workspace name is now io_bazel. If you are using Bazel's source as an external repository, then you may want to update the name you're referring to it as or you'll begin seeing warnings about name mismatches in your code. -- MOS_MIGRATED_REVID=120926179
* Add a --legacy_external_runfiles optionGravatar Kristina Chodorow2016-04-25
| | | | | | | | This isn't hooked up to anything yet, but is another piece of getting #848 rolled forward. -- MOS_MIGRATED_REVID=120582973
* 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
* Clean up the runfiles / files-to-run related code a bit.Gravatar Ulf Adams2016-04-21
| | | | | -- MOS_MIGRATED_REVID=120433463
* 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
* Use the local shell environment for invoking build-runfiles.Gravatar Lukacs Berki2016-03-30
| | | | | | | This is necessary because build-runfiles depends on the msys shared library, which (as per DLL lookup rules on Windows) is checked under the entries of PATH. -- MOS_MIGRATED_REVID=118556684
* Windows: execute build-runfiles through shell.Gravatar Dmitry Lomov2016-02-12
| | | | | | | Needed for #276. -- MOS_MIGRATED_REVID=114529775
* Make runfiles tree creation on Windows depend on the artifacts of the actual ↵Gravatar Lukacs Berki2016-01-26
| | | | | | | | | | | | | | | runfiles. This is necessary because the plan for Windows calls for knowing if the target of the symlink is a directory or a file, thus, we cannot create runfiles trees before the artifacts in them are built. This probably comes with a performance hit due to the extra scheduling constraints. This makes almost every test pass save: - test_tmpdir in bazel_test_test, which I hereby dismiss as a fluke - test_http_archive_tgz in external_integration_test (Maybe a permissions issue due to copying things?) - A bunch of test in external_correctness_test, probably related to the fact that since we are copying things, we don't notice changes to the original files. -- MOS_MIGRATED_REVID=113050025
* Separate runfiles middlemen into two layers: one that is a middleman for the ↵Gravatar Lukacs Berki2016-01-26
| | | | | | | | | | | files itself, and one that contains this middleman and the runfiles output manifest. This is in preparation for Windows symlink support in runfiles manifests: on Windows, we'll need the target files created before we can create the runfiles symlinks for them, but we can't do that by adding the current runfiles middleman to the inputs of SymlinkTreeAction because it would create a cycle (output manifest -> SymlinkTreeAction -> runfiles manifest -> MiddlemanAction -> output manifest) The alternative is to just add the artifacts to the inputs of SymlinkTreeAction, but that would create a bunch of extra edges and, more importantly, reverse edges in the action graph which we don't want. -- MOS_MIGRATED_REVID=113041344
* Use Bazel Preconditions variant which avoids varargs array creationGravatar Mark Schaller2015-12-10
| | | | | | | Reduces garbage. -- MOS_MIGRATED_REVID=109914243
* 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
* Set the workspace suffix for runfilesGravatar Kristina Chodorow2015-08-13
| | | | | | | This CL covers the "easy" cases. Followup CLs will take care of couple dozen remaining gnarly ones. -- MOS_MIGRATED_REVID=100479410
* Remove an unused method from RuleContext.Gravatar Ulf Adams2015-07-29
| | | | | -- MOS_MIGRATED_REVID=99377171
* Check that most output artifacts are under a directory determined by the ↵Gravatar Lukacs Berki2015-07-29
| | | | | | | | | repository and package of the rule being analyzed. Currently this directory is PACKAGE for rules in the main repository and external/REPOSITORY_NAME/PACKAGE for rules in other repositories. This is a plan to fix #293. Ideally, we would simply make it impossible to create artifacts not under that location, but in practice, we cannot do that because some rules do want to do this, mostly those that are already problematic due to shared actions. So the battle plan is to eliminate as many calls to AnalysisEnvironment.getDerivedArtifact() as I possibly can and audit the rest. -- MOS_MIGRATED_REVID=99351151
* Make local TestStrategy bits rely less on runfiles manifestsGravatar Michajlo Matijkiw2015-05-15
| | | | | | | | | | | TestStrategy#getLocalRunfilesDirectory(...) was using manifest names to infer if the runfiles symlinks were created by comparing the name of manifests. This is a bit confusing and adds unnecessary reliance on manifests which we'd like to reduce. Instead get whether or not we created the symlinks from the boolean that determines it. -- MOS_MIGRATED_REVID=93414150
* RELNOTES[NEW]: The "args" attribute of *_binary and *_test rules now support ↵Gravatar Damien Martin-Guillerez2015-03-06
| | | | | | | | | expanding $(location //some/deps) *_binary and *_test rules were supporting make variables substitution but not location expansion like genrule() does. Now the $(location //some/label) where //some/label is the label of a dependency of the rule will be replaced at runtime by the actual location of that dependency. In the same manner $(locations //some/label) will be replaced by the space separated list of files of the //some/label dependency. A longer usage explanation is provided in the build encyclopedia. -- MOS_MIGRATED_REVID=87927345