summarylogtreecommitdiffstats
path: root/0001-data-packaging-separate-check-and-implicit-build-mak.patch
blob: 42fe78c034fce387ec6e49066d3209d6f7376099 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
From b85fde17641918fb5c3b74d59775626d91a0197c Mon Sep 17 00:00:00 2001
Message-ID: <b85fde17641918fb5c3b74d59775626d91a0197c.1737719176.git.maciej.borzecki@canonical.com>
From: Maciej Borzecki <maciej.borzecki@canonical.com>
Date: Thu, 23 Jan 2025 13:17:24 +0100
Subject: [PATCH] data, packaging: separate check and implicit build makefile
 targets (#14964)

* data: add top level check target, do not run checks implicitly for all

Add a separate check target in the top level Makefile and run check for
data/systemd, which is the only directory where checks are implemented.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* packaging: run checks in data

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* packaging/arch: drop unnecessary trailing /

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

---------

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
---
 data/Makefile                 | 3 +++
 data/systemd/Makefile         | 2 +-
 packaging/arch/PKGBUILD       | 3 ++-
 packaging/fedora/snapd.spec   | 6 +++---
 packaging/opensuse/snapd.spec | 3 ++-
 packaging/ubuntu-14.04/rules  | 4 +++-
 packaging/ubuntu-16.04/rules  | 4 +++-
 7 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/data/Makefile b/data/Makefile
index 7c8c70d59e530a3a6a5fb54b6bbe9222dc918687..7ad423f43144bc3af8aa7d1f7e0c7ea65ec88451 100644
--- a/data/Makefile
+++ b/data/Makefile
@@ -7,3 +7,6 @@ all install clean:
 	$(MAKE) -C env $@
 	$(MAKE) -C desktop $@
 	$(MAKE) -C polkit $@
+
+check:
+	$(MAKE) -C systemd $@
diff --git a/data/systemd/Makefile b/data/systemd/Makefile
index d405ab3a1ce81b5d1e8ba89a56c6aa3245783997..86f2f352214fd999c2112207494d1db73f38db78 100644
--- a/data/systemd/Makefile
+++ b/data/systemd/Makefile
@@ -27,7 +27,7 @@ SYSTEMD_UNITS_GENERATED := $(wildcard *.in)
 SYSTEMD_UNITS = $(sort $(SYSTEMD_UNITS_GENERATED:.in=) $(wildcard *.service) $(wildcard *.timer) $(wildcard *.socket) $(wildcard *.target))
 
 .PHONY: all
-all: $(SYSTEMD_UNITS) check
+all: $(SYSTEMD_UNITS)
 
 .PHONY: check
 check: snapd.run-from-snap snapd.core-fixup.sh
diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD
index 78873953a3c651071172cef74d7e8df08af5fcaa..e9ea035a4f868d5824f83c98d1206bbc77770ecf 100644
--- a/packaging/arch/PKGBUILD
+++ b/packaging/arch/PKGBUILD
@@ -116,6 +116,7 @@ check() {
   # done, not after building the tree.
   # ./run-checks --static
   TMPDIR=/tmp make -C cmd -k check
+  TMPDIR=/tmp make -C data -k check
 }
 
 package() {
@@ -133,7 +134,7 @@ package() {
     "$pkgdir/usr/share/zsh/site-functions/_snap"
 
   # Install systemd units, dbus services and a script for environment variables
-  make -C data/ install \
+  make -C data install \
      DBUSSERVICESDIR=/usr/share/dbus-1/services \
      BINDIR=/usr/bin \
      SYSTEMDSYSTEMUNITDIR=/usr/lib/systemd/system \
diff --git a/packaging/fedora/snapd.spec b/packaging/fedora/snapd.spec
index 2326b43b13a116f30432753957e06705eae06ed4..d765372911f362a7642137012dbfcab6b7ba3082 100644
--- a/packaging/fedora/snapd.spec
+++ b/packaging/fedora/snapd.spec
@@ -801,9 +801,9 @@ export GO111MODULE=off
 %endif
 
 # snap-confine tests (these always run!)
-pushd ./cmd
-make check
-popd
+make -C cmd -k check
+# and data files
+make -C data -k check
 
 %files
 #define license tag if not already defined
diff --git a/packaging/opensuse/snapd.spec b/packaging/opensuse/snapd.spec
index 78155a0582b88ed4c5b0547d8241cc1935c5bf8f..3c3b3fef45686e45e5b03555e1cf4d53537af8e6 100644
--- a/packaging/opensuse/snapd.spec
+++ b/packaging/opensuse/snapd.spec
@@ -267,7 +267,8 @@ for binary in snap-exec snap-update-ns snapctl; do
     ldd $binary 2>&1 | grep 'not a dynamic executable'
 done
 
-%make_build -C %{indigo_srcdir}/cmd check
+%make_build -C %{indigo_srcdir}/cmd -k check
+%make_build -C %{indigo_srcdir}/data -k check
 # Use the common packaging helper for testing.
 %make_build -C %{indigo_srcdir} -f %{indigo_srcdir}/packaging/snapd.mk \
             GOPATH=%{indigo_gopath}:$GOPATH SNAPD_DEFINES_DIR=%{_builddir} \
diff --git a/packaging/ubuntu-14.04/rules b/packaging/ubuntu-14.04/rules
index 27c79d21402cdb2a6f9cda9e3ee669817cfc2cd2..b7896daa4c07f1a387ff04bf515feccfc4150cd1 100755
--- a/packaging/ubuntu-14.04/rules
+++ b/packaging/ubuntu-14.04/rules
@@ -169,7 +169,9 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 endif
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 	# run the snap-confine tests
-	$(MAKE) -C cmd check
+	$(MAKE) -C cmd -k check
+	# and data files tests
+	$(MAKE) -C data -k check
 endif
 
 override_dh_install:
diff --git a/packaging/ubuntu-16.04/rules b/packaging/ubuntu-16.04/rules
index 8043be3a64b3b5b0a911fdc5fb48ab81fe5fd64e..ea874f5aee96980cefa37c54e297d866b11f43f3 100755
--- a/packaging/ubuntu-16.04/rules
+++ b/packaging/ubuntu-16.04/rules
@@ -289,7 +289,9 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 endif
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 	# run the snap-confine tests
-	$(MAKE) -C cmd check
+	$(MAKE) -C cmd -k check
+	# and data files tests
+	$(MAKE) -C data -k check
 endif
 
 
-- 
2.48.1