-
Notifications
You must be signed in to change notification settings - Fork 697
build: fix static build #2875
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
build: fix static build #2875
Conversation
The libnvme builds needs to be told not to build a shared object version. Also there is no point in building the tests which depend on LD preload trick to be executed. The examples are also not really usefull in this build, thus disable them as well. Signed-off-by: Daniel Wagner <[email protected]>
|
Looks good and just confirmed as the muon build nvme-cli with the PR changes works on my local environment correctly. |
|
For some reason the 'make static' build didn't work on my machine. The CI build did work. I suspect newer versions of meson might be handling the static stuff slightly differently. Good to know it works on your distro as well. Anwyay, this is for #2876 |
|
Okay. Sorry I have misunderstood as the static build is the muon build but not same. I had tested the muon build only and it worked correctly but now I just tested the static build but still failed with your PR changes as below. tokunori@tokunori-X570-Taichi:~/nvme-cli$ make static
meson setup .build --buildtype=release \
--wrap-mode=forcefallback \
--default-library=static \
-Dc_link_args="-static" \
-Dlibnvme:default_library=static \
-Dlibnvme:keyutils=disabled \
-Dlibnvme:liburing=disabled \
-Dlibnvme:python=disabled \
-Dlibnvme:openssl=disabled \
-Dlibnvme:tests=false \
-Dlibnvme:examples=false
Directory already configured.
Just run your build command (e.g. ninja) and Meson will regenerate as necessary.
Run "meson setup --reconfigure" to force Meson to regenerate.
If build failures persist, run "meson setup --wipe" to rebuild from scratch
using the same options as passed when configuring the build.
ERROR: Unknown options: "libnvme:default_library, libnvme:examples, libnvme:keyutils, libnvme:liburing, libnvme:openssl, libnvme:python, libnvme:tests"
make: *** [Makefile:71: static] エラー 1Note: I did both setup --reconfigure and --wipe but still failed as same. tokunori@tokunori-X570-Taichi:~$ uname -a
Linux tokunori-X570-Taichi 6.14.0-24-generic #24-Ubuntu SMP PREEMPT_DYNAMIC Sun Jun 15 11:18:07 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
tokunori@tokunori-X570-Taichi:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=25.04
DISTRIB_CODENAME=plucky
DISTRIB_DESCRIPTION="Ubuntu 25.04"
tokunori@tokunori-X570-Taichi:~$ meson -v
1.7.0About this failure it is okay for now for me since I will do investigate to resolve this later. (Seems this also depended on the meson version.) |
|
Could you do a 'make clean' first? It looks like the static build fails if there is already a |
|
Right the static build comleted without any error on the master code by tokunori@tokunori-X570-Taichi:~/nvme-cli$ make static
meson setup .build --buildtype=release \
--wrap-mode=forcefallback \
--default-library=static \
-Dc_link_args="-static" \
-Dlibnvme:default_library=static \
-Dlibnvme:keyutils=disabled \
-Dlibnvme:liburing=disabled \
-Dlibnvme:python=disabled \
-Dlibnvme:openssl=disabled \
-Dlibnvme:tests=false \
-Dlibnvme:examples=false
The Meson build system
Version: 1.7.0
Source dir: /home/tokunori/nvme-cli
Build dir: /home/tokunori/nvme-cli/.build
Build type: native build
Project name: nvme-cli
Project version: 2.14
C compiler for the host machine: cc (gcc 14.2.0 "cc (Ubuntu 14.2.0-19ubuntu2) 14.2.0")
C linker for the host machine: cc ld.bfd 2.44
Host machine cpu family: x86_64
Host machine cpu: x86_64
Looking for a fallback subproject for the dependency libnvme because:
Use of fallback dependencies is forced.
Cloning into 'libnvme'...
remote: Enumerating objects: 26851, done.
remote: Counting objects: 100% (4475/4475), done.
remote: Compressing objects: 100% (1660/1660), done.
remote: Total 26851 (delta 3144), reused 2885 (delta 2815), pack-reused 22376 (from 2)
Receiving objects: 100% (26851/26851), 9.08 MiB | 2.73 MiB/s, done.
Resolving deltas: 100% (22523/22523), done.
HEAD is now at 846d61ca Release v1.14
Executing subproject libnvme
subprojects/libnvme/meson.build:8:0: ERROR: In subproject libnvme: Unknown options: "libnvme:examples"
A full log can be found at /home/tokunori/nvme-cli/.build/meson-logs/meson-log.txt
make: *** [Makefile:71: static] エラー 1(Added) |
|
It looks like you're trying to build libnvme v1.14 (as per |
|
Thanks for your advice! The error resolved by cherry-picking the PR commit: 84d25b1 into linux-nvme:master based code. (So looks igaw:build-static based code not rebased with the linux-nvme:master). Anyway I could confirmed both the static builds (without the PR commit: 84d25b1 and with it) work correctly on my local environment. |
The libnvme builds needs to be told not to build a shared object version. Also there is no point in building the tests which depend on LD preload trick to be executed.