All of lore.kernel.org
 help / color / mirror / Atom feed
* nvme-cli & json vs blktests
@ 2025-05-19  5:49 Christoph Hellwig
  2025-05-19  9:51 ` Daniel Wagner
  2025-05-19 11:08 ` Shinichiro Kawasaki
  0 siblings, 2 replies; 8+ messages in thread
From: Christoph Hellwig @ 2025-05-19  5:49 UTC (permalink / raw)
  To: Daniel Wagner, Hannes Reinecke, Chaitanya Kulkarni,
	Shin'ichiro Kawasaki
  Cc: linux-nvme

Hi all,

I recently did a long overdue update of blktests on my main test
machine, and a large part of the nvme tests started failing.  I
eventually bisected this down to:

commit 444f0df9f0c537335f59c1721240212852656e5b
Author: Hannes Reinecke <hare@suse.de>
Date:   Wed Oct 30 15:51:45 2024 +0900

    nvme: check for controller device in _nvme_connect_subsys()


which adds a requirements for json output from nvme connect, and
just silently fails if not present.

Now after figuring this out I went to rebuild my nvme-cli after installing
the json-c development package.

... and nothing changes.

It looks like the nvme-cli build system unfortunately doesn't pick up
changes in available dependencies even after a make clean.  It turns
out a make purge eventually fixed it, but that's a little unexpected.

Can we get proper feature check for json support in blktests and maybe
make the nvme-cli build a little less arcane?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nvme-cli & json vs blktests
  2025-05-19  5:49 nvme-cli & json vs blktests Christoph Hellwig
@ 2025-05-19  9:51 ` Daniel Wagner
  2025-05-19  9:56   ` Christoph Hellwig
  2025-05-19 11:08 ` Shinichiro Kawasaki
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Wagner @ 2025-05-19  9:51 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Daniel Wagner, Hannes Reinecke, Chaitanya Kulkarni,
	Shin'ichiro Kawasaki, linux-nvme

On Mon, May 19, 2025 at 07:49:05AM +0200, Christoph Hellwig wrote:
> make the nvme-cli build a little less arcane?

There is no magic build into the meson/ninja build system. meson creates
the ninja build instruction which are fully hardcoded, thus it wont pick
up any newly installed libraries on automatically. Running meson with
'setup --reconfigure' is a design choice of this build system.

I don't really see a problem with this approach.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nvme-cli & json vs blktests
  2025-05-19  9:51 ` Daniel Wagner
@ 2025-05-19  9:56   ` Christoph Hellwig
  2025-05-19 10:04     ` Daniel Wagner
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2025-05-19  9:56 UTC (permalink / raw)
  To: Daniel Wagner
  Cc: Christoph Hellwig, Daniel Wagner, Hannes Reinecke,
	Chaitanya Kulkarni, Shin'ichiro Kawasaki, linux-nvme

On Mon, May 19, 2025 at 11:51:47AM +0200, Daniel Wagner wrote:
> On Mon, May 19, 2025 at 07:49:05AM +0200, Christoph Hellwig wrote:
> > make the nvme-cli build a little less arcane?
> 
> There is no magic build into the meson/ninja build system. meson creates
> the ninja build instruction which are fully hardcoded, thus it wont pick
> up any newly installed libraries on automatically. Running meson with
> 'setup --reconfigure' is a design choice of this build system.
> 
> I don't really see a problem with this approach.

The fact that a make clean is not clean enough to find newly installed
dependencies is very unusual.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nvme-cli & json vs blktests
  2025-05-19  9:56   ` Christoph Hellwig
@ 2025-05-19 10:04     ` Daniel Wagner
  2025-05-19 23:31       ` Chaitanya Kulkarni
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Wagner @ 2025-05-19 10:04 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Daniel Wagner, Hannes Reinecke, Chaitanya Kulkarni,
	Shin'ichiro Kawasaki, linux-nvme

On Mon, May 19, 2025 at 11:56:42AM +0200, Christoph Hellwig wrote:
> On Mon, May 19, 2025 at 11:51:47AM +0200, Daniel Wagner wrote:
> > On Mon, May 19, 2025 at 07:49:05AM +0200, Christoph Hellwig wrote:
> > > make the nvme-cli build a little less arcane?
> > 
> > There is no magic build into the meson/ninja build system. meson creates
> > the ninja build instruction which are fully hardcoded, thus it wont pick
> > up any newly installed libraries on automatically. Running meson with
> > 'setup --reconfigure' is a design choice of this build system.
> > 
> > I don't really see a problem with this approach.
> 
> The fact that a make clean is not clean enough to find newly installed
> dependencies is very unusual.

Okay, so the Makefile is not really working in your workflow as expected. I see
there are two targets 'clean' and 'purge'. I suppose it would make sense
to model the 'clean' target more what autotools  & co are doing. Really
wiping everything away. Let me fix this.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nvme-cli & json vs blktests
  2025-05-19  5:49 nvme-cli & json vs blktests Christoph Hellwig
  2025-05-19  9:51 ` Daniel Wagner
@ 2025-05-19 11:08 ` Shinichiro Kawasaki
  1 sibling, 0 replies; 8+ messages in thread
From: Shinichiro Kawasaki @ 2025-05-19 11:08 UTC (permalink / raw)
  To: hch
  Cc: Daniel Wagner, Hannes Reinecke, Chaitanya Kulkarni,
	linux-nvme@lists.infradead.org

On May 19, 2025 / 07:49, Christoph Hellwig wrote:
> Hi all,
> 
> I recently did a long overdue update of blktests on my main test
> machine, and a large part of the nvme tests started failing.  I
> eventually bisected this down to:
> 
> commit 444f0df9f0c537335f59c1721240212852656e5b
> Author: Hannes Reinecke <hare@suse.de>
> Date:   Wed Oct 30 15:51:45 2024 +0900
> 
>     nvme: check for controller device in _nvme_connect_subsys()
> 
> 
> which adds a requirements for json output from nvme connect, and
> just silently fails if not present.

I uninstalled json-c-devel package from my Fedora system, and built nvme-cli.
Then confirmed the slient fail. That is a painful pit-fall.

...

> 
> Can we get proper feature check for json support in blktests and maybe
> make the nvme-cli build a little less arcane?

As to blktests, I quickly created a patch below, and confirmed it informs that
nvme-cli is missing json output support. Will do some more testing and post as
a formal patch.

diff --git a/tests/nvme/rc b/tests/nvme/rc
index d86dc13..f5880ed 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -55,7 +55,7 @@ _set_nvmet_blkdev_type() {
 }
 
 _nvme_requires() {
-	_have_program nvme
+	_have_nvme_cli_with_json_support
 	_require_nvme_test_img_size 4m
 	case ${nvme_trtype} in
 	loop)
@@ -626,6 +626,14 @@ _have_systemd_tlshd_service() {
 	fi
 }
 
+_have_nvme_cli_with_json_support() {
+	_have_program nvme || return $?
+
+	if ! nvme list --output-format=json &> /dev/null; then
+		SKIP_REASONS+=("nvme-cli does not support json output format")
+	fi
+}
+
 _have_libnvme_ver() {
 	local ver
 


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: nvme-cli & json vs blktests
  2025-05-19 10:04     ` Daniel Wagner
@ 2025-05-19 23:31       ` Chaitanya Kulkarni
  2025-05-20  7:18         ` Daniel Wagner
  0 siblings, 1 reply; 8+ messages in thread
From: Chaitanya Kulkarni @ 2025-05-19 23:31 UTC (permalink / raw)
  To: Daniel Wagner, Christoph Hellwig
  Cc: Daniel Wagner, Hannes Reinecke, Chaitanya Kulkarni,
	Shin'ichiro Kawasaki, linux-nvme@lists.infradead.org

On 5/19/25 03:04, Daniel Wagner wrote:
> On Mon, May 19, 2025 at 11:56:42AM +0200, Christoph Hellwig wrote:
>> On Mon, May 19, 2025 at 11:51:47AM +0200, Daniel Wagner wrote:
>>> On Mon, May 19, 2025 at 07:49:05AM +0200, Christoph Hellwig wrote:
>>>> make the nvme-cli build a little less arcane?
>>> There is no magic build into the meson/ninja build system. meson creates
>>> the ninja build instruction which are fully hardcoded, thus it wont pick
>>> up any newly installed libraries on automatically. Running meson with
>>> 'setup --reconfigure' is a design choice of this build system.
>>>
>>> I don't really see a problem with this approach.
>> The fact that a make clean is not clean enough to find newly installed
>> dependencies is very unusual.
> Okay, so the Makefile is not really working in your workflow as expected. I see
> there are two targets 'clean' and 'purge'. I suppose it would make sense
> to model the 'clean' target more what autotools  & co are doing. Really
> wiping everything away. Let me fix this.

yes please hope should fix the issue that I'm also seeing from last week.

-ck



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nvme-cli & json vs blktests
  2025-05-19 23:31       ` Chaitanya Kulkarni
@ 2025-05-20  7:18         ` Daniel Wagner
  2025-05-20 13:34           ` Christoph Hellwig
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Wagner @ 2025-05-20  7:18 UTC (permalink / raw)
  To: Chaitanya Kulkarni
  Cc: Christoph Hellwig, Daniel Wagner, Hannes Reinecke,
	Shin'ichiro Kawasaki, linux-nvme@lists.infradead.org

On Mon, May 19, 2025 at 11:31:36PM +0000, Chaitanya Kulkarni wrote:
> > Okay, so the Makefile is not really working in your workflow as expected. I see
> > there are two targets 'clean' and 'purge'. I suppose it would make sense
> > to model the 'clean' target more what autotools  & co are doing. Really
> > wiping everything away. Let me fix this.
> 
> yes please hope should fix the issue that I'm also seeing from last week.

I've updated the Makefile. The 'clean' target is now doing a proper
cleanup and deletes all the build artifacts and configuration files.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nvme-cli & json vs blktests
  2025-05-20  7:18         ` Daniel Wagner
@ 2025-05-20 13:34           ` Christoph Hellwig
  0 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2025-05-20 13:34 UTC (permalink / raw)
  To: Daniel Wagner
  Cc: Chaitanya Kulkarni, Christoph Hellwig, Daniel Wagner,
	Hannes Reinecke, Shin'ichiro Kawasaki,
	linux-nvme@lists.infradead.org

On Tue, May 20, 2025 at 09:18:19AM +0200, Daniel Wagner wrote:
> I've updated the Makefile. The 'clean' target is now doing a proper
> cleanup and deletes all the build artifacts and configuration files.

Thanks!


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-05-20 13:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-19  5:49 nvme-cli & json vs blktests Christoph Hellwig
2025-05-19  9:51 ` Daniel Wagner
2025-05-19  9:56   ` Christoph Hellwig
2025-05-19 10:04     ` Daniel Wagner
2025-05-19 23:31       ` Chaitanya Kulkarni
2025-05-20  7:18         ` Daniel Wagner
2025-05-20 13:34           ` Christoph Hellwig
2025-05-19 11:08 ` Shinichiro Kawasaki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.