Skip to content

Commit 164bcd7

Browse files
authored
Move c99 flag from BUILD file to bazel cmd line (#366)
* Move `c99` flag from BUILD file to bazel cmd line Requiring c99 for everyone breaks downstream users. * Remove requiring bzlmod
1 parent 747d711 commit 164bcd7

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

.bazelrc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
###############################################################################
2+
# Common flags that apply to all configurations.
3+
# Use sparingly for things common to all compilers and platforms.
4+
###############################################################################
5+
6+
# Prevent invalid caching if input files are modified during a build.
7+
build --experimental_guard_against_concurrent_changes
8+
9+
###############################################################################
10+
# Options for continuous integration.
11+
###############################################################################
12+
13+
# Speedup bazel using a ramdisk.
14+
build:ci --sandbox_base=/dev/shm
15+
16+
# Show as many errors as possible.
17+
build:ci --keep_going
18+
19+
# Show subcommands when building
20+
build:ci --subcommands=true
21+
22+
# Make sure we test for C99 compliance when building the library
23+
build:ci --conlyopt=-std=c99
24+
25+
# Show test errors.
26+
test:ci --test_output=errors
27+
28+
###############################################################################
29+
30+
# The user.bazelrc file is not checked in but available for local mods.
31+
# Always keep this at the end of the file so that user flags override.
32+
try-import %workspace%/user.bazelrc

BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ exports_files(["LICENSE"])
1414
INCLUDES = ["include"]
1515

1616
C99_FLAGS = [
17-
"-std=c99",
1817
"-Wall",
1918
"-Wextra",
2019
"-Wmissing-declarations",

bazel/ci/docker/Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,7 @@ COPY . .
2525

2626
FROM devel AS build
2727
RUN bazel version
28-
RUN bazel build \
29-
-c opt \
30-
--subcommands=true \
31-
...
28+
RUN bazel build --config=ci ...
3229

3330
FROM build AS test
34-
RUN bazel test \
35-
-c opt \
36-
--test_output=errors \
37-
...
31+
RUN bazel test --config=ci ...

0 commit comments

Comments
 (0)