Skip to content

Commit dc4b5b1

Browse files
committed
ci: Update to ubuntu-24.04
This updates us from ubuntu-22.04 to ubuntu-24.04, removes some dead code, and ensures we compile without network access in more places. Note that the binary we're using for GCC 5.4 appears to require ubuntu-22.04 and that this leaves updating the bootstrap CI for another time. ChangeLog: * .github/log_expected_warnings: Adjust expected warnings. * .github/workflows/ccpp32alpine.yml: Update from ubuntu-22.04 to ubuntu-24.04, remove ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION, and use case-insensitive grep to filter warnings. * .github/workflows/ccpp.yml: Likewise, compile without network access in more places, and remove commented-out warnings check in asan builder. Signed-off-by: Owen Avery <[email protected]>
1 parent 805d332 commit dc4b5b1

File tree

3 files changed

+32
-32
lines changed

3 files changed

+32
-32
lines changed

.github/log_expected_warnings

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
../../gcc/rust/checks/errors/borrowck/rust-borrow-checker-diagnostics.cc:145:46: warning: narrowing conversion of ‘loan’ from ‘Rust::Polonius::Loan’ {aka ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} [-Wnarrowing]
2+
/usr/include/c++/13/bits/new_allocator.h:172:33: warning: ‘*(std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >*)((char*)&saved + offsetof(Rust::BIR::PatternBindingBuilder::SavedState, Rust::BIR::PatternBindingBuilder::SavedState::regions.tl::optional<Rust::FreeRegions>::<unnamed>.tl::detail::optional_move_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_move_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_operations_base<Rust::FreeRegions>::<unnamed>.tl::detail::optional_storage_base<Rust::FreeRegions, false>::<unnamed>)).std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >::_M_impl.std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >::_Vector_impl::<anonymous>.std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >::_Vector_impl_data::_M_start’ may be used uninitialized [-Wmaybe-uninitialized]
3+
/usr/include/c++/13/bits/stl_vector.h:370:49: warning: ‘*(std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >*)((char*)&saved + offsetof(Rust::BIR::PatternBindingBuilder::SavedState, Rust::BIR::PatternBindingBuilder::SavedState::regions.tl::optional<Rust::FreeRegions>::<unnamed>.tl::detail::optional_move_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_move_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_operations_base<Rust::FreeRegions>::<unnamed>.tl::detail::optional_storage_base<Rust::FreeRegions, false>::<unnamed>)).std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >::_M_impl.std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >::_Vector_impl::<anonymous>.std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >::_Vector_impl_data::_M_end_of_storage’ may be used uninitialized [-Wmaybe-uninitialized]
4+
/usr/include/c++/13/bits/stl_vector.h:370:49: warning: ‘*(std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >*)((char*)&saved + offsetof(Rust::BIR::PatternBindingBuilder::SavedState, Rust::BIR::PatternBindingBuilder::SavedState::regions.tl::optional<Rust::FreeRegions>::<unnamed>.tl::detail::optional_move_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_move_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_operations_base<Rust::FreeRegions>::<unnamed>.tl::detail::optional_storage_base<Rust::FreeRegions, false>::<unnamed>)).std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >::_M_impl.std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >::_Vector_impl::<anonymous>.std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >::_Vector_impl_data::_M_end_of_storage’ may be used uninitialized [-Wmaybe-uninitialized]
5+
/usr/include/c++/13/bits/stl_vector.h:370:49: warning: ‘*(std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >*)((char*)&saved + offsetof(Rust::BIR::PatternBindingBuilder::SavedState, Rust::BIR::PatternBindingBuilder::SavedState::regions.tl::optional<Rust::FreeRegions>::<unnamed>.tl::detail::optional_move_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_move_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_operations_base<Rust::FreeRegions>::<unnamed>.tl::detail::optional_storage_base<Rust::FreeRegions, false>::<unnamed>)).std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >::_M_impl.std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >::_Vector_impl::<anonymous>.std::_Vector_base<Rust::FreeRegion, std::allocator<Rust::FreeRegion> >::_Vector_impl_data::_M_start’ may be used uninitialized [-Wmaybe-uninitialized]

.github/workflows/ccpp.yml

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@ on:
99
branches: [ master ]
1010
merge_group:
1111

12-
env:
13-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
14-
1512
jobs:
1613
build-and-check-ubuntu-64bit:
1714

1815
env:
1916
# Force locale, in particular for reproducible results re '.github/log_expected_warnings' (see below).
2017
LC_ALL: C.UTF-8
2118

22-
runs-on: ubuntu-22.04
19+
runs-on: ubuntu-24.04
2320

2421
steps:
2522
- uses: actions/checkout@v4
@@ -41,6 +38,8 @@ jobs:
4138
gcc-multilib \
4239
g++-multilib \
4340
dejagnu;
41+
# enable unshare
42+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
4443
# install Rust directly using rustup
4544
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.72.0;
4645
@@ -68,7 +67,7 @@ jobs:
6867
- name: Check for new warnings
6968
run: |
7069
cd gccrs-build
71-
< log grep 'warning: ' | grep rust | sort > log_warnings
70+
< log grep 'warning: ' | grep -i rust | sort > log_warnings
7271
if diff -U0 ../.github/log_expected_warnings log_warnings; then
7372
:
7473
else
@@ -104,7 +103,7 @@ jobs:
104103
# Force locale, in particular for reproducible results re '.github/log_expected_warnings' (see below).
105104
LC_ALL: C.UTF-8
106105

107-
runs-on: ubuntu-22.04
106+
runs-on: ubuntu-24.04
108107

109108
steps:
110109
- uses: actions/checkout@v4
@@ -126,6 +125,8 @@ jobs:
126125
gcc-multilib \
127126
g++-multilib \
128127
dejagnu;
128+
# enable unshare
129+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
129130
# install Rust directly using rustup
130131
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.72.0;
131132
@@ -148,12 +149,13 @@ jobs:
148149
cd gccrs-build; \
149150
# Add cargo to our path quickly
150151
. "$HOME/.cargo/env";
151-
make -Otarget -j $(nproc) 2>&1 | tee log
152+
# Build without network access
153+
unshare --net --ipc -r /bin/bash -c "make -Otarget -j $(nproc) 2>&1 | tee log ; exit \${PIPESTATUS[0]}"
152154
153155
- name: Check for new warnings
154156
run: |
155157
cd gccrs-build
156-
< log grep 'warning: ' | grep rust | sort > log_warnings
158+
< log grep 'warning: ' | grep -i rust | sort > log_warnings
157159
if diff -U0 ../.github/glibcxx_ubuntu64b_log_expected_warnings log_warnings; then
158160
:
159161
else
@@ -189,7 +191,7 @@ jobs:
189191
# Force locale, in particular for reproducible results re '.github/log_expected_warnings' (see below).
190192
LC_ALL: C.UTF-8
191193

192-
runs-on: ubuntu-22.04
194+
runs-on: ubuntu-24.04
193195

194196
steps:
195197
- uses: actions/checkout@v4
@@ -211,6 +213,8 @@ jobs:
211213
gcc-multilib \
212214
g++-multilib \
213215
dejagnu;
216+
# enable unshare
217+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
214218
# install Rust directly using rustup
215219
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.72.0;
216220
@@ -232,12 +236,13 @@ jobs:
232236
cd gccrs-build; \
233237
# Add cargo to our path quickly
234238
. "$HOME/.cargo/env";
235-
make -Otarget -j $(nproc) 2>&1 | tee log
239+
# Build without network access
240+
unshare --net --ipc -r /bin/bash -c "make -Otarget -j $(nproc) 2>&1 | tee log ; exit \${PIPESTATUS[0]}"
236241
237242
- name: Check for new warnings
238243
run: |
239244
cd gccrs-build
240-
< log grep 'warning: ' | grep rust | sort > log_warnings
245+
< log grep 'warning: ' | grep -i rust | sort > log_warnings
241246
if diff -U0 ../.github/log_expected_warnings log_warnings; then
242247
:
243248
else
@@ -294,6 +299,8 @@ jobs:
294299
libmpc-dev \
295300
build-essential \
296301
dejagnu;
302+
# enable unshare
303+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
297304
# install Rust directly using rustup
298305
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.72.0;
299306
@@ -341,8 +348,8 @@ jobs:
341348
run: |
342349
# Add cargo to our path quickly
343350
. "$HOME/.cargo/env";
344-
PATH=$HOME/gcc-5.4.0/bin:$PATH \
345-
make -C gccrs-build -j $(nproc)
351+
# Build without network access
352+
PATH="$HOME/gcc-5.4.0/bin:$PATH" unshare --net --ipc -r /bin/bash -c "make -C gccrs-build -j $(nproc) ; exit \${PIPESTATUS[0]}"
346353
347354
- name: Run Tests
348355
run: |
@@ -435,7 +442,7 @@ jobs:
435442
# Force locale, in particular for reproducible results re '.github/log_expected_warnings' (see below).
436443
LC_ALL: C.UTF-8
437444

438-
runs-on: ubuntu-22.04
445+
runs-on: ubuntu-24.04
439446

440447
steps:
441448
- uses: actions/checkout@v4
@@ -457,6 +464,8 @@ jobs:
457464
gcc-multilib \
458465
g++-multilib \
459466
dejagnu;
467+
# enable unshare
468+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
460469
# install Rust directly using rustup
461470
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.72.0;
462471
@@ -479,19 +488,8 @@ jobs:
479488
cd gccrs-build; \
480489
# Add cargo to our path quickly
481490
. "$HOME/.cargo/env";
482-
make -Otarget -j $(nproc) 2>&1 | tee log
483-
484-
# Skip warnings check
485-
# - name: Check for new warnings
486-
# run: |
487-
# cd gccrs-build
488-
# < log grep 'warning: ' | sort > log_warnings
489-
# if diff -U0 ../.github/log_expected_warnings log_warnings; then
490-
# :
491-
# else
492-
# echo 'See <https://github.com/Rust-GCC/gccrs/pull/1026>.'
493-
# exit 1
494-
# fi >&2
491+
# Build without network access
492+
unshare --net --ipc -r /bin/bash -c "make -Otarget -j $(nproc) 2>&1 | tee log ; exit \${PIPESTATUS[0]}"
495493
496494
- name: Run Tests
497495
run: |

.github/workflows/ccpp32alpine.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@ on:
99
branches: [ master ]
1010
merge_group:
1111

12-
env:
13-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
14-
1512
jobs:
1613
build-alpine-32bit-and-check-alpine-32bit:
1714

1815
env:
1916
# Force locale, in particular for reproducible results re '.github/log_expected_warnings' (see below).
2017
LC_ALL: C.UTF-8
2118

22-
runs-on: ubuntu-22.04
19+
runs-on: ubuntu-24.04
2320

2421
steps:
2522
- uses: actions/checkout@v4
@@ -81,7 +78,7 @@ jobs:
8178
run: |
8279
cd gccrs-build
8380
# grep exits with 1 if it doesn't find at least one match
84-
< log grep 'warning: ' | ../.github/safe-grep rust | sort > log_warnings
81+
< log grep 'warning: ' | ../.github/safe-grep -i rust | sort > log_warnings
8582
cat log_warnings
8683
shell: alpine.sh {0}
8784
- name: Archive warnings logs

0 commit comments

Comments
 (0)