Skip to content

Conversation

@igaw
Copy link
Collaborator

@igaw igaw commented Jul 24, 2025

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 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]>
@ikegami-t
Copy link
Contributor

Looks good and just confirmed as the muon build nvme-cli with the PR changes works on my local environment correctly.

@igaw
Copy link
Collaborator Author

igaw commented Jul 24, 2025

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

@ikegami-t
Copy link
Contributor

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] エラー 1

Note: I did both setup --reconfigure and --wipe but still failed as same.
Note2: The failure behavior was same for the current master code.
Just FYI: My environment is below.

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.0

About 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.)

@igaw
Copy link
Collaborator Author

igaw commented Jul 25, 2025

Could you do a 'make clean' first? It looks like the static build fails if there is already a .build dir. I wonder if we should use a postfix for these configuration, e.g. .build-static?

@ikegami-t
Copy link
Contributor

ikegami-t commented Jul 25, 2025

Right the static build comleted without any error on the master code by make clean. But unfortunately with the PR changes the static build failed as below. (Attached the meson log file: meson-log.txt also.)

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)
About the .build-static mentioned seems it is also okay to describe the make clean clearly as needed on the readme or wiki page instead.

@martin-belanger
Copy link

It looks like you're trying to build libnvme v1.14 (as per HEAD is now at 846d61ca Release v1.14) with the option -Dlibnvme:examples=false, but this option was only introduced in v1.15.

@ikegami-t
Copy link
Contributor

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.

@igaw igaw merged commit 37f0290 into linux-nvme:master Jul 28, 2025
16 of 17 checks passed
@igaw igaw deleted the build-static branch July 28, 2025 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants