Skip to content

/etc/bazel.bazelrc may include broken config #2201

@chickenandpork

Description

@chickenandpork

As suggested in build logs such as the following, the config file /etc/bazel.bazelrc may include an erroneous config value that breaks bazel query during builds:

        INFO: Reading rc options for 'query' from /private/etc/bazel.bazelrc:
          Inherited 'common' options: --jvmopt=-Djava.net.preferIPv6Addresses
        ERROR: --jvmopt=-Djava.net.preferIPv6Addresses :: Unrecognized option: --jvmopt=-Djava.net.preferIPv6Addresses

(https://storage.googleapis.com/bazel-untrusted-buildkite-artifacts/0195d97a-b51c-4eb8-83f9-9d4bf91e96a2/internal/e2e/error/error_test/test.log) -- of note, "query" reading "common" that has a flag that isn't common to all bazel actions :(

This won't affect most CI: I would expect that most CI are just running bazel build, and accepting the common config value without a problem.

bazel-watcher AKA ibazel builds a new ibazel, which then runs bazel query to determine the Build files and Source files which affect the current project.

In running bazel query, it seems that the query statement, reading /etc/bazel.bazelrc, gets a value for common that doesn't exist for query: a "jvmopt" attribute.

I've looked to see where this file is populated, and "achew22" (Andrew Allen) has suggested it's in

steps = templatefile("pipeline.yml.tpl", { envs = {}, steps = { commands = ["curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/master/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py", "python3.6 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"] } })
which is pulling a copy of the latest version of bazelci.py which includes this gem :

    if is_mac():
        flags += ["--jvmopt=-Djava.net.preferIPv6Addresses"]

(

flags += ["--jvmopt=-Djava.net.preferIPv6Addresses"]
)
... but I think that affects the outer run of bazel, not the one started by ibazel.

I can't seem to find where this /etc/bazel.bazelrc is defined, but it seems to be the deployed macOS build systems tainting the build in a non-hermetic way. I can't find anything in the build config that defines this jvmopt.

Is there anyone I can talk to about this? Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions