Skip to content

Commit b61d051

Browse files
authored
Merge pull request #143 from vasi/update-actions
fix CI
2 parents ac22ad1 + 87fc124 commit b61d051

7 files changed

Lines changed: 128 additions & 51 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@ jobs:
1515
os: ubuntu-latest
1616
- name: No FUSE
1717
os: ubuntu-latest
18-
disable_fuse: "--disable-fuse"
18+
configure_args: "--disable-fuse"
1919
check_features: demo
2020
- name: distcheck
2121
os: ubuntu-latest
2222
- name: Old distro
23-
os: ubuntu-20.04
24-
- name: Mac
25-
os: macos-latest
23+
os: ubuntu-22.04
24+
- name: macFUSE
25+
os: macos-15
26+
- name: FUSE-T
27+
os: macos-15
2628
env:
2729
CHECK_FEATURES: ${{ matrix.check_features }}
28-
DISABLE_FUSE: ${{ matrix.disable_fuse }}
30+
CONFIGURE_ARGS: ${{ matrix.configure_args }}
2931
steps:
3032
- name: checkout
3133
uses: actions/checkout@v2
@@ -34,53 +36,47 @@ jobs:
3436
sudo apt-get update &&
3537
sudo apt-get install -y automake autoconf libtool pkgconf
3638
zlib1g-dev liblzo2-dev liblzma-dev liblz4-dev libzstd-dev
37-
fio
39+
squashfs-tools fio
3840
if: runner.os == 'Linux'
3941
- name: apt fuse 2
4042
run: sudo apt-get install -y libfuse-dev fuse
41-
if: matrix.os == 'ubuntu-20.04'
43+
if: matrix.os == 'ubuntu-22.04'
4244
- name: apt fuse 3
4345
run: sudo apt-get install -y libfuse3-dev fuse3
4446
if: matrix.os == 'ubuntu-latest'
4547
- name: homebrew dependencies
4648
env:
4749
HOMEBREW_NO_AUTO_UPDATE: 1
4850
run: |
49-
# Keep these until https://github.com/Homebrew/homebrew-core/pull/194885 is available by default
50-
brew remove pkg-config
51-
brew update
52-
53-
brew install autoconf automake libtool pkgconf squashfs coreutils
54-
brew install --cask macfuse
51+
brew install autoconf automake libtool squashfs coreutils
52+
echo "LDFLAGS=-L$(brew --prefix)/lib" >> $GITHUB_ENV
53+
echo "CPPFLAGS=-I$(brew --prefix)/include" >> $GITHUB_ENV
5554
if: runner.os == 'macOS'
55+
- name: macfuse
56+
run: brew install --cask macfuse
57+
if: matrix.name == 'macFUSE'
58+
- name: fuse-t
59+
run: |
60+
find /usr/local -ls
61+
brew tap macos-fuse-t/homebrew-cask
62+
brew install fuse-t
63+
if: matrix.name == 'FUSE-T'
5664
- name: configure
5765
run: |
5866
./autogen.sh
59-
CPPFLAGS="-Werror" ./configure $DISABLE_FUSE
67+
env CPPFLAGS="-Werror $CPPFLAGS" ./configure $CONFIGURE_ARGS
68+
- name: check discovered features
69+
run: diff -u ci/expected-features/${CHECK_FEATURES:-all} ci/features
70+
if: matrix.name != 'distcheck'
6071
- name: build
61-
run: |
62-
make -j2 V=1
72+
run: make -j2 V=1
6373
if: matrix.name != 'distcheck'
6474
- name: test
65-
run: |
66-
make check
67-
diff -u ci/expected-features/${CHECK_FEATURES:-all} ci/features
68-
if: runner.os != 'macOS' && matrix.name != 'distcheck'
69-
- name: test mac
70-
run: |
71-
# On macOS loading the macfuse extension is needed. This
72-
# command should load it without rebooting, except System
73-
# Integrity Protection disallows it, so the tests get skipped
74-
# there. This command came from
75-
# https://github.com/actions/runner-images/issues/4731
76-
if sudo kextload /Library/Filesystems/macfuse.fs/Contents/Extensions/$(sw_vers -productVersion|cut -d. -f1)/macfuse.kext; then
77-
make check
78-
diff -u ci/expected-features/${CHECK_FEATURES:-all} ci/features
79-
fi
80-
if: runner.os == 'macOS'
75+
run: make check
76+
# Can't accept security warning to allow macFUSE kext to work in CI
77+
if: matrix.name != 'macFUSE' && matrix.name != 'distcheck'
8178
- name: distcheck
82-
run: |
83-
make distcheck
79+
run: make distcheck
8480
if: matrix.name == 'distcheck'
8581
- name: install
8682
run: sudo make install
@@ -106,7 +102,7 @@ jobs:
106102
shell: powershell
107103
run: choco install -y squashfs
108104
- name: setup msbuild
109-
uses: microsoft/setup-msbuild@v1.0.2
105+
uses: microsoft/setup-msbuild@v2
110106
- name: checkout
111107
uses: actions/checkout@v2
112108
- name: generate header

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ libsquashfuse_convenience_la_SOURCES = swap.c cache.c table.c dir.c file.c fs.c
3333
util.h fs.h
3434
libsquashfuse_convenience_la_CPPFLAGS = $(ZLIB_CPPFLAGS) $(XZ_CPPFLAGS) $(LZO_CPPFLAGS) \
3535
$(LZ4_CPPFLAGS) $(ZSTD_CPPFLAGS) $(FUSE_CPPFLAGS)
36-
libsquashfuse_convenience_la_LIBADD = $(COMPRESSION_LIBS) $(FUSE_LIBS)
36+
libsquashfuse_convenience_la_LIBADD = $(COMPRESSION_LIBS)
3737

3838
# Main library: libsquashfuse
3939
lib_LTLIBRARIES += libsquashfuse.la

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ AS_IF([test "x$sq_decompressors" = x],
4646
# FUSE
4747
SQ_FUSE_API
4848
AS_IF([test "x$sq_fuse_found" = xyes],[
49+
SQ_FUSE_API_MACFUSE_EXTENSIONS
4950
SQ_FUSE_API_LOWLEVEL
5051
SQ_FUSE_API_VERSION
5152
SQ_FUSE_API_XATTR_POSITION

m4/squashfuse_fuse.m4

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,18 @@ AC_DEFUN([SQ_FIND_FUSE],[
163163
[:])
164164
SQ_KEEP_FLAGS([FUSE],[$sq_fuse_found])
165165
])
166+
# Use pkgconfig to look for fuse-t
167+
AS_IF([test "x$sq_fuse_found" = xyes],,[
168+
AC_DEFINE([FUSE_USE_VERSION], [26], [Version of FUSE API to use])
169+
SQ_SAVE_FLAGS
170+
SQ_PKG([fuse_t],[fuse-t],[
171+
# FUSE-T bug can mis-install header path: https://github.com/macos-fuse-t/fuse-t/issues/77
172+
CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -I/Library/Frameworks/fuse_t.framework/Headers"
173+
SQ_TRY_FUSE([fuse-t],[sq_fuse_found=yes],
174+
[AC_MSG_FAILURE([Can't find fuse-t with pkgconfig])])
175+
], [:])
176+
SQ_KEEP_FLAGS([FUSE],[$sq_fuse_found])
177+
])
166178
167179
# Default search locations
168180
AS_IF([test "x$sq_cv_lib_fuse_LIBS" = x],[SQ_SEARCH_FUSE_DIRS],[
@@ -322,3 +334,35 @@ AC_DEFUN([SQ_FUSE_API_XATTR_POSITION],[
322334
323335
SQ_RESTORE_FLAGS
324336
])
337+
338+
# SQ_FUSE_API_MACFUSE_EXTENSIONS
339+
#
340+
# Check if we need to disable macFUSE extensions
341+
AC_DEFUN([SQ_FUSE_API_MACFUSE_EXTENSIONS],[
342+
AC_DEFUN([SQ_FUSE_API_MACFUSE_EXTENSIONS_SOURCE],[
343+
AC_LANG_PROGRAM([#include <fuse.h>],[
344+
struct fuse_operations ops;
345+
int (*getattr_func)(const char*, struct stat*, struct fuse_file_info*);
346+
ops.getattr = getattr_func;
347+
])])
348+
349+
AC_CACHE_CHECK([if we need to disable macFUSE extensions],
350+
[sq_cv_decl_fuse_macfuse_extensions],[
351+
SQ_SAVE_FLAGS
352+
LIBS="$LIBS $FUSE_LIBS"
353+
CPPFLAGS="$CPPFLAGS $FUSE_CPPFLAGS"
354+
AC_COMPILE_IFELSE([SQ_FUSE_API_MACFUSE_EXTENSIONS_SOURCE],
355+
[sq_cv_decl_fuse_macfuse_extensions=no],
356+
[
357+
CPPFLAGS="$CPPFLAGS -DFUSE_DARWIN_ENABLE_EXTENSIONS=0"
358+
AC_COMPILE_IFELSE([SQ_FUSE_API_MACFUSE_EXTENSIONS_SOURCE],
359+
[sq_cv_decl_fuse_macfuse_extensions=yes],
360+
[sq_cv_decl_fuse_macfuse_extensions=no])
361+
])
362+
SQ_RESTORE_FLAGS
363+
])
364+
365+
AS_IF([test "x$sq_cv_decl_fuse_macfuse_extensions" = xyes],[
366+
CPPFLAGS="$CPPFLAGS -DFUSE_DARWIN_ENABLE_EXTENSIONS=0"
367+
])
368+
])

tests/lib.sh.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,16 @@ find_compressors() {
2828
fi
2929
echo "Found compressors:$compressors"
3030
}
31+
32+
sq_skip_notify() {
33+
case @build_os@ in
34+
darwin*)
35+
if otool -L ./squashfuse | grep -q fuse-t; then
36+
echo "yes"
37+
return 0
38+
fi
39+
;;
40+
esac
41+
echo "no"
42+
return 1
43+
}

tests/ll-smoke.sh.in

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ IDLE_TIMEOUT=5
1111

1212
trap cleanup EXIT
1313
set -e
14-
1514
WORKDIR=$(mktemp -d)
1615

1716
cleanup() {
@@ -27,6 +26,19 @@ cleanup() {
2726
fi
2827
}
2928

29+
test_nonexistent_mountpoint=yes
30+
test_idle_timeout=yes
31+
wait_sleeping=$(sq_skip_notify || true)
32+
case "$OSTYPE" in
33+
darwin*)
34+
# macOS may auto-create mountpoints, weird!
35+
test_nonexistent_mountpoint=no
36+
37+
# macOS background processes can inhibit timeout
38+
test_idle_timeout=no
39+
;;
40+
esac
41+
3042
find_compressors
3143

3244
echo "Generating random test files..."
@@ -47,26 +59,31 @@ for comp in $compressors; do
4759
echo "Mounting squashfs image..."
4860
FIFO_1=$(mktemp -u)
4961
mkfifo "$FIFO_1"
50-
$SFLL -f $SFLL_EXTRA_ARGS -o notify_pipe="$FIFO_1" "$WORKDIR/squashfs.image" "$WORKDIR/mount" >"$WORKDIR/squahfs_ll.log" 2>&1 &
62+
$SFLL -f $SFLL_EXTRA_ARGS -o notify_pipe="$FIFO_1" "$WORKDIR/squashfs.image" "$WORKDIR/mount" >"$WORKDIR/squashfs_ll.log" 2>&1 &
5163
# Wait for the archive to be mounted. TSAN builds can take some time to mount.
64+
if [ "x$wait_sleeping" = xyes ]; then
65+
sleep 5
66+
fi
5267
STATUS=$(head -c1 "$FIFO_1")
5368
if [ "$STATUS" != "s" ]; then
5469
echo "Image did not mount successfully"
55-
cp "$WORKDIR/squahfs_ll.log" /tmp/squahfs_ll.smoke.log
56-
echo "There may be clues in /tmp/squahfs_ll.smoke.log"
70+
cp "$WORKDIR/squashfs_ll.log" /tmp/squashfs_ll.smoke.log
71+
echo "There may be clues in /tmp/squashfs_ll.smoke.log"
5772
exit 1
5873
fi
5974

60-
FIFO_2=$(mktemp -u)
61-
mkfifo "$FIFO_2"
62-
$SFLL -f $SFLL_EXTRA_ARGS -o notify_pipe="$FIFO_2" "$WORKDIR/squashfs.image" "$WORKDIR/nonexistent_mount" >"$WORKDIR/squahfs_ll.log" 2>&1 &
63-
# This time the mount command should fail because the mountpoint doesn't exist
64-
STATUS=$(head -c1 "$FIFO_2")
65-
if [ "$STATUS" != "f" ]; then
66-
echo "Image mounted successfully when it should have failed"
67-
cp "$WORKDIR/squahfs_ll.log" /tmp/squahfs_ll.smoke.log
68-
echo "There may be clues in /tmp/squahfs_ll.smoke.log"
69-
exit 1
75+
if [ "x$test_nonexistent_mountpoint" = xyes ]; then
76+
FIFO_2=$(mktemp -u)
77+
mkfifo "$FIFO_2"
78+
$SFLL -f $SFLL_EXTRA_ARGS -o notify_pipe="$FIFO_2" "$WORKDIR/squashfs.image" "$WORKDIR/nonexistent_mount" >"$WORKDIR/squashfs_ll.log" 2>&1 &
79+
# This time the mount command should fail because the mountpoint doesn't exist
80+
STATUS=$(head -c1 "$FIFO_2")
81+
if [ "$STATUS" != "f" ]; then
82+
echo "Image mounted successfully when it should have failed"
83+
cp "$WORKDIR/squashfs_ll.log" /tmp/squashfs_ll.smoke.log
84+
echo "There may be clues in /tmp/squashfs_ll.smoke.log"
85+
exit 1
86+
fi
7087
fi
7188

7289
if command -v fio >/dev/null; then
@@ -137,7 +154,7 @@ for comp in $compressors; do
137154
sq_umount "$WORKDIR/mount"
138155

139156
# Only test timeouts once, it takes a long time
140-
if [ -z "$did_timeout" ]; then
157+
if [ "x$test_idle_timeout" = xyes -a -z "$did_timeout" ]; then
141158
echo "Remounting with idle unmount option..."
142159
$SFLL $SFLL_EXTRA_ARGS -otimeout=$IDLE_TIMEOUT "$WORKDIR/squashfs.image" "$WORKDIR/mount"
143160
if ! sq_is_mountpoint "$WORKDIR/mount"; then

tests/notify_test.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ cleanup() {
2020
rm -rf "$WORKDIR"
2121
fi
2222
}
23+
24+
if sq_skip_notify >/dev/null; then
25+
echo exit
26+
exit 77
27+
fi
28+
2329
echo "Generating random test files..."
2430
mkdir -p "$WORKDIR/source"
2531
mkdir -p "$WORKDIR/mount"

0 commit comments

Comments
 (0)