Skip to content

Fail to build cpp-tutorial stage1 with Bazel 7.0.0 #20533

@sjwo

Description

@sjwo

Description of the bug:

Bazel 7.0.0 fails to build the stage1 portion of the bazelbuild/examples/cpp-tutorial. It appears to fail to resolve a path it constructs.

Reverting to Bazel 6.4.0, or passing the --noincompatible_sandbox_hermetic_tmp build option, are both successful workarounds.

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Ubuntu 20.04.
  2. Download bazelisk-linux-amd64 from https://github.com/bazelbuild/bazelisk/releases/tag/v1.19.0, add it to your PATH, and make it executable.
  3. Clone https://github.com/bazelbuild/examples, and change into the examples/cpp-tutorial/stage1 directory.
  4. Execute bazelisk-linux-amd64 build //main:hello-world.
  5. As part of the build failure output, receive the following error message:
external/gcc_toolchain_x86_64/bin/gcc: line 45: /tmp/external/gcc_toolchain_x86_64_files/bin/x86_64-linux-gcc: No such file or directory

Which operating system are you running Bazel on?

Ubuntu 20.04

What is the output of bazel info release?

release 7.0.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

https://github.com/bazelbuild/examples
master
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
9c4e6c5de1a053efa956c0a7a8f54d302d24e0b1

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

Possibly.

Have you found anything relevant by searching the web?

Any other information, logs, or outputs that you want to share?

Here is the output of git rev-parse main:

9c4e6c5de1a053efa956c0a7a8f54d302d24e0b1

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering working on this, but happy to review a PR. (No assignee)team-Rules-CPPIssues for C++ rulestype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions