Skip to content

Commit 099c5dd

Browse files
hgy59mreid-tt
andauthored
Update noarch build (#6250)
* redesign build of noarch packages - noarch packages should only be build for specific TCVERSION, otherwise REQUIRED_MIN_DSM is not evaluated - noarch packages must now define `override ARCH=noarch` instead of `override ARCH=` - add all noarch packages to build-matrix * Fix for non interactive workflow * add variables to define defaults for noarch/arch packages in automated builds * rename github job "Generate Matrix" * update all noarch packages * add dsm72 to matrix in automated builds when package requires it * add targets to call make noarch-{TCVERSION} - introduced to have build log files for noarch packages * declare python2 dependent packages as broken * set adminer as default package for interactive builds * syno-magnet: fix github build - SPK_NAME must not use variable --------- Co-authored-by: mreid-tt <943378+mreid-tt@users.noreply.github.com>
1 parent 0d6280e commit 099c5dd

File tree

49 files changed

+213
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+213
-111
lines changed

.github/actions/prepare.sh

+25-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ for i in {5..7}; do
5959
ffmpeg_dependent_packages=$(find spk/ -maxdepth 2 -mindepth 2 -name "Makefile" -exec grep -Ho "FFMPEG_PACKAGE = ffmpeg${i}" {} \; | grep -Po ".*spk/\K[^/]*" | sort | tr '\n' ' ')
6060

6161
# If packages contain a package that depends on ffmpeg (or is ffmpeg),
62-
# then ensure relevant ffmpeg5|ffmpeg6 is first in list
62+
# then ensure relevant ffmpeg spk is first in list
6363
for package in ${packages}
6464
do
6565
if [ "$(echo ffmpeg${i} ${ffmpeg_dependent_packages} | grep -ow ${package})" != "" ]; then
@@ -107,19 +107,43 @@ all_noarch=$(find spk/ -maxdepth 2 -mindepth 2 -name "Makefile" -exec grep -Ho "
107107
# and filter out packages that are removed or do not exist (e.g. nzbdrone)
108108
arch_packages=
109109
noarch_packages=
110+
has_arch_packages='false'
111+
has_noarch_packages='false'
110112
for package in ${packages}
111113
do
112114
if [ -f "./spk/${package}/Makefile" ]; then
113115
if [ "$(echo ${all_noarch} | grep -ow ${package})" = "" ]; then
114116
arch_packages+="${package} "
117+
has_arch_packages='true'
115118
else
116119
noarch_packages+="${package} "
120+
has_noarch_packages='true'
117121
fi
118122
fi
119123
done
120124

125+
# evaluate packages that require DSM 7.2
126+
min_dsm72_packages=
127+
has_min_dsm72_packages='false'
128+
for package in ${packages}
129+
do
130+
if [ -f "./spk/${package}/Makefile" ]; then
131+
if [ "$(grep REQUIRED_MIN_DSM ./spk/${package}/Makefile | cut -d= -f2 | xargs)" = "7.2" ]; then
132+
min_dsm72_packages+="${package} "
133+
has_min_dsm72_packages='true'
134+
fi
135+
fi
136+
done
137+
138+
if [ "${has_min_dsm72_packages}" = "true" ]; then
139+
echo "===> Min DSM 7.2 packages found: ${min_dsm72_packages}"
140+
fi
141+
121142
echo "arch_packages=${arch_packages}" >> $GITHUB_OUTPUT
122143
echo "noarch_packages=${noarch_packages}" >> $GITHUB_OUTPUT
144+
echo "has_arch_packages=${has_arch_packages}" >> $GITHUB_OUTPUT
145+
echo "has_noarch_packages=${has_noarch_packages}" >> $GITHUB_OUTPUT
146+
echo "has_min_dsm72_packages=${has_min_dsm72_packages}" >> $GITHUB_OUTPUT
123147

124148
echo "::endgroup::"
125149

.github/workflows/build.yml

+60-24
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
package:
77
description: 'Package to build'
88
required: true
9-
default: 'syno-magnet'
9+
default: 'adminer'
1010
publish:
1111
description: 'Publish to repository'
1212
required: false
@@ -15,6 +15,14 @@ on:
1515
options:
1616
- 'true'
1717
- 'false'
18+
add_noarch_builds:
19+
description: 'Include noarch packages'
20+
required: false
21+
default: 'true'
22+
type: choice
23+
options:
24+
- 'true'
25+
- 'false'
1826
add_dsm72_builds:
1927
description: 'Include DSM 7.2 archs'
2028
required: false
@@ -76,6 +84,12 @@ jobs:
7684
outputs:
7785
arch_packages: ${{ steps.dependencies.outputs.arch_packages }}
7886
noarch_packages: ${{ steps.dependencies.outputs.noarch_packages }}
87+
add_noarch_builds: ${{ steps.set-defaults.outputs.add_noarch_builds }}
88+
add_dsm72_builds: ${{ steps.set-defaults.outputs.add_dsm72_builds }}
89+
add_dsm71_builds: ${{ steps.set-defaults.outputs.add_dsm71_builds }}
90+
add_dsm62_builds: ${{ steps.set-defaults.outputs.add_dsm62_builds }}
91+
add_dsm52_builds: ${{ steps.set-defaults.outputs.add_dsm52_builds }}
92+
add_srm12_builds: ${{ steps.set-defaults.outputs.add_srm12_builds }}
7993
steps:
8094
- name: Checkout repository
8195
uses: actions/checkout@v4
@@ -104,6 +118,17 @@ jobs:
104118
GH_FILES: ${{ steps.getfile.outputs.files }} ${{ steps.getfile_pr.outputs.files }}
105119
SPK_TO_BUILD: ${{ github.event.inputs.package }}
106120

121+
# Set default values for all builds (manual or automated)
122+
- name: Set default values for generate matrix
123+
id: set-defaults
124+
run: |
125+
echo "add_noarch_builds=${{ github.event.inputs.add_noarch_builds || steps.dependencies.outputs.has_noarch_packages }}" >> $GITHUB_OUTPUT
126+
echo "add_dsm72_builds=${{ github.event.inputs.add_dsm72_builds || steps.dependencies.outputs.has_min_dsm72_packages }}" >> $GITHUB_OUTPUT
127+
echo "add_dsm71_builds=${{ github.event.inputs.add_dsm71_builds || steps.dependencies.outputs.has_arch_packages }}" >> $GITHUB_OUTPUT
128+
echo "add_dsm62_builds=${{ github.event.inputs.add_dsm62_builds || steps.dependencies.outputs.has_arch_packages }}" >> $GITHUB_OUTPUT
129+
echo "add_dsm52_builds=${{ github.event.inputs.add_dsm52_builds || 'false' }}" >> $GITHUB_OUTPUT
130+
echo "add_srm12_builds=${{ github.event.inputs.add_srm12_builds || 'false' }}" >> $GITHUB_OUTPUT
131+
107132
- name: Cache downloaded files
108133
uses: actions/cache@v4
109134
with:
@@ -119,26 +144,43 @@ jobs:
119144
NOARCH_PACKAGES: ${{ needs.prepare.outputs.noarch_packages }}
120145

121146
generate_matrix:
122-
name: Prepare Architectures
147+
name: Generate Matrix
148+
needs: prepare
123149
runs-on: ubuntu-latest
124150
outputs:
125151
matrix: ${{ steps.set-matrix.outputs.matrix }}
126152
steps:
127153
- id: set-matrix
128154
run: |
129-
# Start with the noarch architectures at the top
130-
matrix='{"include": ['
131-
matrix+='{"arch": "noarch"},'
132-
matrix+='{"arch": "noarch-6.1"},'
133-
matrix+='{"arch": "noarch-7.0"},'
155+
# Use the default values passed from the prepare step
156+
add_noarch_builds=${{ needs.prepare.outputs.add_noarch_builds }}
157+
add_dsm72_builds=${{ needs.prepare.outputs.add_dsm72_builds }}
158+
add_dsm71_builds=${{ needs.prepare.outputs.add_dsm71_builds }}
159+
add_dsm62_builds=${{ needs.prepare.outputs.add_dsm62_builds }}
160+
add_dsm52_builds=${{ needs.prepare.outputs.add_dsm52_builds }}
161+
add_srm12_builds=${{ needs.prepare.outputs.add_srm12_builds }}
134162
135-
# Add other architectures based on input flags
136-
if [ "${{ github.event.inputs.add_dsm52_builds }}" == "true" ]; then
137-
matrix+='{"arch": "x86-5.2"},'
138-
matrix+='{"arch": "88f6281-5.2"},'
139-
matrix+='{"arch": "ppc853x-5.2"},'
163+
# Create matrix as a JSON object
164+
matrix='{"include": ['
165+
166+
if [ "$add_noarch_builds" == "true" ]; then
167+
matrix+='{"arch": "noarch-1.1"},'
168+
matrix+='{"arch": "noarch-3.1"},'
169+
matrix+='{"arch": "noarch-6.1"},'
170+
matrix+='{"arch": "noarch-7.0"},'
140171
fi
141-
if [ "${{ github.event.inputs.add_dsm62_builds }}" == "true" ]; then
172+
if [ "$add_dsm72_builds" == "true" ]; then
173+
matrix+='{"arch": "x64-7.2"},'
174+
matrix+='{"arch": "aarch64-7.2"},'
175+
fi
176+
if [ "$add_dsm71_builds" == "true" ]; then
177+
matrix+='{"arch": "x64-7.1"},'
178+
matrix+='{"arch": "aarch64-7.1"},'
179+
matrix+='{"arch": "evansport-7.1"},'
180+
matrix+='{"arch": "armv7-7.1"},'
181+
matrix+='{"arch": "comcerto2k-7.1"},'
182+
fi
183+
if [ "$add_dsm62_builds" == "true" ]; then
142184
matrix+='{"arch": "x64-6.2.4"},'
143185
matrix+='{"arch": "aarch64-6.2.4"},'
144186
matrix+='{"arch": "evansport-6.2.4"},'
@@ -147,18 +189,12 @@ jobs:
147189
matrix+='{"arch": "88f6281-6.2.4"},'
148190
matrix+='{"arch": "qoriq-6.2.4"},'
149191
fi
150-
if [ "${{ github.event.inputs.add_dsm71_builds }}" == "true" ]; then
151-
matrix+='{"arch": "x64-7.1"},'
152-
matrix+='{"arch": "aarch64-7.1"},'
153-
matrix+='{"arch": "evansport-7.1"},'
154-
matrix+='{"arch": "armv7-7.1"},'
155-
matrix+='{"arch": "comcerto2k-7.1"},'
156-
fi
157-
if [ "${{ github.event.inputs.add_dsm72_builds }}" == "true" ]; then
158-
matrix+='{"arch": "x64-7.2"},'
159-
matrix+='{"arch": "aarch64-7.2"},'
192+
if [ "$add_dsm52_builds" == "true" ]; then
193+
matrix+='{"arch": "x86-5.2"},'
194+
matrix+='{"arch": "88f6281-5.2"},'
195+
matrix+='{"arch": "ppc853x-5.2"},'
160196
fi
161-
if [ "${{ github.event.inputs.add_srm12_builds }}" == "true" ]; then
197+
if [ "$add_srm12_builds" == "true" ]; then
162198
matrix+='{"arch": "armv7-1.2"},'
163199
fi
164200

mk/spksrc.cross-cc.mk

+2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ DIST_FILE = $(DISTRIB_DIR)/$(LOCAL_FILE)
1818
DIST_EXT = $(PKG_EXT)
1919

2020
ifneq ($(ARCH),)
21+
ifneq ($(ARCH),noarch)
2122
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
2223
TC = syno$(ARCH_SUFFIX)
2324
endif
25+
endif
2426

2527
#####
2628

mk/spksrc.cross-cmake.mk

+2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ DIST_FILE = $(DISTRIB_DIR)/$(LOCAL_FILE)
2727
DIST_EXT = $(PKG_EXT)
2828

2929
ifneq ($(ARCH),)
30+
ifneq ($(ARCH),noarch)
3031
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
3132
TC = syno$(ARCH_SUFFIX)
3233
endif
34+
endif
3335

3436
###
3537

mk/spksrc.cross-dotnet.mk

+2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ DIST_FILE = $(DISTRIB_DIR)/$(LOCAL_FILE)
3030
DIST_EXT = $(PKG_EXT)
3131

3232
ifneq ($(ARCH),)
33+
ifneq ($(ARCH),noarch)
3334
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
3435
TC = syno$(ARCH_SUFFIX)
3536
endif
37+
endif
3638

3739
##### dotnet specific configurations
3840
include ../../mk/spksrc.cross-dotnet-env.mk

mk/spksrc.cross-go.mk

+2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ DIST_FILE = $(DISTRIB_DIR)/$(LOCAL_FILE)
2727
DIST_EXT = $(PKG_EXT)
2828

2929
ifneq ($(ARCH),)
30+
ifneq ($(ARCH),noarch)
3031
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
3132
TC = syno$(ARCH_SUFFIX)
3233
endif
34+
endif
3335

3436
##### golang specific configurations
3537
include ../../mk/spksrc.cross-go-env.mk

mk/spksrc.cross-rust-env.mk

+2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ endif
2323
# When calling directly from toolchain/syno-<arch>-<version>
2424
# ARCH variable is still unset thus using $(TC_ARCH) although
2525
# in generic archs we must rely on $(TC_NANE)
26+
ifneq ($(ARCH),noarch)
2627
RUST_ARCH = $(or $(ARCH),$(lastword $(subst -, ,$(TC_NAME))),$(TC_ARCH))
28+
endif
2729

2830
# When building toolchain Tier-3 arch support
2931
# While stage-2 is the truly current compiler, stage-1 suffice our needs

mk/spksrc.cross-rust.mk

+2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ DIST_FILE = $(DISTRIB_DIR)/$(LOCAL_FILE)
2626
DIST_EXT = $(PKG_EXT)
2727

2828
ifneq ($(ARCH),)
29+
ifneq ($(ARCH),noarch)
2930
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
3031
TC = syno$(ARCH_SUFFIX)
3132
endif
33+
endif
3234

3335
##### rust specific configurations
3436
include ../../mk/spksrc.cross-rust-env.mk

mk/spksrc.install-resources.mk

+2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ DIST_FILE = $(DISTRIB_DIR)/$(LOCAL_FILE)
2222
DIST_EXT = $(PKG_EXT)
2323

2424
ifneq ($(ARCH),)
25+
ifneq ($(ARCH),noarch)
2526
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
2627
TC = syno$(ARCH_SUFFIX)
2728
endif
29+
endif
2830

2931

3032
#####

mk/spksrc.main-depends.mk

+2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ NAME = $(PKG_NAME)
1010
COOKIE_PREFIX = $(PKG_NAME)-
1111

1212
ifneq ($(ARCH),)
13+
ifneq ($(ARCH),noarch)
1314
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
1415
TC = syno$(ARCH_SUFFIX)
1516
endif
17+
endif
1618

1719
#####
1820

mk/spksrc.spk.mk

+16-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Most of the rules are imported from spksrc.*.mk files
33
#
44
# Variables:
5-
# ARCH A dedicated arch, a generic arch or empty for arch independent packages
5+
# ARCH A dedicated arch, a generic arch or 'noarch' for arch independent packages
66
# SPK_NAME Package name
77
# MAINTAINER Package maintainer (mandatory)
88
# MAINTAINER_URL URL of package maintainer (optional when MAINTAINER is a valid github user)
@@ -34,6 +34,7 @@ include ../../mk/spksrc.directories.mk
3434
NAME = $(SPK_NAME)
3535

3636
ifneq ($(ARCH),)
37+
ifneq ($(ARCH),noarch)
3738
# arch specific packages
3839
ifneq ($(SPK_PACKAGE_ARCHS),)
3940
SPK_ARCH = $(SPK_PACKAGE_ARCHS)
@@ -50,11 +51,14 @@ endif
5051
SPK_TCVERS = $(TCVERSION)
5152
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
5253
TC = syno$(ARCH_SUFFIX)
53-
else
54+
endif
55+
endif
56+
57+
ifeq ($(ARCH),noarch)
58+
ifneq ($(strip $(TCVERSION)),)
5459
# different noarch packages
5560
SPK_ARCH = noarch
5661
SPK_NAME_ARCH = noarch
57-
ifneq ($(strip $(TCVERSION)),)
5862
ifeq ($(call version_ge, $(TCVERSION), 7.0),1)
5963
SPK_TCVERS = dsm7
6064
TC_OS_MIN_VER = 7.0-40000
@@ -68,12 +72,9 @@ else
6872
SPK_TCVERS = srm
6973
TC_OS_MIN_VER = 1.1-6931
7074
endif
71-
else
72-
SPK_TCVERS = all
73-
TC_OS_MIN_VER = 3.1-1594
74-
endif
7575
ARCH_SUFFIX = -$(SPK_TCVERS)
7676
endif
77+
endif
7778

7879
ifeq ($(call version_lt, ${TC_OS_MIN_VER}, 6.1)$(call version_ge, ${TC_OS_MIN_VER}, 3.0),11)
7980
OS_MIN_VER = $(TC_OS_MIN_VER)
@@ -157,9 +158,14 @@ $(WORK_DIR)/INFO:
157158
$(create_target_dir)
158159
@$(MSG) "Creating INFO file for $(SPK_NAME)"
159160
@if [ -z "$(SPK_ARCH)" ]; then \
160-
echo "ERROR: Arch '$(ARCH)' is not a supported architecture" ; \
161-
echo " - There is no remaining arch in '$(TC_ARCH)' for unsupported archs '$(UNSUPPORTED_ARCHS)'"; \
162-
exit 1; \
161+
if [ "$(ARCH)" = "noarch" ]; then \
162+
echo "ERROR: 'noarch' package without TCVERSION is not supported" ; \
163+
exit 1; \
164+
else \
165+
echo "ERROR: Arch '$(ARCH)' is not a supported architecture" ; \
166+
echo " - There is no remaining arch in '$(TC_ARCH)' for unsupported archs '$(UNSUPPORTED_ARCHS)'"; \
167+
exit 1; \
168+
fi; \
163169
fi
164170
@echo package=\"$(SPK_NAME)\" > $@
165171
@echo version=\"$(SPK_VERS)-$(SPK_REV)\" >> $@

mk/spksrc.supported.mk

+11
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ $(TARGET_TYPE)-arch-% &: pre-build-native
6262
arch-%:
6363
$(PSTAT_TIME) $(MAKE) $(addprefix build-arch-, $(or $(filter $(addprefix %, $(DEFAULT_TC)), $(filter %$(word 2,$(subst -, ,$*)), $(filter $(firstword $(subst -, ,$*))%, $(AVAILABLE_TOOLCHAINS)))),$*)) | tee --append build-$*.log
6464

65+
noarch-%:
66+
$(PSTAT_TIME) $(MAKE) $(addprefix build-noarch-, $(filter $*, $(AVAILABLE_TCVERSIONS) 3.1)) | tee --append build-$@.log
67+
6568
####
6669

6770
build-arch-%: SHELL:=/bin/bash
@@ -73,4 +76,12 @@ build-arch-%:
7376
$(MSG) $$(date +%Y%m%d-%H%M%S) MAKELEVEL: $(MAKELEVEL), PARALLEL_MAKE: $(PARALLEL_MAKE), ARCH: $*, NAME: $(NAME) [END] >> $(PSTAT_LOG) ; \
7477
[ $${status[0]} -eq 0 ] || false
7578

79+
build-noarch-%: SHELL:=/bin/bash
80+
build-noarch-%:
81+
@$(MSG) BUILDING noarch package for TCVERSION $*
82+
@MAKEFLAGS= $(MAKE) TCVERSION=$* 2>&1 ; \
83+
status=$${PIPESTATUS[0]} ; \
84+
$(MSG) $$(date +%Y%m%d-%H%M%S) MAKELEVEL: $(MAKELEVEL), PARALLEL_MAKE: $(PARALLEL_MAKE), TCVERSION: $*, NAME: $(NAME) [END] >> $(PSTAT_LOG) ; \
85+
[ $${status[0]} -eq 0 ] || false
86+
7687
####

spk/adminer/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ WIZARDS_DIR = src/wizard/
4040

4141
POST_STRIP_TARGET = adminer_extra_install
4242

43-
# Pure PHP package, make sure ARCH is not defined
44-
override ARCH=
43+
# Pure PHP package, make sure ARCH is noarch
44+
override ARCH=noarch
4545

4646
include ../../mk/spksrc.spk.mk
4747

spk/ariang/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ LICENSE = MIT
1919
CONF_DIR = src/conf
2020
STARTABLE = no
2121

22-
# Pure PHP package, make sure ARCH is not defined
23-
override ARCH=
22+
# Pure PHP package, make sure ARCH is noarch
23+
override ARCH=noarch
2424

2525
include ../../mk/spksrc.spk.mk

0 commit comments

Comments
 (0)