Skip to content

Commit

Permalink
sanitycheck: Default to using Ninja
Browse files Browse the repository at this point in the history
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 <sebastian.boe@nordicsemi.no>
  • Loading branch information
SebastianBoe authored and Anas Nashif committed Feb 12, 2018
1 parent 4eedb50 commit 0e6689d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .shippable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ compiler: gcc
env:
global:
- SDK=0.9.2
- SANITYCHECK_OPTIONS=" --inline-logs -R -N"
- SANITYCHECK_OPTIONS=" --inline-logs -R"
- SANITYCHECK_OPTIONS_RETRY="${SANITYCHECK_OPTIONS} --only-failed --outdir=out-2nd-pass"
- ZEPHYR_SDK_INSTALL_DIR=/opt/sdk/zephyr-sdk-0.9.2
- ZEPHYR_GCC_VARIANT=zephyr
Expand Down
17 changes: 11 additions & 6 deletions scripts/sanitycheck
Original file line number Diff line number Diff line change
Expand Up @@ -828,14 +828,14 @@ class MakeGenerator:
if not "native_posix" in args:
ldflags="-Wl,--fatal-warnings"

if options.ninja:
generator = "Ninja"
generator_cmd = "ninja"
verb = "-v" if VERBOSE else ""
else:
if options.make:
generator = "Unix Makefiles"
generator_cmd = "$(MAKE)"
verb = "VERBOSE=1" if VERBOSE else "VERBOSE=0"
else:
generator = "Ninja"
generator_cmd = "ninja"
verb = "-v" if VERBOSE else ""

return MakeGenerator.MAKE_RULE_TMPL.format(
generator=generator,
Expand Down Expand Up @@ -2092,7 +2092,12 @@ def parse_arguments():

parser.add_argument(
"-N", "--ninja", action="store_true",
help="Use the Ninja generator with CMake")
help="Use the Ninja generator with CMake. "
"This option is deprecated as Ninja is now the default.")

parser.add_argument(
"-M", "--make", action="store_true",
help="Use the 'Unix Makefiles' generator with CMake")

parser.add_argument(
"-y", "--dry-run", action="store_true",
Expand Down

0 comments on commit 0e6689d

Please sign in to comment.