Skip to content

Commit 1af976d

Browse files
committed
fix(ci): add apt update and use generic error messages
Add `apt update` before installing squashfuse packages in CI workflows to ensure the package index is fresh. Replace distro-specific `apt install` suggestions in test error messages with generic "install for your platform" phrasing. https://claude.ai/code/session_01LfpnUZrgq93MVZgA3KVqE6
1 parent bbbef2a commit 1af976d

3 files changed

Lines changed: 13 additions & 20 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
3232
- name: Install FUSE dependencies
3333
if: runner.os == 'Linux'
34-
run: sudo apt install -y squashfs-tools squashfuse fuse3
34+
run: sudo apt update && sudo apt install -y squashfs-tools squashfuse fuse3
3535

3636
- name: Test (dev)
3737
shell: bash

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
4545
- name: Install FUSE dependencies
4646
if: runner.os == 'Linux'
47-
run: sudo apt install -y squashfs-tools squashfuse fuse3
47+
run: sudo apt update && sudo apt install -y squashfs-tools squashfuse fuse3
4848

4949
- name: Test (dev)
5050
shell: bash

tests/one_file_system.rs

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,30 +90,22 @@ fn fuse_probe() -> Result<FuseTools, String> {
9090
.arg("-version")
9191
.output()
9292
.map_err(|error| {
93-
format!(
94-
"`mksquashfs` not found: {error}. \
95-
Install via `apt install squashfs-tools`."
96-
)
93+
format!("`mksquashfs` not found: {error}. Install squashfs-tools for your platform.")
9794
})?;
9895

9996
// Check that squashfuse is installed
10097
Command::new("squashfuse")
10198
.arg("--help")
10299
.output()
103100
.map_err(|error| {
104-
format!(
105-
"`squashfuse` not found: {error}. \
106-
Install via `apt install squashfuse`."
107-
)
101+
format!("`squashfuse` not found: {error}. Install squashfuse for your platform.")
108102
})?;
109103

110104
// Check that /dev/fuse is accessible
111105
if !Path::new("/dev/fuse").exists() {
112-
return Err(
113-
"/dev/fuse does not exist. The FUSE kernel module may not be loaded. \
114-
Try `modprobe fuse`."
115-
.to_string(),
116-
);
106+
return Err("/dev/fuse does not exist. \
107+
The FUSE kernel module may not be loaded (`modprobe fuse`)."
108+
.to_string());
117109
}
118110

119111
// Check that fusermount is available (needed for unmounting)
@@ -123,9 +115,10 @@ fn fuse_probe() -> Result<FuseTools, String> {
123115
(true, _) => "fusermount",
124116
(_, true) => "fusermount3",
125117
_ => {
126-
return Err("Neither `fusermount` nor `fusermount3` found. \
127-
Install via `apt install fuse3`."
128-
.to_string());
118+
return Err(
119+
"Neither `fusermount` nor `fusermount3` found. Install FUSE for your platform."
120+
.to_string(),
121+
);
129122
}
130123
};
131124

@@ -156,8 +149,8 @@ fn cross_device_excludes_mount() {
156149
"error: This test requires FUSE (`mksquashfs`, `squashfuse`, `/dev/fuse`, \
157150
`fusermount`) but the probe failed.\n\
158151
reason: {reason}\n\
159-
hint: Install via `apt install squashfs-tools squashfuse fuse3`, or set \
160-
`RUSTFLAGS='--cfg pdu_test_skip_cross_device'` to skip this test.",
152+
hint: Install `squashfs-tools`, `squashfuse`, and FUSE for your platform, \
153+
or set `RUSTFLAGS='--cfg pdu_test_skip_cross_device'` to skip this test.",
161154
),
162155
};
163156

0 commit comments

Comments
 (0)