bazel-contrib / bazel-contrib/rules_foreign_cc

tools from the `tools_deps` attribute in `configure_make` are not made available anymore in 0.10.0

Open
#1,115 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
737
Forks
270
PR merge metrics
No merged PRs in 30d

Description

On version `0.9.0`, tools present in the `tools_deps` attribute were made available to the configure script, but as of `0.10.0`, they are not anymore.

The issue has been pinned down to these two commits:
- [0ed27c13b18f412e00e9122fc01327503d52579c](https://github.com/bazelbuild/rules_foreign_cc/commit/0ed27c13b18f412e00e9122fc01327503d52579c)
- [2c6262f8f487cd3481db27e2c509d9e6d30bfe53](https://github.com/bazelbuild/rules_foreign_cc/commit/2c6262f8f487cd3481db27e2c509d9e6d30bfe53)

To reproduce:

```
# Check out a commit that surfaces the issue
git checkout 0ed27c13b18f412e00e9122fc01327503d52579c

# Modify an example to surface regression
patch -p1 < 'EOF'
diff --git a/examples/WORKSPACE.bazel b/examples/WORKSPACE.bazel
index 481353e..ea151ed 100644
--- a/examples/WORKSPACE.bazel
+++ b/examples/WORKSPACE.bazel
@@ -17,9 +17,9 @@ load("//deps:repositories.bzl", "repositories")

repositories()

-load("//deps:deps_android.bzl", "deps_android")
-
-deps_android()
+# load("//deps:deps_android.bzl", "deps_android")
+#
+# deps_android()

load("//deps:deps_jvm_external.bzl", "deps_jvm_external")

diff --git a/examples/configure_with_bazel_transitive/BUILD.bazel b/examples/configure_with_bazel_transitive/BUILD.bazel
index ba364c2..31f787d 100644
--- a/examples/configure_with_bazel_transitive/BUILD.bazel
+++ b/examples/configure_with_bazel_transitive/BUILD.bazel
@@ -8,6 +8,13 @@ cc_library(
includes = ["."],
)

+genrule(
+ name = "mytool.rule",
+ outs = ["mytool"],
+ cmd = "echo '#!/bin/sh\n\necho Seargent Tom to Ground Control' > $@",
+ executable = True,
+)
+
configure_make(
name = "simple",
configure_in_place = True,
@@ -16,6 +23,7 @@ configure_make(
"simple",
"install",
],
+ tools_deps = [":mytool"],
deps = [":built_with_bazel"],
)

diff --git a/examples/configure_with_bazel_transitive/simple_lib/configure b/examples/configure_with_bazel_transitive/simple_lib/configure
index 52db02d..50b27fc 100755
--- a/examples/configure_with_bazel_transitive/simple_lib/configure
+++ b/examples/configure_with_bazel_transitive/simple_lib/configure
@@ -1,4 +1,14 @@
#!/usr/bin/env bash
+
+if ! echo $PATH | grep mytool; then
+ echo "ERROR: mytool is not present in the PATH"
+else
+ echo "OK: mytool is present in the PATH"
+fi
+
+mytool || exit 3
+
+
echo "# simple" > Makefile

echo "CC = ${CC}" > Makefile
EOF

# Build the relevant target. Notice that the target fails to build.
bazel build //configure_with_bazel_transitive:simple -s --sandbox_debug

# Check out grand-parent commit
git stash
git checkout HEAD^^
git stash pop

# Build the relevant target. Notice that building the target succeeds.
bazel build //configure_with_bazel_transitive:simple -s --sandbox_debug
```

Contributor guide

Open the contributing guide

Research direction

Start with the configure_make rule and the two referenced commits, 0ed27c13b18f412e00e9122fc01327503d52579c and 2c6262f8f487cd3481db27e2c509d9e6d30bfe53. Reproduce with the provided changes in examples/WORKSPACE.bazel, examples/configure_with_bazel_transitive/BUILD.bazel, and its simple_lib/configure, then run bazel build //configure_with_bazel_transitive:simple. Done means the tools_deps tool is on PATH and the example build succeeds on the affected version.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.