* [PATCH net-next v2 1/2] selftests: net: rebuild YNL if dependencies changed
@ 2024-10-11 23:03 Jakub Kicinski
2024-10-11 23:03 ` [PATCH net-next v2 2/2] selftests: net: move EXTRA_CLEAN of libynl.a into ynl.mk Jakub Kicinski
2024-10-15 1:10 ` [PATCH net-next v2 1/2] selftests: net: rebuild YNL if dependencies changed patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Jakub Kicinski @ 2024-10-11 23:03 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, donald.hunter, Jakub Kicinski,
Stanislav Fomichev
Try to rebuild YNL if either user added a new family or the specs
of the families have changed. Stanislav's ncdevmem cause a false
positive build failure in NIPA because libynl.a isn't rebuilt
after ethtool is added to YNL_GENS.
Note that sha1sum is already used in other parts of the build system.
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
v2:
- use .libynl-$hash.sig as the name to avoid having to add to gitignore
v1: https://lore.kernel.org/20241010220826.2215358-1-kuba@kernel.org
---
tools/testing/selftests/net/ynl.mk | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/ynl.mk b/tools/testing/selftests/net/ynl.mk
index 1ef24119def0..add5c0cdeac4 100644
--- a/tools/testing/selftests/net/ynl.mk
+++ b/tools/testing/selftests/net/ynl.mk
@@ -9,6 +9,8 @@
# YNL_GEN_FILES: TEST_GEN_FILES which need YNL
YNL_OUTPUTS := $(patsubst %,$(OUTPUT)/%,$(YNL_GEN_FILES))
+YNL_SPECS := \
+ $(patsubst %,$(top_srcdir)/Documentation/netlink/specs/%.yaml,$(YNL_GENS))
$(YNL_OUTPUTS): $(OUTPUT)/libynl.a
$(YNL_OUTPUTS): CFLAGS += \
@@ -16,10 +18,19 @@ $(YNL_OUTPUTS): CFLAGS += \
-I$(top_srcdir)/tools/net/ynl/lib/ \
-I$(top_srcdir)/tools/net/ynl/generated/
-$(OUTPUT)/libynl.a:
+# Make sure we rebuild libynl if user added a new family. We can't easily
+# depend on the contents of a variable so create a fake file with a hash.
+YNL_GENS_HASH := $(shell echo $(YNL_GENS) | sha1sum | cut -c1-8)
+$(OUTPUT)/.libynl-$(YNL_GENS_HASH).sig:
+ $(Q)rm -f $(OUTPUT)/.libynl-*.sig
+ $(Q)touch $(OUTPUT)/.libynl-$(YNL_GENS_HASH).sig
+
+$(OUTPUT)/libynl.a: $(YNL_SPECS) $(OUTPUT)/.libynl-$(YNL_GENS_HASH).sig
+ $(Q)rm -f $(top_srcdir)/tools/net/ynl/libynl.a
$(Q)$(MAKE) -C $(top_srcdir)/tools/net/ynl GENS="$(YNL_GENS)" libynl.a
$(Q)cp $(top_srcdir)/tools/net/ynl/libynl.a $(OUTPUT)/libynl.a
EXTRA_CLEAN += \
$(top_srcdir)/tools/net/ynl/lib/__pycache__ \
- $(top_srcdir)/tools/net/ynl/lib/*.[ado]
+ $(top_srcdir)/tools/net/ynl/lib/*.[ado] \
+ $(OUTPUT)/.libynl-*.sig
--
2.46.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next v2 2/2] selftests: net: move EXTRA_CLEAN of libynl.a into ynl.mk
2024-10-11 23:03 [PATCH net-next v2 1/2] selftests: net: rebuild YNL if dependencies changed Jakub Kicinski
@ 2024-10-11 23:03 ` Jakub Kicinski
2024-10-11 23:29 ` Stanislav Fomichev
2024-10-15 1:10 ` [PATCH net-next v2 1/2] selftests: net: rebuild YNL if dependencies changed patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2024-10-11 23:03 UTC (permalink / raw)
To: davem; +Cc: netdev, edumazet, pabeni, donald.hunter, Jakub Kicinski
Commit 1fd9e4f25782 ("selftests: make kselftest-clean remove libynl outputs")
added EXTRA_CLEAN of YNL generated files to ynl.mk. We already had
a EXTRA_CLEAN in the file including the snippet. Consolidate them.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--
v2:
- new patch
---
tools/testing/selftests/net/Makefile | 1 -
tools/testing/selftests/net/ynl.mk | 3 ++-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index 649f1fe0dc46..26a4883a65c9 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -98,7 +98,6 @@ TEST_PROGS += vlan_hw_filter.sh
TEST_PROGS += bpf_offload.py
# YNL files, must be before "include ..lib.mk"
-EXTRA_CLEAN += $(OUTPUT)/libynl.a
YNL_GEN_FILES := ncdevmem
TEST_GEN_FILES += $(YNL_GEN_FILES)
diff --git a/tools/testing/selftests/net/ynl.mk b/tools/testing/selftests/net/ynl.mk
index add5c0cdeac4..d43afe243779 100644
--- a/tools/testing/selftests/net/ynl.mk
+++ b/tools/testing/selftests/net/ynl.mk
@@ -33,4 +33,5 @@ $(OUTPUT)/libynl.a: $(YNL_SPECS) $(OUTPUT)/.libynl-$(YNL_GENS_HASH).sig
EXTRA_CLEAN += \
$(top_srcdir)/tools/net/ynl/lib/__pycache__ \
$(top_srcdir)/tools/net/ynl/lib/*.[ado] \
- $(OUTPUT)/.libynl-*.sig
+ $(OUTPUT)/.libynl-*.sig \
+ $(OUTPUT)/libynl.a
--
2.46.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH net-next v2 1/2] selftests: net: rebuild YNL if dependencies changed
2024-10-11 23:03 [PATCH net-next v2 1/2] selftests: net: rebuild YNL if dependencies changed Jakub Kicinski
2024-10-11 23:03 ` [PATCH net-next v2 2/2] selftests: net: move EXTRA_CLEAN of libynl.a into ynl.mk Jakub Kicinski
@ 2024-10-15 1:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-15 1:10 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, donald.hunter, sdf
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 11 Oct 2024 16:03:10 -0700 you wrote:
> Try to rebuild YNL if either user added a new family or the specs
> of the families have changed. Stanislav's ncdevmem cause a false
> positive build failure in NIPA because libynl.a isn't rebuilt
> after ethtool is added to YNL_GENS.
>
> Note that sha1sum is already used in other parts of the build system.
>
> [...]
Here is the summary with links:
- [net-next,v2,1/2] selftests: net: rebuild YNL if dependencies changed
https://git.kernel.org/netdev/net-next/c/0cb06dc6c42b
- [net-next,v2,2/2] selftests: net: move EXTRA_CLEAN of libynl.a into ynl.mk
https://git.kernel.org/netdev/net-next/c/60b4d49b9621
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-15 1:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11 23:03 [PATCH net-next v2 1/2] selftests: net: rebuild YNL if dependencies changed Jakub Kicinski
2024-10-11 23:03 ` [PATCH net-next v2 2/2] selftests: net: move EXTRA_CLEAN of libynl.a into ynl.mk Jakub Kicinski
2024-10-11 23:29 ` Stanislav Fomichev
2024-10-15 1:10 ` [PATCH net-next v2 1/2] selftests: net: rebuild YNL if dependencies changed patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).