| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
| |
Treat repository rules the same way as build rules: they may only be used,
if exported by a Skylark file. It has never been intended to create external
repositories by anonymous rules, and, in fact, for properly recording resolved
information, it is necessary that all repository rules used can be referred
to by an accessible name.
Change-Id: Ib9259d58be66b033721a6f591656c45889f49931
PiperOrigin-RevId: 204872735
|
|
|
|
|
|
|
| |
This is cleaner and will help when we eventually add tests for flags controlling the global environment.
RELNOTES: None
PiperOrigin-RevId: 173388860
|
|
|
|
|
| |
RELNOTES: Skylark semantics flags now affect WORKSPACE files and repository rules.
PiperOrigin-RevId: 173130286
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Relanding
https://github.com/bazelbuild/bazel/commit/17214ac78ffaec369d5d5bafe62a39730473cfaa
with fixes to 'repository_ctx.download()' and
'repository_ctx.download_and_extract()'.
I reviewed other usages of @ParamType annotation - I do not think there
are more issues.
Fixes #3714.
Change-Id: I17087ef3fc2d28ab99224740a2164675a49847d3
PiperOrigin-RevId: 169896223
|
|
|
|
|
| |
RELNOTES: The `print` function now prints debug messages instead of warnings.
PiperOrigin-RevId: 164880003
|
|
|
|
|
|
|
|
|
| |
By replacing uses of /bin/bash by /bin/sh, a tool which is more
reliably at this location. Then, enable most of the bazel tests
for FreeBSD as well.
Change-Id: Ic56a1705858f1ed67d1e96e2937e9389dd1d0e36
PiperOrigin-RevId: 164241635
|
|
|
|
|
|
|
|
| |
RELNOTES: Repository context's execute() function can print stdout/stderr while running. To enable, pass quiet=False.
--
PiperOrigin-RevId: 150206218
MOS_MIGRATED_REVID=150206218
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Broke tests on CI: http://ci.bazel.io/job/bazel-tests/570/
*** Original change description ***
Roll forward execroot change
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. Cust...
--
PiperOrigin-RevId: 147833177
MOS_MIGRATED_REVID=147833177
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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. Custom crosstools that hardcode external/<repo> paths will have to
be updated.
Issue #1262.
--
PiperOrigin-RevId: 147726370
MOS_MIGRATED_REVID=147726370
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So that change to those files are seen and cause a refetch.
Design doc: https://bazel.build/designs/2016/10/18/repository-invalidation.html [step 5]
Fixes #1022.
--
Change-Id: Ic75f2c9c59a4c91ff3e937ca21b37e74332c03ec
Reviewed-on: https://cr.bazel.build/8218
PiperOrigin-RevId: 147574856
MOS_MIGRATED_REVID=147574856
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bzl files
The marker file contains the hash of the Skylark extension from
the ruleKey, see RuleFormatter.java#L44.
Design doc: https://bazel.build/designs/2016/10/18/repository-invalidation.html [step 6]
Issue #1022.
--
Change-Id: I6da5e1f8797fa5ee20401ede29c67ccf1a8cef5a
Reviewed-on: https://cr.bazel.build/8150
PiperOrigin-RevId: 147470732
MOS_MIGRATED_REVID=147470732
|
|
|
|
|
|
|
|
|
|
|
| |
This is another instance of #1793 that happens when a WORKSPACE file
exists in some path underneath your current workspace.
--
Change-Id: Idb01cd643548a170a27c9103f1b5081b058cc005
Reviewed-on: https://cr.bazel.build/8143
PiperOrigin-RevId: 147353935
MOS_MIGRATED_REVID=147353935
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
Also test_build_repo set-up that starts failing with sharding
--
Change-Id: I9b950f1569737c52f9a4608eaad68db01f30ac82
Reviewed-on: https://cr.bazel.build/8144
PiperOrigin-RevId: 144631720
MOS_MIGRATED_REVID=144631720
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The environment is now computed with a mixture of the client environment and
the values specified by the --action_env flag. If a user want to overwrite its
environment for skylark repository, they can do `--action_env FOO=BAR` and
the repository will see FOO as having the value BAR, whichever value is
set in the client environment.
Also propagate it to all repository functions, and deduplicate the way
the client environment is passed to repository functions.
Design doc: https://bazel.build/designs/2016/10/18/repository-invalidation.html [step 1]
RELNOTES[INC]: repository_ctx environment is now affected by --action_env flag (value from the
client environment will be replaced by value given on the command line through --action_env).
--
Change-Id: I131a9695439aa9949d5001f820e2ae450e41332f
Reviewed-on: https://cr.bazel.build/7971
PiperOrigin-RevId: 144091492
MOS_MIGRATED_REVID=144091492
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This test was still using the old path syntax that is deprecated,
use the label syntax instead.
Note that there is still several instance of that old syntax
in our tests:
```
grep -E -r 'load\(['"'"'"]/[^/]' src/test | wc -l
109
```
--
Change-Id: Id2d1a9a525f1584136501026de01cf53e2263c3f
Reviewed-on: https://cr.bazel.build/8135
PiperOrigin-RevId: 143967775
MOS_MIGRATED_REVID=143967775
|
|
|
|
|
|
|
|
| |
This makes the skylark repository rules a little more flexible.
--
PiperOrigin-RevId: 142663731
MOS_MIGRATED_REVID=142663731
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently a call to "bazel" in an integration test means calling a (quite
hidden) function in test-setup.sh which actually calls "$bazel" defined
in "shell/bazel/testenv.sh" which is equal to "$(rlocation io_bazel/src/bazel)".
This is extremely confusing and error prone.
The new mechanism is to add a wrapper script to shell/bin called bazel
and export this directory to the PATH.
Moreover, not every test loads the same test environment, for instance consider
how bazel_query_test loads the test environment:
- Load shell/integration/testenv.sh which loads,
- shell/bazel/test-setup.sh which loads,
- shell/bazel/testenv.sh which loads,
- shell/unittest.bash which loads,
- shell/testenv.sh
Again this is error prone and specially hard to understand, in fact
each test writer needs to decide which of these testenv to load.
This change fixes all of this by having only one testenv.sh
and summarizing the test setup in integration_test_setup.sh.
Namely, for any new integration test, the developer
needs to load integration_test_setup to get the environment set up including
the unittest framework (also it helps to attract contributions).
This change also allows to open sourcing client_sigint_test: Since bazel was a
function client_sigint_test was using a wrong process id to interrupt
the build. The problem is that $! returns
bash's id instead of the id of the process running in the background
when using a function instead of an executable.
A few tests needed to be adapted to the new infrastructure.
--
MOS_MIGRATED_REVID=136470360
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Breaks TensorFlow and other Bazel jobs on ci.bazel.io
*** Original change description ***
Change execution root for external repositories to be ../repo
Some of the important aspect of this change:
* Remote repos in the execution root are under output_base/execroot/repo_name, so the prefix is ../repo_name (to escape the local workspace name).
* Package roots for external repos were previously "output_base/", they are now output_base/external/repo_name (which means source artifacts always have a relative path from their repository).
* Outputs are under bazel-bin/external/repo_name/ (or similarly under genfiles). Note that this is a bit of a change from how this was implemented in the previous cl.
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.
Roll forward of bdfd58a.
--
MOS_MIGRATED_REVID=133709658
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some of the important aspect of this change:
* Remote repos in the execution root are under output_base/execroot/repo_name, so the prefix is ../repo_name (to escape the local workspace name).
* Package roots for external repos were previously "output_base/", they are now output_base/external/repo_name (which means source artifacts always have a relative path from their repository).
* Outputs are under bazel-bin/external/repo_name/ (or similarly under genfiles). Note that this is a bit of a change from how this was implemented in the previous cl.
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.
Roll forward of bdfd58a.
--
MOS_MIGRATED_REVID=133606309
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RELNOTES[INC]: repository_ctx.{download,download_and_extract,execute} API now use
named parameters for optional parameters and no longer uses argument
type to distinguished between arguments (executable attribute name
must be specified when preceding optional arguments are missing).
Fixes #1426.
--
Change-Id: I41d174cd9fd5c47edf4e2e9a86ce7f6c7882a104
Reviewed-on: https://bazel-review.googlesource.com/#/c/5673
MOS_MIGRATED_REVID=132421955
|
|
|
|
|
|
|
| |
repository_ctx.execute, so that it allows overriding current environment variables
--
MOS_MIGRATED_REVID=126089693
|
|
|
|
|
|
|
| |
Fixes #1314.
--
MOS_MIGRATED_REVID=125340361
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=125160288
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Fixes #1172.
--
MOS_MIGRATED_REVID=124122716
|
|
|
|
|
|
|
|
|
|
| |
to override the environment variables.
Fixes #1130
Fixes #1242
--
MOS_MIGRATED_REVID=124118789
|
|
|
|
|
|
|
|
|
|
|
| |
commit 3fedf9e618cbce3dbdd00559b2de0bb8e2d43171 introduced the distinction between the loading phase and the workspace phase.
This check broke the use of native.existing_rule(s) in skylark remote repository, added a regression test for it.
Fixes #1277
--
MOS_MIGRATED_REVID=122988569
|
|
|
|
|
|
|
|
|
| |
This prevents an ugly error when the main repository name is set.
Fixes #1166.
--
MOS_MIGRATED_REVID=120352395
|
|
|
|
|
|
|
|
|
|
|
| |
repository.download function now creates the necessary directories before
downloading.
Fixes #1069
Fixes #1078
--
MOS_MIGRATED_REVID=118026986
|
|
|
|
|
|
|
|
|
| |
Use -p when mkdir, create the server directory in the
temporary directory and ensure we delete the server directory
on the tear_down.
--
MOS_MIGRATED_REVID=117728350
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For example, if you have a BUILD file that does:
load('@foo//bar:baz.bzl', 'my_rule')
my_rule(...)
If baz.bzl uses Label('//whatever'), this change makes //whatever resolve to
@foo//whatever. Previous to this change, it would be resolved to the repository
the BUILD file using my_rule was in.
RELNOTES[INC]: Labels in .bzl files in remote repositories will be resolved
relative to their repository (instead of the repository the Skylark rule is
used in).
--
MOS_MIGRATED_REVID=117720181
|
|
|
|
|
|
|
|
|
| |
Fixes #1041
RELNOTES: Add repository_ctx.download and repository_ctx.download_and_extract function.
--
MOS_MIGRATED_REVID=117698142
|
|
|
|
|
|
|
|
|
| |
Cycle when looking for a repository name will now shows a user-understable error.
Fixes #877.
--
MOS_MIGRATED_REVID=117453646
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
One can now invoke native.bazel_version to get the version of Bazel from
the WORKSPACE file.
This can be used to do version check, for instance:
version.bzl:
def check_version(x):
if native.bazel_version < x:
fail("Current Bazel version is {}, expected at least {}".format(native.bazel_version, x))
WORKSPACE:
load("//:version.bzl", "check_bersion")
check_version("0.2")
Fixes #1014.
--
MOS_MIGRATED_REVID=117231557
|
|
|
|
|
|
|
|
| |
This will avoid confusion with the normal Skylark rule context.
Also fixed indentation of cc_configure.bzl
--
MOS_MIGRATED_REVID=117011107
|
|
|
|
|
|
|
|
|
| |
The shell.Command class throw an exception when exit code is non
null, resulting in unwanted case where calling a failing command
as just echoing "Exited with status 4".
--
MOS_MIGRATED_REVID=116361594
|
|
|
|
|
|
|
|
| |
This unify the way which() and os.environ() get their environment
and won't lead to weird issue.
--
MOS_MIGRATED_REVID=115829154
|
|
|
|
|
|
|
|
|
|
| |
We sometime want to execute the created file. The executable argument
permit to control the executable bit on the created file.
Issue #893
--
MOS_MIGRATED_REVID=115653127
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A Skylark remote repository should be invalidated only when
the WORKSPACE file change, or one of its dependency or the Skylark
file change.
This change include two fixes:
- The path of the RepositoryDirectoryValue was incorrect when
the directory root is a symlink and the repository is not local
(and not refetching). This was never triggered before because
the only rule that were symlinking their root were the local
one.
- Directories were unitialized for the SkylarkRepositoryFunction
(was forgotten as part of a refactor when introducing it).
--
MOS_MIGRATED_REVID=115547540
|
|
|
|
|
|
|
|
|
|
|
| |
repository_ctx.os gives access to os related information:
- .system returns the name of the current platform.
- .environ returns the list of environment variables.
Issue #893: Step 4 of http://goo.gl/OZV3o0. See http://goo.gl/fD4ZsY.
--
MOS_MIGRATED_REVID=115337406
|
|
|
|
|
|
|
|
|
|
| |
This add a repository_ctx.execute() method for spawning action
from a skylark remote repository.
Issue #893: Step 4 of http://goo.gl/OZV3o0. See http://goo.gl/fD4ZsY.
--
MOS_MIGRATED_REVID=115335198
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a load statements was present in a remote repository's WORKSPACE file,
the parsing of the WORKSPACE file to get the workspace name will break
the build because it tries to load the Skylark extension from the main
repository.
This change replace the parsing of the whole remote repository's WORKSPACE file
by a parsing of only it first chunk (before the first load statement). This
change also enforce that the workpace() function to be called only from the
top of the WORKSPACE file.
--
MOS_MIGRATED_REVID=114528640
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue #824 Step 5.
The only thing left to resolve issue #824 are correct handling of
the following cases:
- Forbidding overloading of a repository outside of the first part
of the workspace file (or it will leads to incorrectness issue
and the only use-case is the redefinition of the bazel_tools
repository).
- Better error reporting when trying to refer to a non-existent
repository from the workspace file, for now it will print
a SkyFrame cycle exception.
--
MOS_MIGRATED_REVID=114316464
|
|
|
|
|
|
|
|
|
| |
to do such a load will result in a skyframe circular dependency exception.
As a side effect of this change, SkylarkImportFailedExceptions thrown by SkylarkImportLookupFunction are now caught by PackageFunction and wrapped and rethrown as a PackageFunctionException. Previously, the first exception wasn't caught, generating an uncaught exception error at top level.
--
MOS_MIGRATED_REVID=112328755
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Fixes #672
--
MOS_MIGRATED_REVID=109174420
|
|
RELNOTES[NEW]: Skylark macros are now enabled in WORKSPACE file.
Design document at https://docs.google.com/document/d/1jKbNXOVp2T1zJD_iRnVr8k5D0xZKgO8blMVDlXOksJg/preview
Fixes #337
--
MOS_MIGRATED_REVID=108860301
|