Skip to content

Conversation

@opajonk
Copy link
Contributor

@opajonk opajonk commented Oct 10, 2025

There, "bash" must be omitted from the call. This also works for Bazel 8.x, so let's use that.

Also, the platform name must be linux/arm64. At least for MacOS this seems to be the correct syntax.

There, "bash" must be omitted from the call.
Copy link
Contributor

@lurtz lurtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the old command not working with either version of bazel. Maybe this was a mixup of bazel and bazelisk. Works locally with Bazel 7.5.0 and 8.3.0

At least on MacOS, the current name does not work. platform/arm64 is correct.
There, "bash" must be omitted from the call. This also works for Bazel 8.x, so let's use that.
@opajonk opajonk changed the title Bazel versions 7.x do not support this syntax Fix bazel compile commands syntax, use correct platform name Oct 11, 2025
@opajonk opajonk changed the title Fix bazel compile commands syntax, use correct platform name Fix bazel compile commands syntax, use correct platform name for ARM64 Oct 11, 2025
@opajonk opajonk requested a review from lurtz October 11, 2025 14:17
Copy link
Contributor

@lurtz lurtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With such a bugfix PR, which needs to fix what was just merged, I wonder if we should improve automated testing. E.g. when building devcontainers I used to be less concerned if the tool versions are what we expect, but more that these tools actually get the job done.

In this case toy projects with Bazel 7.5.0 an 8.3.0 might be good enough. Both could contain a small piece of Rust and C++ code which is compiled and we check that e.g. files for code completion exist.

set -euxo pipefail

devcontainer build --platform linux/aarch64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer --cache-from ghcr.io/eclipse-score/devcontainer
devcontainer build --platform linux/arm64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer --cache-from ghcr.io/eclipse-score/devcontainer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this one optional? Locally I already commented building for ARM, because I only need / use x86

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No the default is to build all. If you want to do something else locally - no problem ;-)

# Pre-install a fixed Bazel version, setup the bash command completion
export USE_BAZEL_VERSION=${bazel_version}
bazel help completion bash > /tmp/bazel-complete.bash
bazel help completion > /tmp/bazel-complete.bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why the shells set e did not cause a failure here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not fail in this case, since there Bazel 8.4.x (as specified) is always used. I changed this line only to have it consistent with the other line that had to be changed.

@opajonk
Copy link
Contributor Author

opajonk commented Oct 11, 2025

With such a bugfix PR, which needs to fix what was just merged, I wonder if we should improve automated testing. E.g. when building devcontainers I used to be less concerned if the tool versions are what we expect, but more that these tools actually get the job done.

In this case toy projects with Bazel 7.5.0 an 8.3.0 might be good enough. Both could contain a small piece of Rust and C++ code which is compiled and we check that e.g. files for code completion exist.

There was no build failure. Only the platform name was wrong, but that I could not figure out before actually using a Mac and trying to pull the image. And actually, the Mac image works fine, but all Bazel builds fail. Obviously, no one ever checked/created Bazel toolchains for arm64 ;-) On the other hand, cargo build (from the dev container) works just fine and is quite fast!

@opajonk opajonk requested a review from lurtz October 11, 2025 14:50
@AlexanderLanin AlexanderLanin merged commit 0b4bc06 into eclipse-score:main Oct 13, 2025
2 checks passed
@lurtz lurtz deleted the fix-bash-completion-generation-for-older-bazel branch October 14, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants