bazelbuild / bazelbuild/continuous-integration

Builds seem to ignore `/workdir/.bazelrc`

Open
#1,133 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
302
Forks
194
Avg merge
1d 19h
Merged PRs (30d)
41

Description

https://buildkite.com/bazel/bcsgh-stl-to-ps/builds/8#870d8fa1-5b3a-431a-b364-f0f5c1be10af << The case where this is causing problems.
https://buildkite.com/bazel/bcsgh-tbd/builds/8#eea4ef7b-aa30-4b2d-a818-62f0c18924cd << Another build that shows the same issue but otherwise works.

Despite the CI logs reporting:

> (22:45:59) INFO: Reading rc options for 'build' from /workdir/.bazelrc:
> 'build' options: --cxxopt=-std=c++17

later on the C++ version ends up being C++2011:

#define a(x) b(x)
#define b(x) #x
static_assert(__cplusplus > 201103L, a(__cplusplus));

results in:

> ./tbd/ast.h:3:1: error: static assertion failed: 201103L
> static_assert(__cplusplus > 201103L, a(__cplusplus));
> ^

I've poked around and in my local build environment I can reproduce that failure message by updating the `.bazelrc` file to set `-std=c++11`, so I think Bazel it self is working.

My local environment, which works as expected:
> $ bazel version
> Starting local Bazel server and connecting to it...
> Build label: 4.0.0
> Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
> Build time: Thu Jan 21 07:33:24 2021 (1611214404)
> Build timestamp: 1611214404
> Build timestamp as int: 1611214404

Contributor guide

Open the contributing guide

Research direction

Start by comparing the two linked Buildkite logs, then inspect the reported /workdir/.bazelrc setting and tbd/ast.h's C++ version assertion. The issue is done when the CI build uses the configured C++17 option and the affected build no longer reports __cplusplus as 201103L.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.