aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/bazel/repository/MavenServerFunction.java
Commit message (Collapse)AuthorAge
* Set the version of a computed node to the max of its child versions rather ↵Gravatar janakr2018-07-11
| | | | | | | | | | | | | | | | | than the graph version when that is feasible. * It's not feasible when the computation accesses outside state, i.e. is non-hermetic, so see below. * It's also more complicated (and not worth the trouble) when the computation is taking place just for the error status. Have SkyFunctionName declare whether the function it corresponds to is hermetic or non-hermetic. Only non-hermetically-generated SkyValues can be directly marked changed, and non-hermetic SkyFunctions have their values saved at the graph version, not the max of the child versions. All SkyFunctions are hermetic except for the ones that can be explicitly dirtied. A marked-hermetic SkyFunction that has a transient error due to filesystem access can be re-evaluated and get the correct version: if it throws an IOException at version 1 and then, when re-evaluated at version 2 with unchanged dependencies, has a value, the version will be version 1. All Skyframe unit tests that were doing non-hermetic things to nodes need to declare that those nodes are non-hermetic. I tried to make the minimal set of changes there, so that we had good incidental coverage of hermetic+non-hermetic nodes. Also did some drive-by clean-ups around that code. Artifacts are a weird case, since they're doing untracked filesystem access (for source directories). Using max(child versions) for them gives rise to the following correctness bug: 1. do a build at v1 that creates a FileStateValue for dir/ at v1. Then at v2, add a file to dir/ and do a build that consumes dir/ as a source artifact. Now the artifact for dir/ will (incorrectly) have v1. Then at v1, do that build again. We'll consume the "artifact from the future". However, this can only have an effect when using the local action cache, since the incorrect value of the artifact (the mtime) is only consumed by the action cache. Bazel is already broken in this way (incremental builds don't invalidate directories), so this change doesn't make things worse. PiperOrigin-RevId: 204210719
* Refactoring: makes the code simpler by deleting Metadata and InputArtifactData.Gravatar shahan2018-06-06
| | | | | | (minor) ActionFS now implements MetadataProvider.getInput PiperOrigin-RevId: 199575194
* 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
* Move ExternalPackageUtil to a new lib.repository package and simplify itGravatar ulfjack2017-09-26
| | | | | | | Move the nested Exception classes to top-level classes, remove unused functionality and move functionality only used in one place to that place. PiperOrigin-RevId: 170041246
* Remove PrecomputedValue for BlazeDirectories. All consumers have the value ↵Gravatar janakr2017-09-25
| | | | | | | | injected directly, which makes sense, because it's immutable over the lifetime of the server. Step 3. PiperOrigin-RevId: 169717587
* Add more methods to ExternalPackageUtil to load all rules of a specificGravatar John Cater2017-06-16
| | | | | | | rule class. Change-Id: Iaa830658a62de661f16e100d24b2d1a3e66af638 PiperOrigin-RevId: 159104714
* Move external package rule loading into a shared utility class.Gravatar John Cater2017-06-14
| | | | | Change-Id: I3f6664768791a63bf2f9e254b290d07623336ef6 PiperOrigin-RevId: 158902487
* 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
* Adding an option to set the digest function that everything uses. Minor ↵Gravatar Ola Rozenfeld2016-11-18
| | | | | | | | | | | | | refactoring: enabling potential fast digest computation of more than one digest function type. Usage: bazel --host_jvm_args="-Dbazel.DigestFunction=SHA1" build ... Ugliness: using a system property (a static non-final variable), because the better way to do it (a flag) would result in a much, much larger refactoring. More ugliness: I have updated the minimal amount of tests. A lot of tests are still relying on the default value of MD5. Ideally, they need to be updated as well. -- MOS_MIGRATED_REVID=139490836
* Don't print stack traces when repository rules have the wrong typeGravatar Kristina Chodorow2016-09-12
| | | | | | | | | This also entirely disallows select() in repository rules. All repository rules should now error out if the wrong type is given, instead of printing a stack trace. Fixes #1307. -- MOS_MIGRATED_REVID=132872804
* 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
* Remove directories field from MavenServerFunction.Gravatar Ulf Adams2016-04-18
| | | | | -- MOS_MIGRATED_REVID=120114796
* Inlined RepositoryFunction#getExternalPackageGravatar Damien Martin-Guillerez2016-01-18
| | | | | | | | | | This method was used only twice. Now there is only one entry point for requesting a rule in the external package (RepositoryFunction#getRule(String, Environment)). This is a step towards supporting loading skylark rules in the workspace file from remote repository. -- MOS_MIGRATED_REVID=112407797
* 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
* Fix fingerprinting of Maven settings file.Gravatar Lukacs Berki2015-11-26
| | | | | | | Check that the file exists before we try to get its digest and add a flag indicating its existence to the fingerprint. -- MOS_MIGRATED_REVID=108771918
* 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
* Move local_repository and new_local_repository from build.lib.bazel to ↵Gravatar Lukacs Berki2015-10-30
| | | | | | | build.lib. -- MOS_MIGRATED_REVID=106689603
* 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
* Add support for Maven username & password authenticationGravatar Kristina Chodorow2015-09-22
| | | | | | | | | | Progress on issue #264. RELNOTES: Maven servers that require username & password authentication are now supported (see maven_server documentation). -- MOS_MIGRATED_REVID=103583838
* 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
* Separate build-specific types and types inherent to Skylark.Gravatar Lukacs Berki2015-09-21
| | | | | -- MOS_MIGRATED_REVID=103374106
* Add a maven_server ruleGravatar Kristina Chodorow2015-09-16
This will also be used for authentication, but that has not been implemented yet. -- MOS_MIGRATED_REVID=103194964