aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/bazel/workspace_resolved_test.sh
Commit message (Collapse)AuthorAge
* bazel sync: add a test verifying following branchesGravatar Klaus Aehlig2018-08-13
| | | | | | | | | Add a test verifying that bazel sync can be used to follow a branch of an upstream git repository. As this is a standard use case for bazel sync, we better verify it works properly. Change-Id: Ia08686376e6c7a89e7f1c130129b46764e43918b PiperOrigin-RevId: 208464247
* 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
* resolved file: include the hash of the output treeGravatar Klaus Aehlig2018-07-23
| | | | | | | | | | | | | | When reporting about the repository rules that were called, also report a hash of the tree the rule generated. This allows, at least after the fact, to verify that a repository rule actually produced the correct code. Note that equality of the output hash is not a guarantee for reproducible builds, as certain properties of the output tree, in particular owner, are ignored. Still it is a good check to detect wrong use of a repository rule. Change-Id: Ic56509f8e0d0b4be9ce3335ade280f983fe77e6d PiperOrigin-RevId: 205631855
* Make skylark repository functions exportableGravatar Klaus Aehlig2018-07-06
| | | | | | | | | | In this way, their name is one they can actually be referred to by. This is necessary, as Skylark repository rules end up in the resolved file when freezing the versions of external dependencies---and the call to the repository function might be indirect. Change-Id: Ie1b5a28fac4f690c424de848b42d0c4a217d494d PiperOrigin-RevId: 203466286
* bazel sync: better report errorsGravatar Klaus Aehlig2018-07-05
| | | | | | | | | | So far, bazel sync would only report error that happened during the actual fetch operation. However, errors can also happen earlier, e.g., when loading or parsing the WORKSPACE file. Report these errors as well. Change-Id: Ifa4961b0101f338d7618c52eb607951acba7ccdf PiperOrigin-RevId: 203359188
* git_repository: support branch as wellGravatar Klaus Aehlig2018-07-03
| | | | | | | | | Now that git_repository returns the commit actually checked out (and we have means of recording it), support following an active branch of a git repository. Change-Id: I6e152c59b694bbf562b345ee88282a8c9bd58e4c PiperOrigin-RevId: 203110735
* sync: also report errorsGravatar Klaus Aehlig2018-06-15
| | | | | | | | If a failure occurs during the syncing of the external repositories, not only set the exit code, but also report the error message. Change-Id: I3a0e19039ab4444e811c8cff4e6f9b33331a0e02 PiperOrigin-RevId: 200709468
* git_repository: return actual commitGravatar Klaus Aehlig2018-06-15
| | | | | | | | | | | | | | Using that repository rules now may return a non-None value, make git_repository return the arguments that make the rule reproducible; in particular, return the actual commit (instead of a tag) and the date of the commit, so support shallow clones. The added test also demonstrates how the `bazel sync` command together with `--experimental_repository_resolved_file` can be used to replay an earlier state of external dependencies. Change-Id: Ifa1cfdfdb5eb299a15b9d0ec7d285dc84c0bcdc0 PiperOrigin-RevId: 200705705
* 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
* Add a `sync` commandGravatar Klaus Aehlig2018-06-08
| | | | | | | | | | | | | Add a command that ensures that all skylark workspace rules get called. In follow-up changes the semantics of the sync command will be extended to call all those rules unconditionally. This, together with recoding of the return values of the repository rules, as currently provided by --experimental_repository_resolved_file provides the framework for resolving underspecified rules, e.g., rules following head of an external repository. Change-Id: I11061ec138a9ba7a7b61a431eeb1b8667dfabb95 PiperOrigin-RevId: 199792026
* RepositoryResolvedEvent: only record the explicitly set original attributesGravatar Klaus Aehlig2018-05-23
| | | | | | | | | | Prune down the list of attributes to the explicitly set ones when reporting the original attributes. The attribute list also contains attributes implicitly added from default values, but the original attributes are intended to record the original way the rule was invoked from the WORKSPACE file. Change-Id: I918656159850a52e9afc9f045701b0ea065f4125 PiperOrigin-RevId: 197702283
* Add a module collecting the results of repository rulesGravatar Klaus Aehlig2018-05-04
We allow repository rules to return a reproducible version of themselves, or a list of fully reproducible rules they expand to. Add a module collecting all those answers, logging them at each invocation, if requested; this collection can also be used by the upcoming 'sync' command to generate a WORKSPACE.resolved file. Change-Id: Iac1358de1b74633810d300ba2bf45bba8b3992dc PiperOrigin-RevId: 195427096