aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/repository
Commit message (Collapse)AuthorAge
* Support optional repository verificationGravatar Klaus Aehlig2018-07-25
| | | | | | | | | | | | | | | | Add an option to provide a file with a resolved value, that will be used to verify that the repositories mentioned in this file produce a correct directory tree. RELNOTES: newly added options --experimental_repository_hash_file and --experimental_verify_repository_rules allow to verify for repositories the directory generated against pre-recorded hashes. See documentation for those options. Work towards #5660. Change-Id: I2d8becb188d0fa51e890fb8f6139f321cca14b7b PiperOrigin-RevId: 206016792
* Automated refactor of Label.parseAbsolute() to always pass a repository mappingGravatar dannark2018-06-27
| | | | | RELNOTES: None PiperOrigin-RevId: 202360925
* RepositoryFunction: depend on overrides, even if there is no ruleGravatar Klaus Aehlig2018-06-18
| | | | | | | | | | Not all bazel external repositories are generated by a rule (e.g., they might be unbound names with the expectation that on override binds them). Still, even those external repositories depend on changes to the repository override. Register this dependency. Change-Id: I900c94f969d08dec82c5776eff28337878379b5e PiperOrigin-RevId: 200974283
* Support unconditional fetching of repositoriesGravatar Klaus Aehlig2018-06-14
| | | | | | | | | | | Make all external repositories depend on an additional SkyValue controllable via commands, so support unconditional fetching of all external repositories, as it is needed by the the `sync` command. Improves on #5175, provides a work around for #4907. Change-Id: I30033614c1a2fad3f1363b85ff69cf92f697c255 PiperOrigin-RevId: 200543985
* Refactoring: makes the code simpler by deleting Metadata and InputArtifactData.Gravatar shahan2018-06-06
| | | | | | (minor) ActionFS now implements MetadataProvider.getInput PiperOrigin-RevId: 199575194
* Clean up code that directly imports nested classes like Builder, Entry, etc.Gravatar jcater2018-05-02
| | | | PiperOrigin-RevId: 195100670
* Remove warning about non-canonical workspace namesGravatar Klaus Aehlig2018-04-09
| | | | | | | | | | | | While we still recommend to name repositories in canonical way, a canonical way can not always be ensured, e.g., if different versions of the same external repository have to be used. Our design for upcoming renaming repositories honors this observation. So remove the old warning about the name in an external repository's WORKSPACE file not matching the name given to it in the global WORKSPACE file; we certainly will not make this an error in the future. Change-Id: I5eef92ec61dc81d25734d71187a635024630322c PiperOrigin-RevId: 192114195
* Fix test flakiness due to the filesystem mutations done during the 'fetch' ↵Gravatar nharmata2018-03-23
| | | | | | | | | work done by BazelPackageBuilderHelperForTesting#sanityCheckBazelPackageLoader. We fix this flakiness by _not_ having RepositoryDelegatorFunction unconditionally 'fetch' local repos. We then have to make a change to BazelPackageLoader test to reinstate these mutations, since it was only working before due to the unconditional filesystem mutations done here :p RELNOTES: None PiperOrigin-RevId: 190222830
* Expose an actions provider on RuleConfiguredTarget instances.Gravatar cparsons2018-03-06
| | | | | | | | | Given a target (for example from a skylark aspect), one will be able to access a list of actions that the target generated using "target.actions". This is without additional memory footprint. Actions themselves are not fully exposed to skylark (and thus there isn't much meaning to gather from them in skylark yet). Access methods will follow soon. RELNOTES: None. PiperOrigin-RevId: 188098079
* Replace LegacySkyKey by AbstractSkyKey or custom SkyKeys. AbstractSkyKey ↵Gravatar janakr2018-03-02
| | | | | | | | doesn't save memory in the 32-bit case, but makes it easier for people to see how many SkyKeys we have. There's some unnecessary interning in tests, but it was easier to copypasta and doesn't harm anything, I think. PiperOrigin-RevId: 187694309
* Fix usages of PathFragment segments that will become inefficient.Gravatar tomlu2018-01-19
| | | | | | | An upcoming replacement to PathFragment will not have efficient segment semantics, causing code to become unnecessarily inefficient. RELNOTES: None PiperOrigin-RevId: 182553098
* Rename relativePath -> rootRelativePath in Root and friends.Gravatar tomlu2018-01-19
| | | | | | This makes it clearer that the path fragments in question are relative *to the root*. Confusingly, when the root is absolute, the root relative fragment is also absolute. This makes it a tiny bit clearer that the path fragment may be absolute. PiperOrigin-RevId: 182544893
* User can never explicitly set generator_* attributes. So it should beGravatar Googler2018-01-18
| | | | | | | nonconfigurable. RELNOTES: generator_* attributes are nonconfigurable. PiperOrigin-RevId: 182443578
* Add absolute root concept.Gravatar tomlu2018-01-18
| | | | | | | | An absolute root accepts any absolute path fragments and simply returns it. This concept replaces the FileSystem root directory concept. PiperOrigin-RevId: 182400471
* 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
* Update documentation on local_repository.path.Gravatar jcater2018-01-05
| | | | | | Fixes #4391. PiperOrigin-RevId: 180963440
* Move BazelRuleClassProvider.CORE_WORKSPACE_RULES to its own class in the ↵Gravatar lpino2017-12-06
| | | | | | rules/repository package. PiperOrigin-RevId: 178087895
* Update PathPackageLocator to take a list of potential build file names,Gravatar John Cater2017-11-28
| | | | | | | | | | | | | | instead of assuming BUILD. - Default the list to the same value as PackageLookupFunction: BUILD.bazel, BUILD. - Move BuildFileNames to the packages package, so it is more generally available. Part of #4056. Change-Id: Ie12512b492cd7d47a9e56ec3bc209f829feaf4b5 PiperOrigin-RevId: 177261295
* Refactor the representation of a collection of package specificationsGravatar cushon2017-11-15
| | | | PiperOrigin-RevId: 175832159
* Rename Label.EXTERNAL_PACKAGE_FILE_NAME to WORKSPACE_FILE_NAMEGravatar ulfjack2017-10-27
| | | | | | | This more clearly indicates what this is. Also change some hard-coded uses to use the constant instead. PiperOrigin-RevId: 173658659
* 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
* Inject BlazeDirectories into RepositoryDelegatorFunction directly, instead ↵Gravatar janakr2017-09-25
| | | | | | | | of depending on a precomputed value. BlazeDirectories don't change over the lifetime of the Blaze server, and certainly not over the lifetime of a SkyframeExecutor instance, which already had a reference to them. Step 2. PiperOrigin-RevId: 169711443
* Move RuleConfiguredTarget to lib.analysis.configuredtargets.Gravatar gregce2017-09-19
| | | | | | This is a trivial change with a large file footprint. PiperOrigin-RevId: 169169864
* Returns repository does not exists when referring to a bind rule...Gravatar Damien Martin-Guillerez2017-09-07
| | | | | | | | | | | | | ...or any other non repository rule. Using a bind rule as the name of the repository was returning a strange error "could not find handler for bind rule" which was not useful, so was replaced by a crash. Fixes #3664 Change-Id: Id0711470e6a1ab9267e05eb273900b18d0a27d6b PiperOrigin-RevId: 167706825
* Add closing paren to documentation on workspace rules.Gravatar Eric Dobson2017-09-05
| | | | | | | | | Also moves parenthetical remark to a completely different sentence, as it seemed off where it was. Closes #3657. PiperOrigin-RevId: 167558504
* Throws an ISE when a handler is not definedGravatar dmarting2017-09-04
| | | | | | | | | The only case this exception is thrown is when there is a bug in Bazel and we should surface the whole stacktrace. See #3664 PiperOrigin-RevId: 167492638
* Add a warning to the bind() docsGravatar Rodrigo Queiro2017-08-25
| | | | | | | | | | | | This will encourage new users to avoid it, and would have helped me. At the start, I cargo-culted other projects that use bind() heavily without knowing why. Related: #1952 Closes #3608. PiperOrigin-RevId: 166464352
* Store content digests in repository marker files. ↵Gravatar Benjamin Peterson2017-08-24
| | | | | | | https://www.bazel.build/designs/2016/10/18/repository-invalidation.html Change-Id: I6cb01397a35cd32169a0e415f8d7f944e7d840df PiperOrigin-RevId: 166200841
* Move RuleConfiguredTargetFactory to lib.analysisGravatar ulfjack2017-08-07
| | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. PiperOrigin-RevId: 164446955
* Move AliasProvider to lib.analysisGravatar ulfjack2017-08-07
| | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. PiperOrigin-RevId: 164438390
* Use the rule location when a handler isn't foundGravatar kchodorow2017-08-03
| | | | | | | | | | | | I think this code predates being able to load Skylark .bzl files from the WORKSPACE. As most non-trivial projects are using load() in the WORKSPACE, it's fairly uninformative to say "it was defined in the WORKSPACE file" for this error. This is to help debug the Tensorflow issue (#3478) but should generally be more useful than the current message. PiperOrigin-RevId: 164118176
* Update marker version number to 3Gravatar pcloudy2017-07-11
| | | | | | | Fixed https://github.com/bazelbuild/bazel/issues/3344#issuecomment-314167833 RELNOTES: None PiperOrigin-RevId: 161500109
* Clean up string representations for configured targetsGravatar vladmos2017-07-07
| | | | | | | | | If --incompatible_descriptive_string_representations is passed, configured targets are converted to strings using `str`, `repr` and `print` functions differently (more descriptive, without leaking information that shouldn't be accessible). PiperOrigin-RevId: 161212989
* 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 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
* 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
* Automated g4 rollback of commit d5ee3b5397135eebd4b5d5b6bd4a4444093c4df8.Gravatar kchodorow2017-04-26
| | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** The go rules have tons of transitive dependencies that are not declared in their "local" WORKSPACE files, so this broke lots of projects on ci.bazel.build I'll fix up the go rules, update all of _their_ reverse-dep projects, and resubmit. *** Original change description *** Repositories can only be accessed in projects that define them in their WORKSPACE file This is prep for #1943 - hierarchical workspace loading. RELNOTES[INC]: Remote repositories must define any remote repositories they themselves use (e.g., if @x//:foo depends on @y//:bar, @y must be defined in @x's WORKSPACE file). PiperOrigin-RevId: 154321845
* Repositories can only be accessed in projects that define them in their ↵Gravatar kchodorow2017-04-26
| | | | | | | | | | | | WORKSPACE file This is prep for #1943 - hierarchical workspace loading. RELNOTES[INC]: Remote repositories must define any remote repositories they themselves use (e.g., if @x//:foo depends on @y//:bar, @y must be defined in @x's WORKSPACE file). PiperOrigin-RevId: 154295762
* Add check to LocalRepositoryFunction that the path contains a WORKSPACEGravatar John Cater2017-04-25
| | | | | | | | | | | file. Fixes #2841. RELNOTES: Every local_repository now requires a WORKSPACE file. Change-Id: I11d50b852796b8f919b1a61c8c9b59cb78c5b724 PiperOrigin-RevId: 154179215
* Rewrite repository lookup to return a failed value rather than throwGravatar ulfjack2017-04-20
| | | | | | | | | | | | | | | | | | | | | | | We need to lookup repositories as part of converting exec paths to artifacts, which in turn is needed for action cache lookups. These lookups should not cause a Skyframe exit, so we must not throw an exception here, unless the error makes it impossible to continue. Instead, we need to leave the decision whether to error out or not to the caller. Note that we may unnecessarily fetch a remote repository in order to do the action cache lookup, even if the action no longer depends on the input file, although this should only be possible for C++ compile actions. It's possible that there's another bug in the C++ compile action key computation that also contributes. This change also makes it so that the post-resolution action cache code ignores any errors wrt. repository lookup rather than throwing. If any of the paths could not be found, then the action cache lookup fails and we re-execute the corresponding action, which is exactly what should happen. Fixes #2759. PiperOrigin-RevId: 153696243
* Add repository override optionGravatar kchodorow2017-04-20
| | | | | | | | | | | RELNOTES: Adds a --override_repository option that takes a repository name and path. This forces Bazel to use the directory at that path for the repository. Example usage: `--override_repository=foo=/home/user/gitroot/foo`. Fixes #1266 PiperOrigin-RevId: 153599291
* 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
* Add workspace_file and workspace_file_content attributes to ↵Gravatar jcater2017-03-31
| | | | | | | | new_foo_repository rules. Change-Id: Iadcc24bb2a207126cec9aa31faba6d76ee80da41 PiperOrigin-RevId: 151739968
* Remove special handling of name attribute. Fixes #278Gravatar Googler2017-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | The name attribute gets special treatment in the codebase, in that it's not simply yet another attribute but stored in it's own field. Thus, every callside dealing with attributes needs to be aware of this special case and explicitly handle the name attribute. It's easy to see that this can lead to bugs. For example, querying for the name attribute is currently broken due the querying code not being aware of the special case [1]. Discussions with experienced bazel developers came to the conclusion that there is no need (anymore) to treat the name attribute specially and thus we decided it's best to remove the special treatment and handle the name attribute as any other attribute. This change removes the handling of name attributes and also adds a test case to verify that bug [1] is fixed. [1] https://github.com/bazelbuild/bazel/issues/278 -- PiperOrigin-RevId: 147446345 MOS_MIGRATED_REVID=147446345
* Add environ attribute to repository_rule Gravatar Damien Martin-Guillerez2017-02-14
| | | | | | | | | | | | | | | | | | | This environ attribute let the repository rule implementor describes on which environment variable change a repository should be refetched. RELNOTES[NEW]: environ parameter to the repository_rule function let defines a list of environment variables for which a change of value will trigger a repository refetching. Design doc: https://bazel.build/designs/2016/10/18/repository-invalidation.html [step 3 & 4] Fixes #1595. -- Change-Id: Ibc2f93e69cb08baf86107cc9a9428b7a0eba1bac Reviewed-on: https://cr.bazel.build/8139 PiperOrigin-RevId: 147345203 MOS_MIGRATED_REVID=147345203