Skip to contentSkip to conversation

WTF is going on with the nvme-cli build

DISCUSSION Christoph Hellwig 3 participants 10 messages Apr 13, 2023 – Apr 17, 2023 NVMe

lore
Share & tools
lore
#0 lore raw

Hi Daniel,

can you please urgently fix nvme-cli to have a sane build system again?

Right now it tries to download random packages over the internet instead of not building components or failing the configuration.

That's simply not acceptable.

#1 lore raw

Hi Christoph,

Quoted 2 lines · Christoph Hellwig

can you please urgently fix nvme-cli to have a sane build system again?

Please, let's not be so drastic and I would argue all build system have their wards. We just need to figure out how to handle them.

Quoted 2 lines

Right now it tries to download random packages over the internet instead of not building components or failing the configuration.

Which version are you using? I've recentely change the default behavior of the fallback mechanisme but might have missed something. Alternatively, it also possible to change the global default for this feature.

The flag in question is:

  meson setup --wrap-mode=nofallback .build
#2 lore raw
Quoted 8 lines · Daniel Wagner

Hi Christoph,

Quoted 2 lines · Christoph Hellwig

can you please urgently fix nvme-cli to have a sane build system again?

Please, let's not be so drastic and I would argue all build system have their wards. We just need to figure out how to handle them.

No, the idea of downloading software over a network connection is just completely fucke up and not acceptable.

Quoted 7 lines
Quoted 3 lines

Right now it tries to download random packages over the internet instead of not building components or failing the configuration.

Which version are you using? I've recentely change the default behavior of the fallback mechanisme but might have missed something. Alternatively, it also possible to change the global default for this feature.

Latest git tree.

#3 lore raw
Quoted 2 lines · Christoph Hellwig

No, the idea of downloading software over a network connection is just completely fucke up and not acceptable.

I've update all the defaults of libnvme and nvme-cli and updated the CI build accordingly. While at it also tried to sync up the documentation. Hope this addresses the issue.

I think I could also provide some basic build scripts for different scenarios. Just to make things a bit smoother.

#4 lore raw
In reply to Daniel Wagner
Quoted 8 lines · Daniel Wagner

Hi Christoph,

Quoted 2 lines · Christoph Hellwig

can you please urgently fix nvme-cli to have a sane build system again?

Please, let's not be so drastic and I would argue all build system have their wards. We just need to figure out how to handle them.

Since we are talking about this, builds of libnvme on latest Fedora miserably fail:

FAILED: src/libnvme.so.1.4.0.p/nvme_json.c.o
ccache cc -Isrc/libnvme.so.1.4.0.p -Isrc -I../src -I. -I.. -Iccan -I../ccan -Iinternal -I../internal -I/usr/local/include/json-c -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O0 -g -fomit-frame-pointer -D_GNU_SOURCE -include internal/config.h -DCCAN_LIST_DEBUG=1 -DCCAN_STR_DEBUG=1 -fPIC -MD -MQ src/libnvme.so.1.4.0.p/nvme_json.c.o -MF src/libnvme.so.1.4.0.p/nvme_json.c.o.d -o src/libnvme.so.1.4.0.p/nvme_json.c.o -c ../src/nvme/json.c ../src/nvme/json.c:15:10: fatal error: json.h: No such file or directory
15 | #include <json.h>

      |          ^~~~~~~~

All the time... And I do have the json development headers installed:

/usr/include/json-c/json.h

But the compile command does not add -I/usr/include/json-c: it uses the broken default /usr/local/include/json-c. No normal distro install anything in /usr/local...

And that is despite the fact that meson setup says:

Run-time dependency json-c found: YES 0.15

Something is not right.

Quoted 12 lines
Quoted 3 lines

Right now it tries to download random packages over the internet instead of not building components or failing the configuration.

Which version are you using? I've recentely change the default behavior of the fallback mechanisme but might have missed something. Alternatively, it also possible to change the global default for this feature.

The flag in question is:

  meson setup --wrap-mode=nofallback .build
#5 lore raw

On Thu, Apr 13, 2023 at 07:49:42PM +0900, Damien Le Moal wrote:
All the time... And I do have the json development headers installed:

Quoted 7 lines

/usr/include/json-c/json.h

But the compile command does not add -I/usr/include/json-c: it uses the broken default /usr/local/include/json-c. No normal distro install anything in /usr/local...

Quoted 5 lines

And that is despite the fact that meson setup says:

Run-time dependency json-c found: YES 0.15

Something is not right.

meson uses pkg-config (and cmake) to find all the dependency. I suspect the PKG_CONFIG_PATH contains /usr/local/lib/pkgconfig. Can you check the pkg-config configuration?

#6 lore raw
Quoted 11 lines · Daniel Wagner

On Thu, Apr 13, 2023 at 07:49:42PM +0900, Damien Le Moal wrote:
All the time... And I do have the json development headers installed:

Quoted 9 lines

/usr/include/json-c/json.h

But the compile command does not add -I/usr/include/json-c: it uses the broken default /usr/local/include/json-c. No normal distro install anything in /usr/local...

And that is despite the fact that meson setup says:

Quoted 7 lines
Quoted 3 lines

Run-time dependency json-c found: YES 0.15

Something is not right.

meson uses pkg-config (and cmake) to find all the dependency. I suspect the PKG_CONFIG_PATH contains /usr/local/lib/pkgconfig. Can you check the pkg-config configuration?

Yeah. The problem is there. pkgconf gives the correct path:

$ pkgconf --cflags json-c
-I/usr/include/json-c

But pkg-config is broken:

$ pkg-config  --cflags json-c
-I/usr/local/include/json-c

Not sure why as in Fedora, pkg-config is a shim layer on top of pkgconf provided by pkgconf-pkg-config package. But I cannot uninstall pkgconf-pkg-config as it is used by gnome-shell.

Looks like something is broken in Fedora Not sure what as /usr/lib64/pkgconfig/json-c.pc is perfectly fine, pointing at /usr/include/json-c.

But I would still say that it is probably time to update to pkgconf :)

#7 lore raw
Quoted 3 lines · Damien Le Moal

Not sure why as in Fedora, pkg-config is a shim layer on top of pkgconf provided by pkgconf-pkg-config package. But I cannot uninstall pkgconf-pkg-config as it is used by gnome-shell.

Didn't know about this new implementation of pkg-config. I found some explenation here:

https://fedoraproject.org/wiki/Changes/pkgconf_as_system_pkg-config_implementation

Quoted 4 lines

Looks like something is broken in Fedora Not sure what as /usr/lib64/pkgconfig/json-c.pc is perfectly fine, pointing at /usr/include/json-c.

But I would still say that it is probably time to update to pkgconf :)

FWIW, you can specify which pkg-config implementation meson should use via the cross ini file. For example here is the one for using clang instead of gcc:

[binaries]
c = 'clang'
cpp = 'clang++'
strip = 'strip'
pkgconfig = 'pkg-config'

https://mesonbuild.com/Cross-compilation.html

#8 lore raw
Quoted 18 lines · Daniel Wagner
Quoted 3 lines · Damien Le Moal

Not sure why as in Fedora, pkg-config is a shim layer on top of pkgconf provided by pkgconf-pkg-config package. But I cannot uninstall pkgconf-pkg-config as it is used by gnome-shell.

Didn't know about this new implementation of pkg-config. I found some explenation here:

https://fedoraproject.org/wiki/Changes/pkgconf_as_system_pkg-config_implementation

Quoted 4 lines

Looks like something is broken in Fedora Not sure what as /usr/lib64/pkgconfig/json-c.pc is perfectly fine, pointing at /usr/include/json-c.

But I would still say that it is probably time to update to pkgconf :)

FWIW, you can specify which pkg-config implementation meson should use via the cross ini file. For example here is the one for using clang instead of gcc:

Quoted 7 lines

[binaries]
c = 'clang'
cpp = 'clang++'
strip = 'strip'
pkgconfig = 'pkg-config'

https://mesonbuild.com/Cross-compilation.html

Replacing 'pkg-config' with 'pkgconf' and reconfiguring+compile still gives the same error. But I think I found the issue: I had a /usr/local/lib64/pkgconfig/json-c.pc file pointing at /usr/local/include/json-c. Not sure how that garbage ended up there. Removing this file and compilation is ok. My apologies for the noise.

#9 lore raw
Quoted 2 lines · Damien Le Moal

Replacing 'pkg-config' with 'pkgconf' and reconfiguring+compile still gives the same error.

Just checked what my local machine uses. It's also pkgconf and there is wrapper around the invocation, similar what Fedora does:

https://src.fedoraproject.org/rpms/pkgconf/blob/rawhide/f/platform-pkg-config.in

I suspect one of those environment variables includes the path the /usr/local/lib/pkgconfig

Quoted 3 lines

But I think I found the issue: I had a /usr/local/lib64/pkgconfig/json-c.pc file pointing at /usr/local/include/json-c. Not sure how that garbage ended up there. Removing this file and compilation is ok.

That's also a solution :)

Quoted 1 line

My apologies for the noise.

All good. I am sure this know-how on pkg-config will be helpful in future :)