Skip to content

Commit 904f66d

Browse files
authored
Merge branch 'Rust-GCC:master' into 4140
2 parents 42229d6 + dbf131a commit 904f66d

File tree

3,239 files changed

+167600
-57505
lines changed

Some content is hidden

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

3,239 files changed

+167600
-57505
lines changed

.editorconfig

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Copyright 2025 Free Software Foundation, Inc.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation; either version 3 of the License, or
6+
# (at your option) any later version.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU General Public License
14+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
16+
# This file helps editors auto-configure whitespace settings.
17+
#
18+
# See here for more information about the format and editor support:
19+
#
20+
# https://editorconfig.org/
21+
22+
# This file is common to the GCC and GDB/Binutils projects. If you
23+
# update one, please sync it with the other.
24+
25+
# top-most EditorConfig file
26+
root = true
27+
28+
[*]
29+
end_of_line = lf
30+
insert_final_newline = true
31+
tab_width = 8
32+
33+
# EditorConfig files
34+
[.editorconfig]
35+
charset = utf-8
36+
trim_trailing_whitespace = true
37+
38+
# Makefile
39+
[{Makefile,*.mk,*.am}*]
40+
indent_style = tab
41+
indent_size = 8
42+
trim_trailing_whitespace = true
43+
44+
# ChangeLogs
45+
[ChangeLog*]
46+
indent_style = tab
47+
indent_size = 8
48+
trim_trailing_whitespace = true
49+
charset = utf-8
50+
51+
# C/C++
52+
[*.{c,h,cc}]
53+
charset = utf-8
54+
indent_style = tab
55+
indent_size = 2
56+
trim_trailing_whitespace = true
57+
58+
# GCC .def files. These are generally C fragments that get included
59+
# one or more times
60+
[gcc/**.def]
61+
charset = utf-8
62+
indent_style = tab
63+
indent_size = 2
64+
trim_trailing_whitespace = true
65+
66+
# Texinfo files
67+
[*.texi]
68+
charset = utf-8
69+
indent_size = 2
70+
trim_trailing_whitespace = true
71+
72+
# Expect / TCL
73+
[*.{exp,tcl}]
74+
indent_style = tab
75+
indent_size = 4
76+
trim_trailing_whitespace = true
77+
78+
# Python
79+
[*.py]
80+
indent_style = space
81+
indent_size = 4
82+
trim_trailing_whitespace = true
83+
84+
# Assembler
85+
[*.{s,S,asm}]
86+
indent_style = tab
87+
indent_size = 8
88+
trim_trailing_whitespace = true
89+
90+
# GCC Machine description files
91+
[gcc/config/**.md]
92+
indent_style = tab
93+
indent_size = 2
94+
trim_trailing_whitespace = true
95+
96+
# Awk
97+
[*.awk]
98+
indent_style = tab
99+
indent_size = 2
100+
trim_trailing_whitespace = true
101+
102+
# Autoconf
103+
[*.{ac,m4}]
104+
indent_style = tab
105+
indent_size = 2
106+
trim_trailing_whitespace = true
107+
108+
# Shell scripts
109+
[*.sh]
110+
indent_style = tab
111+
indent_size = 4
112+
trim_trailing_whitespace = true
113+
114+
# Ada
115+
[*.ad[bs]]
116+
indent_style = space
117+
indent_size = 3
118+
trim_trailing_whitespace = true
119+
120+
# D
121+
[*.d]
122+
indent_style = space
123+
indent_size = 4
124+
trim_trailing_whitespace = true
125+
126+
# Go
127+
[*.go]
128+
indent_style = tab
129+
indent_size = 8
130+
trim_trailing_whitespace = true
131+
132+
# Fortran
133+
[*.[Ff]90]
134+
indent_style = space
135+
indent_size = 2
136+
trim_trailing_whitespace = true
137+
138+
# Cobol
139+
[*.cbl]
140+
indent_style = space
141+
indent_size = 2
142+
trim_trailing_whitespace = true
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
pull_request:
3+
types: [opened, synchronize, reopened]
4+
5+
jobs:
6+
testjob:
7+
runs-on: sourceware-runner
8+
outputs:
9+
styleoutput: ${{ steps.check_gnu_style.outputs.styleresult }}
10+
verifyoutput: ${{ steps.gcc_verify.outputs.verifyresult }}
11+
steps:
12+
- name: install dependencies
13+
run: |
14+
echo "Installing node.js"
15+
apt-get update
16+
apt-get install -qq -y nodejs git python3 python3-git python3-termcolor python3-unidiff
17+
18+
# Checkout GCC sources, request an history depth of 100,
19+
# hopefully sufficient for all patch series (the default is 1)
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 100
23+
24+
- name: check GNU style
25+
id: check_gnu_style
26+
continue-on-error: true
27+
run: |
28+
echo "Running check_GNU_style.py"
29+
git fetch origin ${FORGEJO_BASE_REF}:${FORGEJO_BASE_REF}
30+
for sha in $(git rev-list ${FORGEJO_BASE_REF}..${FORGEJO_SHA})
31+
do
32+
echo "Checking GNU style for $sha"
33+
git show $sha | ./contrib/check_GNU_style.py -
34+
done
35+
echo "styleresult=pass" | tee -a $FORGEJO_OUTPUT
36+
37+
- name: gcc-verify
38+
id: gcc_verify
39+
continue-on-error: true
40+
run: |
41+
echo "Running gcc-verify check"
42+
./contrib/gcc-changelog/git_check_commit.py ${FORGEJO_BASE_REF}..${FORGEJO_SHA}
43+
echo "verifyresult=pass" | tee -a $FORGEJO_OUTPUT
44+
45+
- name: final-result
46+
run: |
47+
echo "Computing final result"
48+
test "${{ steps.check_gnu_style.outputs.styleresult }}" = "pass"
49+
test "${{ steps.gcc_verify.outputs.verifyresult }}" = "pass"

.github/workflows/ccpp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ jobs:
392392
git fetch arm-ian;
393393
GIT_AUTHOR_NAME=CI \
394394
GIT_AUTHOR_EMAIL='ci@invalid' \
395-
git merge --no-edit e110b7b04a6df1275330455aa886a6e283d06e48;
395+
git merge --no-edit 5335688e426583c2f4703e25cc24c69cf74280ed;
396396
397397
- name: Install Deps
398398
run: |

.github/workflows/send-emails.yml

Lines changed: 69 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
name: Send emails for merged PR
22

33
on:
4-
pull_request:
5-
types:
6-
- closed
4+
push:
75
branches:
86
- "master"
97

108
jobs:
119
send_patches:
12-
if: github.event.pull_request.merged == true
1310
runs-on: ubuntu-latest
1411

1512
steps:
@@ -46,38 +43,43 @@ jobs:
4643
run: |
4744
echo "$GH_EVENT" > /tmp/gh_event.json
4845
49-
PR_BASE_REF=$(jq -r '.pull_request.base.sha' /tmp/gh_event.json)
50-
echo "PR_BASE_REF=$PR_BASE_REF" >> $GITHUB_ENV
46+
BEFORE_REF=$(jq -r '.before' /tmp/gh_event.json)
47+
echo "BEFORE_REF=$BEFORE_REF" >> $GITHUB_ENV
5148
52-
PR_NUMBER=$(jq -r '.pull_request.number' /tmp/gh_event.json)
53-
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
49+
AFTER_REF=$(jq -r '.after' /tmp/gh_event.json)
50+
echo "AFTER_REF=$AFTER_REF" >> $GITHUB_ENV
5451
55-
PR_TITLE=$(jq -r '.pull_request.title' /tmp/gh_event.json)
56-
echo "PR_TITLE=$PR_TITLE" >> $GITHUB_ENV
52+
# PR_NUMBER=$(jq -r '.pull_request.number' /tmp/gh_event.json)
53+
# echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
5754
58-
PR_URL=$(jq -r '.pull_request.html_url' /tmp/gh_event.json)
59-
echo "PR_URL=$PR_URL" >> $GITHUB_ENV
55+
# PR_TITLE=$(jq -r '.pull_request.title' /tmp/gh_event.json)
56+
# echo "PR_TITLE=$PR_TITLE" >> $GITHUB_ENV
6057
61-
PR_MERGE_COMMIT=$(jq -r '.pull_request.merge_commit_sha' /tmp/gh_event.json)
62-
echo "PR_MERGE_COMMIT=$PR_MERGE_COMMIT" >> $GITHUB_ENV
58+
# PR_URL=$(jq -r '.pull_request.html_url' /tmp/gh_event.json)
59+
# echo "PR_URL=$PR_URL" >> $GITHUB_ENV
6360
64-
PR_TARGET_BRANCH=$(jq -r '.pull_request.base.ref' /tmp/gh_event.json)
65-
echo "PR_TARGET_BRANCH=$PR_TARGET_BRANCH" >> $GITHUB_ENV
61+
# PR_MERGE_COMMIT=$(jq -r '.pull_request.merge_commit_sha' /tmp/gh_event.json)
62+
# echo "PR_MERGE_COMMIT=$PR_MERGE_COMMIT" >> $GITHUB_ENV
6663
67-
PR_LABELS=$(jq -r '[.pull_request.labels[].name] | join(",")' /tmp/gh_event.json)
68-
echo "PR_LABELS=$PR_LABELS" >> $GITHUB_ENV
64+
# PR_TARGET_BRANCH=$(jq -r '.pull_request.base.ref' /tmp/gh_event.json)
65+
# echo "PR_TARGET_BRANCH=$PR_TARGET_BRANCH" >> $GITHUB_ENV
6966
70-
REPO_SSH=$(jq -r '.repository.ssh_url' /tmp/gh_event.json)
71-
echo "REPO_SSH=$REPO_SSH" >> $GITHUB_ENV
67+
# PR_LABELS=$(jq -r '[.pull_request.labels[].name] | join(",")' /tmp/gh_event.json)
68+
# echo "PR_LABELS=$PR_LABELS" >> $GITHUB_ENV
69+
70+
# REPO_SSH=$(jq -r '.repository.ssh_url' /tmp/gh_event.json)
71+
# echo "REPO_SSH=$REPO_SSH" >> $GITHUB_ENV
7272
7373
echo "GH_TOKEN=${{ github.token }}" >> $GITHUB_ENV
7474
75-
echo "SERIES_DIR=/tmp/series" >> $GITHUB_ENV
75+
# echo "SERIES_DIR=/tmp/series" >> $GITHUB_ENV
7676
77-
- name: Get commit list from PR and skip the internal ones
77+
- name: Get commit list and skip the internal ones
7878
id: commits
7979
env:
8080
MAX_NUM_COMMITS: 30
81+
BEFORE_REF: ${{ github.event.before }}
82+
AFTER_REF: ${{ github.event.after }}
8183
run: |
8284
# Skip commits that touches any of these
8385
patterns=(".github/"
@@ -93,17 +95,44 @@ jobs:
9395
9496
rm -f /tmp/commits.txt
9597
98+
if [ "$BEFORE_REF" = "0000000000000000000000000000000000000000" ] ; then
99+
echo "New branch created, not sending anything" | tee $GITHUB_STEP_SUMMARY
100+
echo "has_commits=false" >> $GITHUB_OUTPUT
101+
exit 0
102+
fi
103+
104+
if [ "$AFTER_REF" = "0000000000000000000000000000000000000000" ] ; then
105+
echo "Branch is being deleted, not sending anything" | tee $GITHUB_STEP_SUMMARY
106+
echo "has_commits=false" >> $GITHUB_OUTPUT
107+
exit 0
108+
fi
109+
110+
if git merge-base --is-ancestor "$BEFORE_REF" "$AFTER_REF"; then
111+
echo "fast-forward push (not forced)"
112+
else
113+
echo "non-fast-forward push (force push or history rewrite), not sending anything" | tee $GITHUB_STEP_SUMMARY
114+
echo "has_commits=false" >> $GITHUB_OUTPUT
115+
exit 0
116+
fi
117+
118+
IS_MERGE=$(git show --pretty=%P -s HEAD | wc -w)
119+
if [ "$IS_MERGE" -gt 1 ] ; then
120+
echo "Last commit is a merge, don't send anything" | tee $GITHUB_STEP_SUMMARY
121+
echo "has_commits=false" >> $GITHUB_OUTPUT
122+
exit 0
123+
fi
124+
96125
# Fetch commits from the pull request (maybe they're from another repository)
97-
git fetch origin "pull/$PR_NUMBER/head"
126+
#git fetch origin "pull/$PR_NUMBER/head"
98127
99-
TOTAL=$(gh api repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/commits --paginate --jq '.[].sha'|wc -l)
128+
TOTAL=$(git log --oneline "$BEFORE_REF..$AFTER_REF" | wc -l)
100129
if [ "${TOTAL}" -gt "$MAX_NUM_COMMITS" ]; then
101-
echo "Pull request has too many commits"
130+
echo "Push has too many commits" | tee $GITHUB_STEP_SUMMARY
102131
echo "has_commits=false" >> $GITHUB_OUTPUT
103132
exit 0
104133
fi
105134
106-
gh api repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/commits --paginate --jq '.[].sha' | while read SHA1; do
135+
git log --reverse --format=%H "$BEFORE_REF..$AFTER_REF" | while read SHA1; do
107136
echo "Looking at $SHA1"
108137
if grep -q -E "$regex" <(git diff-tree --no-commit-id --name-only -r "$SHA1"); then
109138
echo "Touching something not to be upstreamed, skipping commit $SHA1"
@@ -127,14 +156,18 @@ jobs:
127156
- name: Check for label 'no-ml' to skip sending emails
128157
id: checklabel
129158
run: |
159+
# not sure how to do that with "push".
160+
echo "skip=false" >> $GITHUB_OUTPUT
161+
exit 0
162+
130163
# Skip if PR has label "no-ml"
131-
if echo "$PR_LABELS" | grep -qiE "(^|,)no-ml(,|$)"; then
132-
echo "Opt-out label present: skipping mailing list." | tee $GITHUB_STEP_SUMMARY
133-
echo "skip=true" >> $GITHUB_OUTPUT
134-
else
135-
echo "No opt-out label found"
136-
echo "skip=false" >> $GITHUB_OUTPUT
137-
fi
164+
# if echo "$PR_LABELS" | grep -qiE "(^|,)no-ml(,|$)"; then
165+
# echo "Opt-out label present: skipping mailing list." | tee $GITHUB_STEP_SUMMARY
166+
# echo "skip=true" >> $GITHUB_OUTPUT
167+
# else
168+
# echo "No opt-out label found"
169+
# echo "skip=false" >> $GITHUB_OUTPUT
170+
# fi
138171
139172
- name: Decide if we're sending something or not
140173
id: send_emails
@@ -149,13 +182,12 @@ jobs:
149182
set -euo pipefail
150183
151184
# Create a temporary branch that linearizes the PR commits
152-
git checkout -B ci-mail-patches "$PR_BASE_REF"
185+
git checkout -B ci-mail-patches "$BEFORE_REF"
153186
# Cherry-pick commits in the exact PR order (no-commit to batch, then commit)
154187
while read sha; do
155188
git cherry-pick "$sha"
156189
done < /tmp/commits.txt
157190
158-
159191
echo "This change was merged into the gccrs repository and is posted here for" >> /tmp/description.txt
160192
echo "upstream visibility and potential drive-by review, as requested by GCC" >> /tmp/description.txt
161193
echo "release managers." >> /tmp/description.txt
@@ -169,9 +201,9 @@ jobs:
169201
git format-patch \
170202
--subject-prefix="gccrs COMMIT" \
171203
--no-cover-letter \
172-
--base="$PR_BASE_REF" \
204+
--base="$BEFORE_REF" \
173205
--output-directory /tmp/series \
174-
"$PR_BASE_REF"..HEAD
206+
"$BEFORE_REF"..HEAD
175207
176208
echo "" >> /tmp/description.txt
177209

0 commit comments

Comments
 (0)