aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/ExternalFilesHelper.java
Commit message (Collapse)AuthorAge
* A couple quality-of-life improvements for Bazel devs, in response to an ↵Gravatar nharmata2018-02-23
| | | | | | | | | | email from philwo@. (i) Only have TimestampGranularityMonitor log the first file of relevance. This reduces log spam, especially in tests, while still maintaining useful information in the logs. (ii) Don't have ExternalFilesHelper log the fact that it encountered an external file when we're in a unit test or an integration test. Tests, especially bazel tests that use external repositories, tend to involve lots of "external" files. RELNOTES: None PiperOrigin-RevId: 186799176
* 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
* Rename all logger instances to "logger" (instead "LOG" or "log").Gravatar lberki2017-09-05
| | | | | RELNOTES: None. PiperOrigin-RevId: 167505493
* Some minor logging improvements related to diff awareness:Gravatar Nathan Harmata2017-02-15
| | | | | | | | | | | | (i) Log [the first 100] external [non external-repo] file paths when we encounter them in skyframe [when externalFileAction is not ASSUME_NON_EXISTENT_AND_IMMUTABLE_FOR_EXTERNAL_PATHS]. These caveats are to prevent log spam. (ii) Fix grammar when logging the results of handleDiffsWithMissingDiffInformation in the case when all package paths have known diff information and we're merely checking external/output/external-repo files. (iii) Log the purpose of each skyframe graph scan we do (see (ii)). -- PiperOrigin-RevId: 147508404 MOS_MIGRATED_REVID=147508404
* Rollback of commit b776d6c12e952eb358c1a036cc9d93d8944c4c77.Gravatar Nathan Harmata2016-10-18
| | | | | | | *** Reason for rollback *** -- MOS_MIGRATED_REVID=136448178
* Rollback of commit 0c7a42a09d85ddffd9b860bcb31e4c43a00632c1.Gravatar Nathan Harmata2016-10-17
| | | | | | | | | | | | | | | | | | *** Reason for rollback *** [] *** Original change description *** Slight refactor of ExternalFilesHelper: -Make FileType and ExternalFileAction public. -Have producers use ExternalFileAction, rather than a boolean, to specify the desired behavior. And a big change in semantics (doesn't affect Bazel): -Replace ExternalFileAction.ERROR_OUT with ExternalFileAction.ASSUME_NON_EXISTENT_AND_IMMUTABLE, which does what it sounds like. This new action, like the old ERROR_OUT, is _not_ used in Bazel. -- MOS_MIGRATED_REVID=136206810
* Slight refactor of ExternalFilesHelper:Gravatar Nathan Harmata2016-10-14
| | | | | | | | | | | -Make FileType and ExternalFileAction public. -Have producers use ExternalFileAction, rather than a boolean, to specify the desired behavior. And a big change in semantics (doesn't affect Bazel): -Replace ExternalFileAction.ERROR_OUT with ExternalFileAction.ASSUME_NON_EXISTENT_AND_IMMUTABLE, which does what it sounds like. This new action, like the old ERROR_OUT, is _not_ used in Bazel. -- MOS_MIGRATED_REVID=136063159
* 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
* 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
* Check for additions to the directory in new_local_repositoryGravatar Kristina Chodorow2016-04-22
| | | | | | | | | | Fixes #806. RELNOTES: External repository correctness fix: adding a new file/directory as a child of a new_local_repository is now noticed. -- MOS_MIGRATED_REVID=120557511
* Respect --noexperimental_check_output_files in FileSystemValueChecker. ↵Gravatar Nathan Harmata2016-03-25
| | | | | | | | | FileStateValues for output files can make their way into the Skyframe graph if a source file is symlink to an output file. Also fix a bug where ExternalFilesHelper#isExternalFileSeen would always return true after returning true once in the past. This meant if an external file ever made its way into the Skyframe graph, we would always do a full graph scan at the beginning of each build (iow, we would always waste some CPU time doing nothing interesting). -- MOS_MIGRATED_REVID=118190190
* Fixes NullPointerException in pkgcaches_test on ci.bazel.ioGravatar Damien Martin-Guillerez2016-02-16
| | | | | | | Fixes #879. -- MOS_MIGRATED_REVID=114728312
* Make ExternalFilesHelper depends on the repository rule and not on the ↵Gravatar Damien Martin-Guillerez2016-02-10
| | | | | | | | | parsed Workspace. Issue #824 Step 4. -- MOS_MIGRATED_REVID=114314036
* Open source LoadingPhaseRunnerTest and its Skyframe companion.Gravatar Ulf Adams2015-12-21
| | | | | | | | | | I had to make a small change to ExternalFilesHelper. The Bazel test setup creates a remote repository for the tools, so we always have external files, incl. during loading. However, some of the tests don't setup an output directory, but instead pass null, which would lead to a crash. -- MOS_MIGRATED_REVID=110669993
* Only depend on the WORKSPACE file for external files that are under the ↵Gravatar Lukacs Berki2015-12-16
| | | | | | | | | | | | | | | external/ directory, i.e. were created by Bazel. This avoids a cycle that arose when a file is load()ed from the WORKSPACE file that is reached through a symlink to an external directory: * The WORKSPACE file depends on the package lookup node of the .bzl file * The package lookup node (transitively) depends on wherever the symlink points * The target of the symlink is an external file and as such, it depends on the WORKSPACE file This will probably be, erm, interesting to solve when we get as far as to load stuff from external repositories in the WORKSPACE file, but we are just not there yet. -- MOS_MIGRATED_REVID=110344658
* Use Bazel Preconditions variant which avoids varargs array creationGravatar Mark Schaller2015-12-10
| | | | | | | Reduces garbage. -- MOS_MIGRATED_REVID=109914243
* Shuffle around all the constants related to the name of the //external ↵Gravatar Lukacs Berki2015-12-10
| | | | | | | | | package and the prefix of external packages in the execroot. This is in preparation for renaming that path segment from "external" to "bazel-external" so that we can provide a symlink to it from the source tree so that the source tree looks like the execroot. -- MOS_MIGRATED_REVID=109882753
* Follow-up on f9fdc8dfced8b2b14561720623126a91e04b22cb -- reinstate ↵Gravatar Janak Ramakrishnan2015-12-08
| | | | | | | short-circuit check when all package paths have good diff information and no external files have been seen. -- MOS_MIGRATED_REVID=109703164
* Don't treat external files as immutableGravatar Kristina Chodorow2015-12-08
| | | | | | | | | Fixes #352. RELNOTES: Files in external repositories are now treated as mutable, which will make the correctness guarantees of using external repositories stronger (existent), but may cause performance penalties. -- MOS_MIGRATED_REVID=109676408
* 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
* Do not store a separate map for external package data. This ensures that ↵Gravatar Han-Wen Nienhuys2015-09-21
| | | | | | | | | serialization works correctly. Removes ExternalPackage as Package specialization. -- MOS_MIGRATED_REVID=103395682
* Stop throwing an exception if a Package was successfully created but ↵Gravatar Janak Ramakrishnan2015-09-17
| | | | | | | | | | | contains errors. Instead, require callers to process the package and throw if they need to. This allows us to avoid embedding a Package in an exception, which is icky. This also allows us to remove Package#containsTemporaryErrors. Most callers' changes are fairly straightforward. The exception is EnvironmentBackedRecursivePackageProvider, which cannot throw an exception of its own in case of a package with errors (because it doesn't do that in keep_going mode), but whose request for a package with errors *should* shut down the build in case of nokeep_going mode. To do this in Skyframe, we have a new PackageErrorFunction which is to be called only in this situation, and will unconditionally throw. EnvironmentBackedRecursivePackageProvider can then catch this exception and continue on as usual, except that the exception will shut down the thread pool in a nokeep_going build. -- MOS_MIGRATED_REVID=103247761
* Make some skyframe and lib/skyframe classes public.Gravatar Nathan Harmata2015-07-28
| | | | | -- MOS_MIGRATED_REVID=99197069
* Invalidate external repository files when the WORKSPACE changesGravatar Kristina Chodorow2015-07-17
| | | | | | | Fixes #236. -- MOS_MIGRATED_REVID=98402890
* optionally error on files outside of known rootsGravatar Michajlo Matijkiw2015-04-01
| | | | | | | | | | | | The goal of this change is to provide a means for disallowing files outside of declared, known locations in order to better enforce the hermeticy and in turn reproducability of builds. Previously when encountering these files (typically via external symlinks) we would add a dependency on build_id, now we can optionally fail the build. -- MOS_MIGRATED_REVID=90015665
* Fix typo.Gravatar Nathan Harmata2015-03-20
| | | | | -- MOS_MIGRATED_REVID=88951407
* Update from Google.Gravatar Han-Wen Nienhuys2015-02-25
-- MOE_MIGRATED_REVID=85702957