Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move c99 flag from BUILD file to bazel cmd line #366

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
###############################################################################
# Common flags that apply to all configurations.
# Use sparingly for things common to all compilers and platforms.
###############################################################################

# Prevent invalid caching if input files are modified during a build.
build --experimental_guard_against_concurrent_changes

###############################################################################
# Options for continuous integration.
###############################################################################

# Speedup bazel using a ramdisk.
build:ci --sandbox_base=/dev/shm

# Show as many errors as possible.
build:ci --keep_going

# Show subcommands when building
build:ci --subcommands=true

# Make sure we test for C99 compliance when building the library
build:ci --conlyopt=-std=c99

# Show test errors.
test:ci --test_output=errors

###############################################################################

# The user.bazelrc file is not checked in but available for local mods.
# Always keep this at the end of the file so that user flags override.
try-import %workspace%/user.bazelrc
1 change: 0 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ exports_files(["LICENSE"])
INCLUDES = ["include"]

C99_FLAGS = [
"-std=c99",
"-Wall",
"-Wextra",
"-Wmissing-declarations",
Expand Down
10 changes: 2 additions & 8 deletions bazel/ci/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ COPY . .

FROM devel AS build
RUN bazel version
RUN bazel build \
-c opt \
--subcommands=true \
...
RUN bazel build --config=ci ...

FROM build AS test
RUN bazel test \
-c opt \
--test_output=errors \
...
RUN bazel test --config=ci ...
Loading