Skip to content

Commit cfc6ce8

Browse files
committed
use diffscope to compare stage2 builds
1 parent a09d499 commit cfc6ce8

File tree

1 file changed

+43
-18
lines changed

1 file changed

+43
-18
lines changed

.github/workflows/repro_check.yml

+43-18
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- master
7-
- reproducible
87
pull_request:
98
branches:
109
- master
@@ -37,40 +36,66 @@ jobs:
3736
- name: Build and store binaries from source 1
3837
run: |
3938
echo "Repo storage available: `df -h .`"
40-
cd ../buildA
39+
pushd ../buildA
4140
SOURCE_DIR=$(dirname $(find . -maxdepth 2 -name x.py))
4241
$SOURCE_DIR/configure --set rust.channel=nightly
43-
$SOURCE_DIR/x.py build --stage 1 -j$(($(nproc)*2/3))
42+
$SOURCE_DIR/x.py build --stage 2 -j$(($(nproc)*2/3))
4443
rm -rf $SOURCE_DIR
45-
STAGE1_DIR=`find build -name stage1`
46-
cp -r "$STAGE1_DIR" .
47-
echo "Contents stage 1 dir : `ls stage1`"
44+
STAGE2_DIR=`find build -name stage2`
45+
cp -r "$STAGE2_DIR" .
46+
echo "Contents stage 2 dir : `ls stage2`"
4847
rm -rf build
48+
popd
4949
50-
- name: Build and store binaries from source 2
50+
- name: Build and store binaries from source 1
5151
run: |
52-
cd ../buildA_extended
5352
echo "Repo storage available: `df -h .`"
53+
pushd ../buildA_extended
5454
SOURCE_DIR=$(dirname $(find . -maxdepth 2 -name x.py))
5555
$SOURCE_DIR/configure --set rust.channel=nightly
56-
$SOURCE_DIR/x.py build --stage 1 -j$(($(nproc)*2/3))
56+
$SOURCE_DIR/x.py build --stage 2 -j$(($(nproc)*2/3))
5757
rm -rf $SOURCE_DIR
58-
STAGE1_DIR=`find build -name stage1`
59-
cp -r "$STAGE1_DIR" .
60-
echo "Contents stage 1 dir : `ls stage1`"
58+
STAGE2_DIR=`find build -name stage2`
59+
cp -r "$STAGE2_DIR" .
60+
echo "Contents stage 2 dir : `ls stage2`"
6161
rm -rf build
62-
cd ..
62+
popd
6363
64-
- name: Compare builds using git diff
64+
- name: Install diffoscope
6565
run: |
66-
# Go back to the root directory
67-
cd ..
66+
sudo apt-get update
67+
sudo apt-get install -y diffoscope
6868
69+
- name: Compare builds
70+
run: |
6971
# Ensure the directories exist
70-
if [[ ! -d "buildA" || ! -d "buildA_extended" ]]; then
72+
if [[ ! -d "../buildA" || ! -d "../buildA_extended" ]]; then
7173
echo "Error: Build directories not found!"
7274
exit 1
7375
fi
7476
7577
# Perform a diff between the two builds
76-
diff -r buildA/stage1 buildA_extended/stage1 || echo "Differences found!"
78+
diffoscope ../buildA/stage2 ../buildA_extended/stage2 > diffoscope_output.txt || echo "Differences found!"
79+
80+
- name: Upload diffoscope output
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: diffoscope-report
84+
path: diffoscope_output.txt
85+
86+
- name: Archive buildA and buildA_extended
87+
run: |
88+
tar -czf buildA.tar.gz ../buildA
89+
tar -czf buildA_extended.tar.gz ../buildA_extended
90+
91+
- name: Upload buildA artifact
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: buildA
95+
path: buildA.tar.gz
96+
97+
- name: Upload buildA_extended artifact
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: buildA_extended
101+
path: buildA_extended.tar.gz

0 commit comments

Comments
 (0)