Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

absl fails to build with bazel 0.20 due to new_http_archive #86

Closed
rickeylev opened this issue Dec 4, 2018 · 0 comments
Closed

absl fails to build with bazel 0.20 due to new_http_archive #86

rickeylev opened this issue Dec 4, 2018 · 0 comments
Assignees
Labels

Comments

@rickeylev
Copy link
Contributor

As of bazel 0.20, it appears that new_http_archive is deprecated in favor of http_archive from the http.bzl starlark extensions. The error message says its a drop in replacement, but this isn't quite true.

Here's the error message with a plain build with bazel 0.20

Starting local Bazel server and connecting to it...
INFO: Invocation ID: 524bae95-f6bf-45f1-9dcc-e51a24c535e9
ERROR: /usr/local/google/home/rlevasseur/absl-gob/PyAbseilCommonLibraries/absl/flags/BUILD:5:1: no such package '@six_archive//': The native new_http_archive rule is deprecated. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") for a drop-in replacement.
Use --incompatible_remove_native_http_archive=false to temporarily continue using the native rule. and referenced by '//absl/flags:flags'
ERROR: Analysis of target '//absl:app' failed; build aborted: no such package '@six_archive//': The native new_http_archive rule is deprecated. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") for a drop-in replacement.
Use --incompatible_remove_native_http_archive=false to temporarily continue using the native rule.
INFO: Elapsed time: 2.878s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (7 packages loaded, 26 targets configured)
    Fetching @six_archive; fetching

Switching to http.bzl and http_archive gives a different error:

$ bazel build absl:app
INFO: Invocation ID: 97b201ea-ebd5-4d02-8f8f-dae99b4b2458
INFO: Build options have changed, discarding analysis cache.
ERROR: /usr/local/google/home/rlevasseur/absl-gob/PyAbseilCommonLibraries/absl/flags/BUILD:5:1: no such package '@six_archive//': Traceback (most recent call last):
        File "/usr/local/google/home/rlevasseur/.cache/bazel/_bazel_rlevasseur/beec95bc32223bdd257f4689504738ee/external/bazel_tools/tools/build_defs/repo/http.bzl", line 56
                workspace_and_buildfile(ctx)
        File "/usr/local/google/home/rlevasseur/.cache/bazel/_bazel_rlevasseur/beec95bc32223bdd257f4689504738ee/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 60, in workspace_and_buildfile
                ctx.symlink(ctx.attr.build_file, "BUILD.bazel")
Not a regular file: /usr/local/google/home/rlevasseur/absl-gob/PyAbseilCommonLibraries/external/third_party/six.BUILD and referenced by '//absl/flags:flags'
ERROR: Analysis of target '//absl:app' failed; build aborted: no such package '@six_archive//': Traceback (most recent call last):
        File "/usr/local/google/home/rlevasseur/.cache/bazel/_bazel_rlevasseur/beec95bc32223bdd257f4689504738ee/external/bazel_tools/tools/build_defs/repo/http.bzl", line 56
                workspace_and_buildfile(ctx)
        File "/usr/local/google/home/rlevasseur/.cache/bazel/_bazel_rlevasseur/beec95bc32223bdd257f4689504738ee/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 60, in workspace_and_buildfile
                ctx.symlink(ctx.attr.build_file, "BUILD.bazel")
Not a regular file: /usr/local/google/home/rlevasseur/absl-gob/PyAbseilCommonLibraries/external/third_party/six.BUILD
INFO: Elapsed time: 0.371s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (7 packages loaded, 38 targets configured)
    Fetching @six_archive; fetching

Searching around, this looks to be related to maybe this: bazelbuild/bazel#6225
Basically, its not quite a drop-in replacement.

Unfortunately, I wasn't able to get it to work with e.g. build_file="@//:third_party/six.BUILD (as mentioned in the above issue), I think because the "third_party" directory doesn't have a BUILD file (the error it gives refers to being unable to find the bazel package). I can get it to work using build_file_content, though, so I might just use that instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant