Commit Graph

11 Commits

Author SHA1 Message Date
Kefu Chai
1186ddef16 build: cmake: use paths to be compatible with CI
our CI workflow for publishing the packages expects the tar balls
to be located under `build/$buildMode/dist/tar`, where `$buildMode`
is "release" or "debug".

before this change, the CMake building system puts the tar balls
under "build/dist" when the multi-config generator is used. and
`configure.py` uses multi-config generator.

in this change, we put the tar balls for redistribution under
`build/$<CONFIG>/dist/tar`, where `$<CONFIG>` is "RelWithDebInfo"
or "Debug", this works better with the CI workflow -- we just need
to map "release" and "debug" to "RelWithDebInfo" and "Debug" respectively.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2024-05-11 21:56:50 +08:00
Kefu Chai
d57a82c156 build: cmake: add dist-* targets to the default build target
also, add a target of `dist-server`, which mirrors the structure
of the targets created by `configure.py`, and it is consistent
with the ones defined by `build_submodule()`.

so that they are built when our CI runs `ninja -C $build`. CI
expects that all these rpm and deb packages to built when
`ninja -C $build` finishes. so that it can continue with
building the container image. let's make it happen. so that
the CMake-based rules can work better with CI.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2024-03-18 20:02:43 +08:00
Yaniv Kaul
c658bdb150 Typos: fix typos in comments
Fixes some typos as found by codespell run on the code.
In this commit, I was hoping to fix only comments, not user-visible alerts, output, etc.
Follow-up commits will take care of them.

Refs: https://github.com/scylladb/scylladb/issues/16255
Signed-off-by: Yaniv Kaul <yaniv.kaul@scylladb.com>
2023-12-02 22:37:22 +02:00
Kefu Chai
268f75c931 build: cmake: build unified package
a new target "dist-unified" is added, so that CMake can build unified
package, which is a bundle of all subcomponents, like cqlsh, python3,
jmx and tools.

Fixes #15241
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-09-14 00:41:46 +08:00
Kefu Chai
4ff5ce9933 build: cmake: always use the version with tilde
since we always use tilde ("~") in the verson number,
let's just cache it as an internal variable in CMake.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-09-12 18:18:31 +08:00
Kefu Chai
111d20958e build: cmake: build python3 dist tarball with arch postfix
now that `configure.py` always generate python3 dist tarball with
${arch} postfix, let's mirror this behavior. as `build_unified.sh`
uses this naming convention.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-09-12 18:18:31 +08:00
Kefu Chai
760b7c8772 build: cmake: use the default comment message
it turns out "Generating submodule python3 in python3" is not
as informative as default one:
"/home/kefu/dev/scylladb/tools/python3/build/scylla-python3-5.4.0~dev-0.20230908.1668d434e458.noarch.tar.gz"
so let's drop the "COMMENT" argument.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-09-12 18:18:31 +08:00
Kefu Chai
32c26624bf build: cmake: correct reloc_pkg's path
before this change, the filename in path of reloc package looks like:
tools-scylla-5.4.0~dev-0.20230816.2eb6dc57297e.noarch.tar.gz
but it should have been:
scylla-tools-5.4.0~dev-0.20230816.2eb6dc57297e.noarch.tar.gz
so, when repackaging the reloc tarball to rpm / deb, the scripts
just fails to find the reloc tarball and fail.

after this change, the filename is corrected to match with the one
generated using `build_reloc.sh`.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-08-16 16:15:23 +08:00
Kefu Chai
a19c7fa8d5 build: cmake: build rpm/deb from reloc_pkg
before this change, dist-${name}-rpm and dist-${name}-deb targets
do not depend on the corresponding reloc pkg from which these
prebuilt packages are created. so these scripts fail if the reloc
package does not exist.

to address this problem, the reloc package is added as their
dependencies.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-08-16 16:15:23 +08:00
Kefu Chai
3ad844a4bb build: cmake: set scylla version strings as CACHED strings
before this change, add_version_library() is a single function
which accomplishes two tasks:

1. build scylla-version target using
2. add an object library

but this has two problems:

1. we should run `SCYLLA-VERSION-GEN` at configure time, instead
   of at build time. otherwise the targets which read from the
   SCYLLA-{VERSION, RELEASE, PRODUCT}-FILE cannot access them,
   unless they are able to read them in their build rules. but
   they always use `file(STRINGS ..)` to read them, and thsee
   `file()` command is executed at configure time. so, this
   is a dead end.
2. we repeat the `file(STRING ..)` multiple places. this is
   not ideal if we want to minimize the repeatings.

so, to address this problem, in this change:

1. use `execute_process()` instead of `add_custom_command()`
   for generating these *-FILE files. so they are always ready
   at build time. this partially reverts bb7d99ad37.
2. extract `generate_scylla_version()` out of `add_version_library()`.
   so we can call the former much earlier than the latter.
   this would allow us to reference the variables defined by
   the `generate_scylla_version()` much earlier.
3. define cached strings in the extracted function, so that
   they can consumed by other places.
4. reference the cached variables in `build_submodule.cmake`.

also, take this opportunity to fix the version string
used in build_submodule.cmake: we should have used
`scylla_version_tilde`.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes #14769
2023-07-24 08:57:19 +03:00
Kefu Chai
959bfae665 build: cmake: build submodules
this mirrors what we have in the `build.ninja` generated by
`configure.py`. with this change, we can build for instance,
`dist-tool-tar` from the `build.ninja` generated by CMake.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-07-19 13:08:35 +08:00