Skip to content

Commit 4ae7e50

Browse files
authored
Merge branch 'erlang:master' into crypto/dh-uint64-fix
2 parents f4411d5 + c2548e6 commit 4ae7e50

1,322 files changed

Lines changed: 19562 additions & 28467 deletions

File tree

Some content is hidden

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

.github/scripts/add-vex-license.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
3+
## %CopyrightBegin%
4+
##
5+
## SPDX-License-Identifier: Apache-2.0
6+
##
7+
## Copyright Ericsson AB 2026. All Rights Reserved.
8+
##
9+
## Licensed under the Apache License, Version 2.0 (the "License");
10+
## you may not use this file except in compliance with the License.
11+
## You may obtain a copy of the License at
12+
##
13+
## http://www.apache.org/licenses/LICENSE-2.0
14+
##
15+
## Unless required by applicable law or agreed to in writing, software
16+
## distributed under the License is distributed on an "AS IS" BASIS,
17+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
## See the License for the specific language governing permissions and
19+
## limitations under the License.
20+
##
21+
## %CopyrightEnd%
22+
##
23+
24+
set -euo pipefail
25+
26+
CHANGED_FILES="${1:-/tmp/changed-vex.txt}"
27+
YEAR=$(date +%Y)
28+
29+
while IFS= read -r FILE; do
30+
[ -z "$FILE" ] && continue
31+
LICENSE_FILE="${FILE}.sigstore.license"
32+
if [ ! -f "$LICENSE_FILE" ]; then
33+
printf '%%CopyrightBegin%%\n\nSPDX-License-Identifier: Apache-2.0\n\nCopyright Ericsson AB %s. All Rights Reserved.\n\n%%CopyrightEnd%%\n' "$YEAR" > "$LICENSE_FILE"
34+
echo "Created $LICENSE_FILE"
35+
else
36+
echo "License file already exists: $LICENSE_FILE, skipping"
37+
fi
38+
done < "$CHANGED_FILES"

.github/scripts/create-openvex-pr.sh

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,58 @@
2020
##
2121
## %CopyrightEnd%
2222

23+
# Note: This script is to be called internally as follows:
24+
# openvex-sync.yaml -->
25+
# .github/scripts/otp-compliance.es vex verify -p -->
26+
# create-openvex-pr.sh
27+
#
28+
# as such, the following assumptions follow:
29+
#
30+
# - current branch: orphan
31+
# - openvex-sync.yml has copied from `master`
32+
# - .github/scripts/otp-compliance.es
33+
# - .github/scripts/create-openvex-pr.sh
34+
# - execution of `.github/scripts/otp-compliance.es vex verify -p` calls `.github/scripts/create-openvex-pr.sh`
35+
#
36+
37+
set -e # exit immediately if any command fails
2338

2439
REPO=$1
2540
BRANCH_NAME=$2
41+
ORPHAN_BRANCH="openvex"
42+
2643
# Fetch PR data using gh CLI
27-
PR_STATUS=$(gh pr view "$BRANCH_NAME" --repo "$REPO" --json state -q ".state")
28-
FOUND_PR=$?
44+
if gh pr view "$BRANCH_NAME" --repo "$REPO" --json state -q ".state" > /tmp/pr_status 2>/dev/null; then
45+
FOUND_PR=0
46+
PR_STATUS=$(cat /tmp/pr_status)
47+
else
48+
FOUND_PR=1
49+
PR_STATUS=""
50+
fi
2951

3052
if [ "$FOUND_PR" -ne 0 ]; then
3153
echo "No PR with name #$BRANCH_NAME in $REPO exists."
3254
echo "A new PR will be created"
3355
fi
3456

35-
# Check if PR is closed
3657
if [ "$PR_STATUS" = "CLOSED" ] || [ "$PR_STATUS" = "MERGED" ] || [ "$FOUND_PR" -ne 0 ]; then
3758
echo "Pull request #$BRANCH_NAME is CLOSED or MERGED."
3859
echo "✅ A new pull request with name #$BRANCH_NAME will be created."
39-
git branch "$BRANCH_NAME" master
40-
git checkout "$BRANCH_NAME"
41-
git add make/openvex.table
42-
git add vex
60+
61+
# Create a new work branch inside the worktree
62+
git checkout -b "$BRANCH_NAME"
63+
64+
# Commit inside the worktree
65+
git add otp-*.openvex.json
66+
git add otp-*.openvex.json.license
67+
git add openvex.table
4368
git commit -m "Automatic update of OpenVEX Statements for erlang/otp"
4469
git push --force origin "$BRANCH_NAME"
45-
gh pr create --repo "$REPO" -B master \
70+
71+
gh pr create --repo "$REPO" -B "$ORPHAN_BRANCH" \
72+
--head "$BRANCH_NAME" \
4673
--title "Automatic update of OpenVEX Statements for erlang/otp" \
4774
--body "Automatic Action. There is a vulnerability from GH Advisories without a matching OpenVEX statement"
48-
exit 0
4975
else
5076
echo "❌ Pull request #$BRANCH_NAME is OPEN. Create a PR once the PR is closed or merged."
5177
exit 0

.github/scripts/otp-compliance.es

Lines changed: 64 additions & 50 deletions
Large diffs are not rendered by default.

.github/workflows/main.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ concurrency:
4646
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.pull_request.number || github.sha }}
4747
cancel-in-progress: true
4848

49-
env:
50-
## Equivalent to github.event_name == 'pull_request' ? github.base_ref : github.ref_name
51-
BASE_BRANCH: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}
52-
## 'true' if all steps should be built and all tests run
53-
FULL_BUILD_AND_CHECK: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'full-build-and-check') || github.event_name == 'schedule' }}
54-
OTP_SBOM_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || github.sha }}
55-
5649
permissions:
5750
contents: read
5851
pull-requests: read

.github/workflows/openvex-sync.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,19 @@ jobs:
4141
steps:
4242
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6.0.2
4343
with:
44-
ref: 'master' # '' = default branch
44+
ref: 'openvex' # '' = default branch
4545
persist-credentials: false
46+
fetch-depth: 0
47+
48+
- name: 'Fetch Erlang/otp script dependencies'
49+
run: |
50+
git fetch origin master
51+
WORKTREE=$(mktemp -d /tmp/master-worktree.XXXXXX)
52+
git worktree add "$WORKTREE" master
53+
mkdir -p .github/scripts/
54+
cp -r "$WORKTREE/.github/scripts/." .github/scripts/
55+
cp "$WORKTREE/otp_versions.table" .
56+
git worktree remove "$WORKTREE"
4657
4758
- uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # ratchet:erlef/setup-beam@v1.20.4
4859
with:
@@ -69,6 +80,12 @@ jobs:
6980
run: |
7081
echo "${STEPS_APP_TOKEN_OUTPUTS_TOKEN}" | gh auth login --with-token
7182
83+
# register `gh` as git credential helper => git push in otp-compliance
84+
# uses the token from `gh`. otherwise, `persist-credentials` should not be `false`.
85+
# changing `persist-credentials` is not a good option
86+
- name: Configure git to use gh as credential helper
87+
run: gh auth setup-git
88+
7289
- name: Get GitHub App User ID
7390
id: get-user-id
7491
env:

.github/workflows/reusable-freebsd.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ jobs:
5050
copyback: false
5151
disable-cache: true
5252
prepare: |
53-
pkg update
54-
pkg upgrade -y
55-
pkg install -y bash gmake gtar autoconf ncurses pkgconf
53+
# Don't update base FreeBSD system, only required ports
54+
pkg update -fr FreeBSD-ports
55+
pkg upgrade -yr FreeBSD-ports
56+
pkg install -yr FreeBSD-ports bash gmake gtar autoconf ncurses pkgconf
5657
5758
run: |
5859
tar -xzf ./otp_src.tar.gz

.github/workflows/sigstore-updater.yml

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ on:
3232
release:
3333
types: [edited]
3434
pull_request:
35-
branches: [master]
35+
branches: [openvex]
3636
paths:
37-
- 'vex/*.openvex.json'
37+
- '*.openvex.json'
3838

3939
permissions:
4040
contents: read
@@ -61,13 +61,10 @@ jobs:
6161
run: mkdir artifacts; cp *.tar.gz artifacts/
6262
- name: Attest Distribution Assets with SBoM
6363
id: attest-sbom
64-
uses: actions/attest-sbom@4651f806c01d8637787e274ac3bdf724ef169f34 # v3
64+
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # ratchet:actions/attest@v4.10
6565
with:
6666
subject-path: |
6767
artifacts/*.tar.gz
68-
bom.*.json
69-
bom.*.yml
70-
bom.*.xml
7168
sbom-path: bom.spdx.json
7269
- name: Copy SBoM provenance
7370
id: sbom-provenance
@@ -77,7 +74,7 @@ jobs:
7774
run: |
7875
shopt -s nullglob
7976
mkdir attestations
80-
for FILE in artifacts/*.tar.gz bom.*.xml bom.*.json bom.*.yml; do
77+
for FILE in artifacts/*.tar.gz bom.*.json; do
8178
cp "$ATTESTATION" "attestations/$(basename "$FILE").sigstore"
8279
done
8380
- name: Update release
@@ -96,23 +93,6 @@ jobs:
9693
id-token: write
9794
runs-on: ubuntu-latest
9895
steps:
99-
- name: Checkout PR branch
100-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
101-
with:
102-
ref: "${{ github.head_ref }}"
103-
fetch-depth: 0
104-
persist-credentials: false
105-
- name: Find modified OpenVEX files
106-
id: changed
107-
run: |
108-
git diff --name-only --diff-filter=AM origin/master -- 'vex/*.openvex.json' > /tmp/changed-vex.txt
109-
echo "Modified OpenVEX files:"
110-
cat /tmp/changed-vex.txt
111-
if [ -s /tmp/changed-vex.txt ]; then
112-
echo "found=true" >> "$GITHUB_OUTPUT"
113-
else
114-
echo "found=false" >> "$GITHUB_OUTPUT"
115-
fi
11696
- name: Check PR author permission
11797
env:
11898
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
@@ -134,12 +114,37 @@ jobs:
134114
echo "::error::Only maintainers or erlang-bot-app can trigger VEX attestations"
135115
exit 1
136116
fi
117+
118+
- name: Checkout PR branch
119+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
120+
with:
121+
repository: "${{ github.event.pull_request.head.repo.full_name }}"
122+
ref: "${{ github.event.pull_request.head.ref }}"
123+
fetch-depth: 0
124+
persist-credentials: false
125+
126+
- name: Find modified OpenVEX files
127+
id: changed
128+
run: |
129+
git diff --name-only --diff-filter=AM HEAD~1 HEAD -- '*.openvex.json' > /tmp/changed-vex.txt
130+
echo "Modified OpenVEX files:"
131+
cat /tmp/changed-vex.txt
132+
if [ -s /tmp/changed-vex.txt ]; then
133+
echo "found=true" >> "$GITHUB_OUTPUT"
134+
else
135+
echo "found=false" >> "$GITHUB_OUTPUT"
136+
fi
137+
138+
- name: Add license files for new OpenVEX files
139+
if: steps.changed.outputs.found == 'true'
140+
run: bash .github/scripts/add-vex-license.sh /tmp/changed-vex.txt
141+
137142
- name: Attest OpenVEX files
138143
if: steps.changed.outputs.found == 'true'
139144
id: attest
140-
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.10
145+
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # ratchet:actions/attest@v4.10
141146
with:
142-
subject-path: 'vex/*.openvex.json'
147+
subject-path: '*.openvex.json'
143148
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
144149
if: steps.changed.outputs.found == 'true'
145150
id: app-token
@@ -156,6 +161,14 @@ jobs:
156161
STEPS_APP_TOKEN_OUTPUTS_TOKEN: "${{ steps.app-token.outputs.token }}"
157162
run: |
158163
echo "${STEPS_APP_TOKEN_OUTPUTS_TOKEN}" | gh auth login --with-token
164+
165+
# register `gh` as git credential helper => git push in otp-compliance
166+
# uses the token from `gh`. otherwise, `persist-credentials` should not be `false`.
167+
# changing `persist-credentials` is not a good option
168+
- name: Configure git to use gh as credential helper
169+
if: steps.changed.outputs.found == 'true'
170+
run: gh auth setup-git
171+
159172
- name: Get GitHub App User ID
160173
if: steps.changed.outputs.found == 'true'
161174
id: get-user-id
@@ -169,15 +182,19 @@ jobs:
169182
env:
170183
ATTESTATION: "${{ steps.attest.outputs.bundle-path }}"
171184
STEPS_APP_TOKEN_OUTPUTS_APP_SLUG: "${{ steps.app-token.outputs.app-slug }}"
185+
STEPS_APP_TOKEN_OUTPUTS_TOKEN: "${{ steps.app-token.outputs.token }}"
172186
STEPS_GET_USER_ID_OUTPUTS_USER_ID: "${{ steps.get-user-id.outputs.user-id }}"
187+
PR_HEAD_REPO: "${{ github.event.pull_request.head.repo.full_name }}"
188+
PR_HEAD_REF: "${{ github.event.pull_request.head.ref }}"
173189
run: |
174190
while IFS= read -r FILE; do
175191
[ -z "$FILE" ] && continue
176192
BASENAME=$(basename "$FILE")
177-
cp "$ATTESTATION" "vex/${BASENAME}.sigstore"
193+
cp "$ATTESTATION" "${BASENAME}.sigstore"
178194
done < /tmp/changed-vex.txt
179195
git config user.name "${STEPS_APP_TOKEN_OUTPUTS_APP_SLUG}[bot]"
180196
git config user.email "${STEPS_GET_USER_ID_OUTPUTS_USER_ID}+${STEPS_APP_TOKEN_OUTPUTS_APP_SLUG}[bot]@users.noreply.github.com"
181-
git add vex/*.sigstore
197+
git remote set-url origin "https://x-access-token:${STEPS_APP_TOKEN_OUTPUTS_TOKEN}@github.com/${PR_HEAD_REPO}.git"
198+
git add *.sigstore *.sigstore.license
182199
git commit -m "Update sigstore attestations for OpenVEX files" || true
183-
git push
200+
git push origin "HEAD:${PR_HEAD_REF}"

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ JAVADOC-GENERATED
236236
/lib/compiler/test/*_no_ssa_opt_SUITE.erl
237237
/lib/compiler/test/*_post_opt_SUITE.erl
238238
/lib/compiler/test/*_inline_SUITE.erl
239-
/lib/compiler/test/*_r26_SUITE.erl
240239
/lib/compiler/test/*_no_module_opt_SUITE.erl
241240
/lib/compiler/test/*_no_type_opt_SUITE.erl
242241
/lib/compiler/test/*_dialyzer_SUITE.erl

0 commit comments

Comments
 (0)