Skip to content

Commit 0e6689d

Browse files
SebastianBoeAnas Nashif
authored and
Anas Nashif
committed
sanitycheck: Default to using Ninja
It is important that it is easy to reproduce CI issues locally. Using the same sanitycheck options locally and in CI helps in this regard. Specifically, Ninja and Make can produce different results and therefore the default generator should be the same for sanitycheck and shippable. This patch makes four changes: The sanitycheck option '--make' is introduced to allow specifying Make as a generator. CI no longer passes the option '--ninja' to sanitycheck. Sanitycheck defaults to using Ninja. Sanitycheck documents the --ninja option as deprecated. Signed-off-by: Sebastian Bøe <[email protected]>
1 parent 4eedb50 commit 0e6689d

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.shippable.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ compiler: gcc
55
env:
66
global:
77
- SDK=0.9.2
8-
- SANITYCHECK_OPTIONS=" --inline-logs -R -N"
8+
- SANITYCHECK_OPTIONS=" --inline-logs -R"
99
- SANITYCHECK_OPTIONS_RETRY="${SANITYCHECK_OPTIONS} --only-failed --outdir=out-2nd-pass"
1010
- ZEPHYR_SDK_INSTALL_DIR=/opt/sdk/zephyr-sdk-0.9.2
1111
- ZEPHYR_GCC_VARIANT=zephyr

scripts/sanitycheck

+11-6
Original file line numberDiff line numberDiff line change
@@ -828,14 +828,14 @@ class MakeGenerator:
828828
if not "native_posix" in args:
829829
ldflags="-Wl,--fatal-warnings"
830830

831-
if options.ninja:
832-
generator = "Ninja"
833-
generator_cmd = "ninja"
834-
verb = "-v" if VERBOSE else ""
835-
else:
831+
if options.make:
836832
generator = "Unix Makefiles"
837833
generator_cmd = "$(MAKE)"
838834
verb = "VERBOSE=1" if VERBOSE else "VERBOSE=0"
835+
else:
836+
generator = "Ninja"
837+
generator_cmd = "ninja"
838+
verb = "-v" if VERBOSE else ""
839839

840840
return MakeGenerator.MAKE_RULE_TMPL.format(
841841
generator=generator,
@@ -2092,7 +2092,12 @@ def parse_arguments():
20922092

20932093
parser.add_argument(
20942094
"-N", "--ninja", action="store_true",
2095-
help="Use the Ninja generator with CMake")
2095+
help="Use the Ninja generator with CMake. "
2096+
"This option is deprecated as Ninja is now the default.")
2097+
2098+
parser.add_argument(
2099+
"-M", "--make", action="store_true",
2100+
help="Use the 'Unix Makefiles' generator with CMake")
20962101

20972102
parser.add_argument(
20982103
"-y", "--dry-run", action="store_true",

0 commit comments

Comments
 (0)