Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
# lockstep, so it is resolved per architecture.
anchors='{'
sep=''
for arch in amd64 arm64 armv7 loong64 riscv64 ppc ppc64 ppc64le; do
for arch in amd64 arm64 armv7 loong64 riscv64; do
anchor="$(scripts/resolve-anchor "$arch")"
anchors="${anchors}${sep}\"${arch}\":\"${anchor}\""
sep=','
Expand Down Expand Up @@ -205,15 +205,15 @@ jobs:
# every other port: the core equivalent is named base, there is no
# extra, and `any` architecture packages are in a second database.
# HISTORY/powerpc.md has the measurements.
- docker_arch: ppc
platform: linux/ppc
runner: ubuntu-latest
- docker_arch: ppc64
platform: linux/ppc64
runner: ubuntu-latest
- docker_arch: ppc64le
platform: linux/ppc64le
runner: ubuntu-latest
# - docker_arch: ppc
# platform: linux/ppc
# runner: ubuntu-latest
# - docker_arch: ppc64
# platform: linux/ppc64
# runner: ubuntu-latest
# - docker_arch: ppc64le
# platform: linux/ppc64le
# runner: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -456,7 +456,7 @@ jobs:
if [ "$PUBLISH_HUB" = "true" ]; then
images+=("$HUB_TARGET")
fi
for arch in amd64 arm64 armv7 loong64 riscv64 ppc ppc64 ppc64le; do
for arch in amd64 arm64 armv7 loong64 riscv64; do
digest_file="/tmp/digests/$arch"
if [ ! -s "$digest_file" ]; then
echo "no digest for $arch, refusing to tag a partial release" >&2
Expand Down Expand Up @@ -487,7 +487,7 @@ jobs:
images+=("$HUB_TARGET")
fi
sources=()
for arch in amd64 arm64 armv7 loong64 riscv64 ppc ppc64 ppc64le; do
for arch in amd64 arm64 armv7 loong64 riscv64; do
sources+=("$TARGET_IMAGE@$(cat "/tmp/digests/$arch")")
done
mapfile -t tags < <(scripts/tag-names index "$VERSION" "${images[@]}")
Expand Down Expand Up @@ -532,7 +532,7 @@ jobs:
# armv7 renders as arm/v7. A bare match on arm would also match
# arm64, so the assertion would pass with armv7 missing and mean
# nothing.
for expect in amd64 arm64 loong64 riscv64 ppc ppc64 ppc64le arm/v7; do
for expect in amd64 arm64 loong64 riscv64 arm/v7; do
if ! grep -qw -- "$expect" <<< "$got"; then
echo "the index for $dated is missing $expect" >&2
echo "it carries: $got" >&2
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/freshness-keyring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ jobs:
# exercises it. ppc64le is the one chosen because it is the only
# PowerPC target the standard QEMU setup already covers, so this job
# needs no emulator registration of its own.
- keyring: archpower
pin: bootstrap/keyrings/archpower.pin
docker_arch: ppc64le
platform: linux/ppc64le
# - keyring: archpower
# pin: bootstrap/keyrings/archpower.pin
# docker_arch: ppc64le
# platform: linux/ppc64le
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pacman-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ jobs:
- armv7
- loong64
- riscv64
- ppc
- ppc64
- ppc64le
# - ppc
# - ppc64
# - ppc64le
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ jobs:
platform: linux/loong64
- docker_arch: riscv64
platform: linux/riscv64
- docker_arch: ppc
platform: linux/ppc
- docker_arch: ppc64
platform: linux/ppc64
- docker_arch: ppc64le
platform: linux/ppc64le
# - docker_arch: ppc
# platform: linux/ppc
# - docker_arch: ppc64
# platform: linux/ppc64
# - docker_arch: ppc64le
# platform: linux/ppc64le
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
2 changes: 1 addition & 1 deletion scripts/gen-manifest
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ while read -r docker_arch; do
"$REPO_ROOT/scripts/tag-names" aliases "$docker_arch" | tr ' ' '\n' | awk -v a="$docker_arch" 'NF { print $0 "\t" a }' \
>> "$work/aliases.txt"
done <<< "$(awk '
/^[[:space:]]*-[[:space:]]+docker_arch:/ {
/^[[:space:]]*#?[[:space:]]*-[[:space:]]+docker_arch:/ {
s = $0
sub(/^[^:]*:[[:space:]]*/, "", s)
sub(/[[:space:]]*$/, "", s)
Expand Down
12 changes: 12 additions & 0 deletions tests/static/40-mirrors-reachable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ reachable_floor_for() {
esac
}

disabled_arches="$(awk '
/^[[:space:]]*#[[:space:]]*-[[:space:]]+docker_arch:/ {
s = $0
sub(/^[^:]*:[[:space:]]*/, "", s)
sub(/[[:space:]]*$/, "", s)
print s
}
' "$REPO_ROOT/.github/workflows/build-deploy.yml" | tr -d '\r')"

lists="$(find "$REPO_ROOT/rootfs" -type f -path '*/etc/pacman.d/mirrorlist' | sort)"
if [ -z "$lists" ]; then
fail "at least one mirrorlist exists" "searched: $REPO_ROOT/rootfs" \
Expand All @@ -64,6 +73,9 @@ while IFS= read -r list; do
[ -n "$list" ] || continue
rel="${list#"$REPO_ROOT/"}"
archdir="$(basename "$(dirname "$(dirname "$(dirname "$list")")")")"
if printf '%s\n' "$disabled_arches" | grep -qxF "$archdir"; then
continue
fi
conf="$REPO_ROOT/rootfs/$archdir/etc/pacman.conf"

# pacman substitutes $arch with the Architecture from its own config
Expand Down
58 changes: 37 additions & 21 deletions tests/static/75-architecture-set.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,20 @@ fi
ARCHES="$(awk -F= 'NF { print $1 }' <<< "$pairs" | LC_ALL=C sort)"
n_arch="$(awk 'NF' <<< "$ARCHES" | wc -l | tr -d '[:space:]')"

disabled_arches() {
awk '
/^[[:space:]]*#[[:space:]]*-[[:space:]]+docker_arch:/ {
s = $0
sub(/^[^:]*:[[:space:]]*/, "", s)
sub(/[[:space:]]*$/, "", s)
print s
}
' "$1"
}

KNOWN="$(printf '%s\n%s\n' "$ARCHES" "$(disabled_arches "$WF" | tr -d '\r')" | awk 'NF' | LC_ALL=C sort -u)"
n_known="$(awk 'NF' <<< "$KNOWN" | wc -l | tr -d '[:space:]')"

dupes="$(printf '%s\n' "$ARCHES" | uniq -d | tr '\n' ' ')"
no_platform="$(awk -F= '$2 == "-" { print $1 }' <<< "$pairs" | tr '\n' ' ')"

Expand Down Expand Up @@ -137,7 +151,7 @@ while IFS= read -r arch; do
else
tagnames_broken="$tagnames_broken $arch"
fi
done <<< "$ARCHES"
done <<< "$KNOWN"

# The OCI spelling, which is the platform with linux/ taken off. armv7 is the
# only one where that leaves a slash behind.
Expand All @@ -149,7 +163,7 @@ while IFS='=' read -r a p; do
done <<< "$pairs"

n_tokens="$(awk 'NF' <<< "$TOKENS" | LC_ALL=C sort -u | wc -l | tr -d '[:space:]')"
diag "$n_tokens spellings map onto $n_arch architectures"
diag "$n_tokens spellings map onto $n_known known architectures"

#---------------------------------------------------------------------------#
# 3. every architecture loop names the whole set
Expand Down Expand Up @@ -204,7 +218,7 @@ loops() {
' "$1"
}

want="$(printf '%s\n' "$ARCHES" | awk 'NF' | LC_ALL=C sort -u)"
want="$(printf '%s\n' "$KNOWN" | awk 'NF' | LC_ALL=C sort -u)"
n_loops=0

while IFS= read -r file; do
Expand All @@ -219,12 +233,12 @@ while IFS= read -r file; do
words_nl="$(printf '%s' "$words" | tr '[:space:]' '\n' | awk 'NF')"
got=""
unknown=""
n_known=0
n_spelled=0
while IFS= read -r w; do
[ -n "$w" ] || continue
a="$(token_arch "$w")"
if [ -n "$a" ]; then
n_known=$((n_known + 1))
n_spelled=$((n_spelled + 1))
got="$got$a
"
else
Expand All @@ -234,7 +248,7 @@ while IFS= read -r file; do

# Not an architecture loop at all. Every other for loop in the tree is none
# of this file's business.
[ "$n_known" -gt 0 ] || continue
[ "$n_spelled" -gt 0 ] || continue
n_loops=$((n_loops + 1))

got_set="$(printf '%s\n' "$got" | awk 'NF' | LC_ALL=C sort -u)"
Expand All @@ -261,15 +275,17 @@ while IFS= read -r file; do
else
ok "$rel:$lineno names the whole architecture set"
fi
elif [ "$got_set" = "$ARCHES" ]; then
ok "$rel:$lineno names the built architecture set"
elif [ "$mark" = "subset" ]; then
ok "$rel:$lineno is a marked subset: $(printf '%s' "$got_set" | tr '\n' ' ')"
else
missing="$(LC_ALL=C comm -23 <(printf '%s\n' "$want") <(printf '%s\n' "$got_set") | tr '\n' ' ')"
extra="$(LC_ALL=C comm -13 <(printf '%s\n' "$want") <(printf '%s\n' "$got_set") | tr '\n' ' ')"
fail "$rel:$lineno names the whole architecture set" \
"missing: ${missing:-none}" \
"not in the build matrix: ${extra:-none}" \
"the matrix names: $(printf '%s' "$want" | tr '\n' ' ')" \
"not in the set: ${extra:-none}" \
"the set names: $(printf '%s' "$want" | tr '\n' ' ')" \
"if it is meant to cover fewer, write the reason in a comment above it and mark that comment" \
"reproduce: sed -n '${lineno}p' $rel"
fi
Expand Down Expand Up @@ -317,11 +333,11 @@ else
"no case label found inside aliases_for" \
"reproduce: sed -n '/aliases_for()/,/^}/p' scripts/tag-names"
elif [ "$labels" = "$want" ]; then
ok "scripts/tag-names has an alias set for exactly the $n_arch matrix architectures"
ok "scripts/tag-names has an alias set for exactly the $n_known known architectures"
else
only_matrix="$(LC_ALL=C comm -23 <(printf '%s\n' "$want") <(printf '%s\n' "$labels") | tr '\n' ' ')"
only_table="$(LC_ALL=C comm -13 <(printf '%s\n' "$want") <(printf '%s\n' "$labels") | tr '\n' ' ')"
fail "scripts/tag-names has an alias set for exactly the $n_arch matrix architectures" \
fail "scripts/tag-names has an alias set for exactly the $n_known known architectures" \
"built and has no alias set: ${only_matrix:-none}" \
"has an alias set and is not built: ${only_table:-none}" \
"reproduce: sed -n '/aliases_for()/,/^}/p' scripts/tag-names"
Expand Down Expand Up @@ -352,11 +368,11 @@ else
else
named="$(printf '%s' "$usage" | tr '|' '\n' | awk 'NF && $0 != "all"' | LC_ALL=C sort -u)"
if [ "$named" = "$want" ]; then
ok "the gen-mirrorlist usage string names exactly the $n_arch matrix architectures"
ok "the gen-mirrorlist usage string names exactly the $n_known known architectures"
else
fail "the gen-mirrorlist usage string names exactly the $n_arch matrix architectures" \
fail "the gen-mirrorlist usage string names exactly the $n_known known architectures" \
"it says: <$usage>" \
"the matrix names: $(printf '%s' "$want" | tr '\n' ' ')" \
"the set names: $(printf '%s' "$want" | tr '\n' ' ')" \
"reproduce: grep -n 'usage: scripts/gen-mirrorlist' scripts/gen-mirrorlist"
fi
fi
Expand Down Expand Up @@ -392,12 +408,12 @@ while IFS= read -r arch; do
else
fail "$arch has all $n_paths of its per architecture files" \
"not in the tree:$absent" \
"the build matrix names $arch, so the build will go looking for these" \
"the set names $arch, so its files are expected" \
"reproduce: ls$absent"
fi
done <<< "$ARCHES"
done <<< "$KNOWN"

# The other direction. A directory for an architecture the matrix does not name
# The other direction. A directory for an architecture the set does not name
# is either one that was removed and left files behind, or one somebody started
# adding and did not finish.
#
Expand All @@ -417,17 +433,17 @@ for d in rootfs bootstrap; do
if grep -qxF "$name" <<< "$SHARED"; then
continue
fi
if grep -qxF "$name" <<< "$ARCHES"; then
if grep -qxF "$name" <<< "$KNOWN"; then
continue
fi
orphans="$orphans $d/$name"
done <<< "$(find "$REPO_ROOT/$d" -mindepth 1 -maxdepth 1 -type d | LC_ALL=C sort)"
done

if [ -z "$(printf '%s' "$orphans" | tr -d '[:space:]')" ]; then
ok "no rootfs or bootstrap directory belongs to an architecture the matrix does not build"
ok "no rootfs or bootstrap directory belongs to an architecture the set does not name"
else
fail "no rootfs or bootstrap directory belongs to an architecture the matrix does not build" \
fail "no rootfs or bootstrap directory belongs to an architecture the set does not name" \
"not in the matrix:$orphans" \
"either the matrix lost an architecture or these files outlived one" \
"reproduce: ls -d$orphans"
Expand All @@ -451,11 +467,11 @@ else
"no expect_alias_count call found" \
"reproduce: grep -n expect_alias_count tests/static/60-tag-families.sh"
elif [ "$covered" = "$want" ]; then
ok "60-tag-families.sh checks an alias count for all $n_arch architectures"
ok "60-tag-families.sh checks an alias count for all $n_known known architectures"
else
uncovered="$(LC_ALL=C comm -23 <(printf '%s\n' "$want") <(printf '%s\n' "$covered") | tr '\n' ' ')"
stale="$(LC_ALL=C comm -13 <(printf '%s\n' "$want") <(printf '%s\n' "$covered") | tr '\n' ' ')"
fail "60-tag-families.sh checks an alias count for all $n_arch architectures" \
fail "60-tag-families.sh checks an alias count for all $n_known known architectures" \
"built and unchecked there: ${uncovered:-none}" \
"checked there and not built: ${stale:-none}" \
"reproduce: grep -n expect_alias_count tests/static/60-tag-families.sh"
Expand Down
Loading