Skip to content

Commit 402dd30

Browse files
Merge pull request #9187 from ThomasWaldmann/fix-binary-build-gh-1.4
CI: install fuse bindings for binary build, fixes #9182
2 parents 968c454 + c845565 commit 402dd30

File tree

1 file changed

+41
-23
lines changed

1 file changed

+41
-23
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,12 @@ jobs:
176176
run: |
177177
sudo apt-get update
178178
sudo apt-get install -y libssl-dev libacl1-dev liblz4-dev libzstd-dev pkg-config build-essential
179-
sudo apt-get install -y libxxhash-dev || true
180-
sudo apt-get install -y libfuse-dev fuse || true # Required for Python llfuse module
181-
sudo apt-get install -y libfuse3-dev fuse3 || true # Required for Python pyfuse3 module
179+
sudo apt-get install -y libxxhash-dev
180+
if [[ "$TOXENV" == *"fuse2"* ]]; then
181+
sudo apt-get install -y libfuse-dev fuse # Required for Python llfuse module
182+
elif [[ "$TOXENV" == *"fuse3"* ]]; then
183+
sudo apt-get install -y libfuse3-dev fuse3 # Required for Python pyfuse3 module
184+
fi
182185
183186
- name: Install macOS packages
184187
if: ${{ runner.os == 'macOS' }}
@@ -191,28 +194,21 @@ jobs:
191194
192195
- name: Install BorgBackup
193196
run: |
194-
pip install -ve .
195-
196-
- name: Run pytest via tox
197-
run: |
198-
# Do not use fakeroot; run as root. Avoids the dreaded sporadic EISDIR failures; see #2482.
199-
#sudo -E bash -c "tox -e py"
200-
tox --skip-missing-interpreters
201-
202-
- name: Upload coverage to Codecov
203-
uses: codecov/codecov-action@v4
204-
env:
205-
OS: ${{ runner.os }}
206-
python: ${{ matrix.python-version }}
207-
with:
208-
token: ${{ secrets.CODECOV_TOKEN }}
209-
env_vars: OS, python
197+
if [[ "$TOXENV" == *"fuse2"* ]]; then
198+
pip install -ve ".[llfuse]"
199+
elif [[ "$TOXENV" == *"fuse3"* ]]; then
200+
pip install -ve ".[pyfuse3]"
201+
else
202+
pip install -ve .
203+
fi
210204
211205
- name: Build Borg fat binaries (${{ matrix.binary }})
212206
if: ${{ matrix.binary && startsWith(github.ref, 'refs/tags/') }}
213207
run: |
214208
pip install 'pyinstaller==6.14.2'
215209
mkdir -p dist/binary
210+
# Ensure locally built binaries in ./dist/binary are found during tox tests
211+
echo "$GITHUB_WORKSPACE/dist/binary" >> "$GITHUB_PATH"
216212
pyinstaller --clean --distpath=dist/binary scripts/borg.exe.spec
217213
218214
- name: Smoke-test the built binary (${{ matrix.binary }})
@@ -227,6 +223,8 @@ jobs:
227223
./borg-dir/borg.exe -V
228224
tar czf borg.tgz borg-dir
229225
popd
226+
echo "borg.exe binary in PATH"
227+
borg.exe -V
230228
231229
- name: Prepare binaries (${{ matrix.binary }})
232230
if: ${{ matrix.binary && startsWith(github.ref, 'refs/tags/') }}
@@ -255,6 +253,21 @@ jobs:
255253
path: artifacts/*
256254
if-no-files-found: error
257255

256+
- name: Run pytest via tox
257+
run: |
258+
# Do not use fakeroot; run as root. Avoids the dreaded sporadic EISDIR failures; see #2482.
259+
#sudo -E bash -c "tox -e py"
260+
tox --skip-missing-interpreters
261+
262+
- name: Upload coverage to Codecov
263+
uses: codecov/codecov-action@v4
264+
env:
265+
OS: ${{ runner.os }}
266+
python: ${{ matrix.python-version }}
267+
with:
268+
token: ${{ secrets.CODECOV_TOKEN }}
269+
env_vars: OS, python
270+
258271
vm_tests:
259272

260273
# Cross-OS tests running inside VMs, aligned with master branch structure.
@@ -317,8 +330,10 @@ jobs:
317330
export IGNORE_OSVERSION=yes
318331
sudo -E pkg update -f
319332
sudo -E pkg install -y xxhash liblz4 zstd pkgconf
320-
# Install one of the FUSE libraries; fail if neither is available
321-
sudo -E pkg install -y fusefs-libs || sudo -E pkg install -y fusefs-libs3
333+
sudo -E pkg install -y fusefs-libs
334+
sudo -E kldload fusefs
335+
sudo -E sysctl vfs.usermount=1
336+
sudo -E chmod 666 /dev/fuse
322337
sudo -E pkg install -y rust
323338
sudo -E pkg install -y git
324339
sudo -E pkg install -y python310 py310-sqlite3
@@ -333,8 +348,7 @@ jobs:
333348
pip -V
334349
python -m pip install --upgrade pip wheel
335350
pip install -r requirements.d/development.txt
336-
pip install -e .
337-
tox -e py311-none
351+
pip install -e ".[llfuse]"
338352
if [[ "${{ matrix.do_binaries }}" == "true" && "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then
339353
python -m pip install 'pyinstaller==6.14.2'
340354
mkdir -p dist/binary
@@ -355,7 +369,11 @@ jobs:
355369
if [ -f dist/binary/borg.tgz ]; then
356370
cp -v dist/binary/borg.tgz artifacts/${{ matrix.artifact_prefix }}.tgz
357371
fi
372+
echo "binary files"
373+
ls -l artifacts/
358374
fi
375+
export PATH="$(pwd)/dist/binary:$PATH"
376+
tox -e py311-fuse2
359377
;;
360378
netbsd)
361379
# Ensure a proper hostname/FQDN is set (VMs may not have one by default)

0 commit comments

Comments
 (0)