Merge 'Add a ninja help build target' from Pekka Enberg

This pull request adds a "ninja help" build target in hopes of making
the different build targets more discoverable to developers.

Closes #8454

* github.com:scylladb/scylla:
  building.md: Document "ninja help" target
  configure.py: "ninja help" target
  building.md: Document "ninja <mode>-dist" target
  configure.py: Add <mode>-dist target as alias for dist-<mode>
This commit is contained in:
Avi Kivity
2021-04-12 16:30:37 +03:00
3 changed files with 31 additions and 2 deletions

View File

@@ -1983,7 +1983,8 @@ with open(buildfile_tmp, 'w') as f:
build $builddir/{mode}/dist/tar/{scylla_product}-tools-package.tar.gz: copy tools/java/build/{scylla_product}-tools-package.tar.gz
build $builddir/{mode}/dist/tar/{scylla_product}-jmx-package.tar.gz: copy tools/jmx/build/{scylla_product}-jmx-package.tar.gz
build dist-{mode}: phony dist-server-{mode} dist-python3-{mode} dist-tools-{mode} dist-jmx-{mode} dist-unified-{mode}
build {mode}-dist: phony dist-server-{mode} dist-python3-{mode} dist-tools-{mode} dist-jmx-{mode} dist-unified-{mode}
build dist-{mode}: phony {mode}-dist
build dist-check-{mode}: dist-check
mode = {mode}
'''))
@@ -2025,6 +2026,9 @@ with open(buildfile_tmp, 'w') as f:
rule extract_node_exporter
command = tar -C build -xvpf {node_exporter_filename} && rm -rfv build/node_exporter && mv -v build/{node_exporter_dirname} build/node_exporter
build $builddir/node_exporter: extract_node_exporter | always
rule print_help
command = ./scripts/build-help.sh
build help: print_help | always
''').format(**globals()))
os.rename(buildfile_tmp, buildfile)

View File

@@ -48,6 +48,12 @@ or launch a Scylla server locally with:
./tools/toolchain/dbuild ./build/dev/scylla --workdir tmp --developer-mode 1 --smp 1 --memory 1G
```
For more help with build targets, run:
```console
./tools/toolchain/dbuild ninja help
```
That's it!
## Configuring
@@ -114,7 +120,7 @@ To build packages, run:
Alternatively, to build packages for a specific build mode, run:
```console
./tools/toolchain/dbuild ninja dist-<mode>
./tools/toolchain/dbuild ninja <mode>-dist
```
To verify the packages, run:

19
scripts/build-help.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
cat << EOF
usage: ninja [options] [targets...]
Run \`ninja -h\` for help on supported options.
Build targets:
build Build artifacts for all configured build modes.
<mode>-build Build artifacts for a specific build mode.
Test targets:
test Run tests for all configured build modes.
<mode>-test Run tests for a specific build mode.
Packaging targets:
dist Build distribution packages (.rpm, .deb) for all build modes.
<mode>-dist Build distribution packages (.rpm, .deb) for a specific build mode.
EOF