aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/repository/NewLocalRepositoryFunction.java
Commit message (Collapse)AuthorAge
* Introduce Root class.Gravatar tomlu2018-01-17
| | | | | | | | | | | This class represents a root (such as a package path or an output root) used for file lookups and artifacts. It is meant to be as opaque as possible in order to hide the user's environment from sky keys and sky functions. Roots are used by RootedPaths and ArtifactRoots. This CL attempts to make the minimum number of modifications necessary to change RootedPath and ArtifactRoot to use these fields. Deprecated methods and invasive accessors are permitted to minimise the risk of any observable changes. RELNOTES: None PiperOrigin-RevId: 182271759
* Make FileSymlinkException and InconsistentFSException IOExceptionsGravatar ulfjack2018-01-12
| | | | | | | Most places handle them the same way as IOException, which seems like a safe default. The places that do care can still throw or catch the more specific type. PiperOrigin-RevId: 181719688
* Move verifyMarkerData into RepositoryFunctionGravatar Yun Peng2017-06-28
| | | | | | | | | | | | | And for new_XX_repository rules, add BUILD and WORKSPACE file into markerData. In markerData, key starting with FILE: can be an absolute label or an absoulte path, but the latter one will be depracated in future. Fixed https://github.com/bazelbuild/bazel/issues/3093 Change-Id: Ic3e16c123b3f1f781ab12c41d13f5e540b05686c PiperOrigin-RevId: 160382024
* Add workspace_file and workspace_file_content attributes to ↵Gravatar jcater2017-03-31
| | | | | | | | new_foo_repository rules. Change-Id: Iadcc24bb2a207126cec9aa31faba6d76ee80da41 PiperOrigin-RevId: 151739968
* Inject the digest of the marker file in the RepositoryDirectoryValue Gravatar Damien Martin-Guillerez2017-01-19
| | | | | | | | | | | This digest make sure that we produce a different RepositoryDirectoryValue for different marker data, thus invalidating the node. -- Change-Id: Ibc6286c76de7a8d07ece2bb8125bfb75095f7784 Reviewed-on: https://cr.bazel.build/8136 PiperOrigin-RevId: 144948233 MOS_MIGRATED_REVID=144948233
* Remote repositories: add the infrastructure for extending the marker file Gravatar Damien Martin-Guillerez2017-01-17
| | | | | | | | | | | | | | | This add a markerData map to the RepositoryFunction#fetch function so RepositoryFunction-s can declare extraneous data to add to the marker file. The RepositoryFunction#verifyMarkerData is called to verify those data in order to know if the repository is up to date and need re-fetching. Design doc: https://bazel.build/designs/2016/10/18/repository-invalidation.html [step 2] -- Change-Id: I9083fb72a0142f418a7296f889cd3eaf32e92498 Reviewed-on: https://cr.bazel.build/7973 PiperOrigin-RevId: 144728497 MOS_MIGRATED_REVID=144728497
* Adds a check that the new local repository path exists and is aGravatar John Cater2016-10-25
| | | | | | | | | | | directory. Fixes #1981. -- Change-Id: I16a96be3f4f9de66e608b1914a2554613ddc096a Reviewed-on: https://bazel-review.googlesource.com/c/6910/ MOS_MIGRATED_REVID=137192543
* 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
* Set workspace name for http_file, http_jar, and maven_jarGravatar Kristina Chodorow2016-05-03
| | | | | | | | | | | | | | | | Fixes #1166. While I was here, I also: * Renamed the implementations of Decompressor to show that they are Decompressors, not SkyFunctions (they used to be, it's confusing to have them still have the -Function suffix). * Added a unit test and moved the testing target to the rule/repository subdirectory, since it was a good chance to break off a tiny chunk of the monolithic BUILD file in lib/. -- MOS_MIGRATED_REVID=121306165
* 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
* Overwrite the WORKSPACE file for new_local_repositoryGravatar Kristina Chodorow2016-04-20
| | | | | | | | | | | | | This prevents an ugly warning when you do something like: new_local_repository( name = "bazel_tools", path = ".", build_file = "BUILD", ) -- MOS_MIGRATED_REVID=120271366
* Remove the directories field from RepositoryFunction.Gravatar Ulf Adams2016-03-31
| | | | | | | | This is problematic for coming up with a less stateful BlazeModule API, which - in turn - is a requirement for running multiple commands in the same server. -- MOS_MIGRATED_REVID=118696892
* Introduce SkylarkRepositoryModuleGravatar Damien Martin-Guillerez2016-02-17
| | | | | | | | | | | | | | | | | The SkylarkRepositoryModule declare the `repository_rule` function to Skylark to define new remote repository types (http://goo.gl/OZV3o0). The work is delagated to the `SkylarkRepositoryFunction` by the `RepositoryDelegatorFunction`. `SkylarkRepositoryContext` defines the `ctx` object passed to the `repository_rule` implementation function. This change also introduce a `SkylarkPath` and the necessary methods in `SkylarkRepositoryContext` to showcase the creation of a `local_repository` like repository. Issue #893: step 3 of the roadmap http://goo.gl/OZV3o0. -- MOS_MIGRATED_REVID=114895003
* Adds a build_file_content attribute to new_git_repository, new_http_archive, andGravatar Alex Humesky2016-02-12
| | | | | | | | | | | | | new_local_repository which allows the build file to be specified by a string directly in the rule rather than using a separate file. build_file and build_file_content are both optional, but one or the other must be specified. RELNOTES: build_file_content attribute added to new_git_repository, new_http_archive, and new_local_repository. -- MOS_MIGRATED_REVID=114490435
* Make local_repository and new_local_repository work with the limitations of ↵Gravatar Lukacs Berki2016-01-26
| | | | | | | our plans for symlink support on Windows. -- MOS_MIGRATED_REVID=113043269
* Allow relative paths for local_repository()sGravatar Kristina Chodorow2016-01-07
| | | | | | | | | | Fixes #733. RELNOTES: Relative paths can now be used for 'path' with new_local_repository and local_repository. -- MOS_MIGRATED_REVID=111620894
* Simplify the contract of RepositoryFunction to "I am given a Rule and a ↵Gravatar Lukacs Berki2015-12-14
| | | | | | | | | | | | | | | | | | | | | | | directory that I should populate". The directory itself is not created because local_repository actually puts a symlink in its place. As a side effect, make HTTP downloading, git cloning and archive decompressing not be SkyFunctions. This is necessary because it needs to be the RepositoryFunction and not a dependent SkyFunction that populates the output directory, because it that's the case what happens is: 1. RepositoryDelegatorFunction cleans up the directory and prepares it for RepositoryFunction 2. RepositoryFunction calls env.getValue(<function that populates the directory>) 3. That value hasn't been computed yet, thus RepositoryDelegatorFunction returns early 4. The function that populates the directory is called 5. RepositoryDelegatorFunction is restarted 6. RepositoryDelegatorFunction cleans up the directory 7. RepositoryFunction calls env.getValue(), and nothing is done because the value has already been computed 8. RepositoryDelegatorFunction proudly returns, even though the directory is actually empty Another way to solve this problem would be to make RepositoryFunction not clean the directory up on Skyframe restarts, but that means that we'd need to keep state somewhere, which doesn't strike me as a particularly great idea because let's keep state outside of Skyframe only when absolutely necessary (e.g. the marker files for cross-server instance persistence of downloaded repositories). That "somewhere" could either be a member variable of RepositoryDelegatorFunction or the file system. Note that this change causes external communication to be re-done in a few more cases than before (see that changes to the test cases), but I'd rather we be correct and simple than fast. We can optimize things later if needed and there is enough complexity going around, thank you very much. -- MOS_MIGRATED_REVID=110134397
* Refactor external repository support significantly to solve a number of issues.Gravatar Lukacs Berki2015-12-09
| | | | | | | | | | | | | | | In particular: - Separate the implementation of maven_server into a RepositoryFunction and one that creates the MavenServerValue (ideally, maven_server wouldn't exist but we'll have to make to for the time being) - Refactor the logic of determining whether an external repository needs to be re-fetched to RepositoryDelegatorFunction - Make RepositoryFunctions not be SkyFunctions anymore (they are called from RepositoryDelegatorFunction, though, who *is* a SkyFunction) - Add a Skyframe dirtiness checker that makes --nofetch RepositoryValues not be cached - Add a bunch of test cases and javadoc There is only one wart that I know of that remains: changes to BUILD files of new_* repository rules that weren't refetched when their RepositoryValue was initiall created on server restart won't take effect. This is because we don't add those BUILD files to the created RepositoryValue. This will fix itself once the ExternalFilesHelper refactoring is submitted. -- MOS_MIGRATED_REVID=109768345
* Make external repository implementations not re-fetch things on server restart.Gravatar Lukacs Berki2015-11-25
| | | | | | | | | This is accomplished by saving a proto of the repository rule in the output tree, then comparing it to that of the previous version. This makes HTTP_DOWNLOAD_CHECKER somewhat superfluous because it only matters if the external repository directory is modified manually. Local repository implementations are not included, mainly because the symlinking is cheap (maybe they should be for reasons of symmetry?) -- MOS_MIGRATED_REVID=108706396
* Simplify external repository support by removing FileValue from ↵Gravatar Lukacs Berki2015-11-25
| | | | | | | RepositoryValue and not depending it from repository functions. -- MOS_MIGRATED_REVID=108685867
* Move local_repository and new_local_repository from build.lib.bazel to ↵Gravatar Lukacs Berki2015-10-30
build.lib. -- MOS_MIGRATED_REVID=106689603