diff --git a/internal/fs/setflags_linux_test.go b/internal/fs/setflags_linux_test.go index 7818146ac..089b7c615 100644 --- a/internal/fs/setflags_linux_test.go +++ b/internal/fs/setflags_linux_test.go @@ -59,9 +59,13 @@ func supportsNoatime(t *testing.T, f *os.File) bool { err := unix.Fstatfs(int(f.Fd()), &fsinfo) rtest.OK(t, err) - return fsinfo.Type == unix.BTRFS_SUPER_MAGIC || - fsinfo.Type == unix.EXT2_SUPER_MAGIC || - fsinfo.Type == unix.EXT3_SUPER_MAGIC || - fsinfo.Type == unix.EXT4_SUPER_MAGIC || - fsinfo.Type == unix.TMPFS_MAGIC + // The funky cast works around a compiler error on 32-bit archs: + // "unix.BTRFS_SUPER_MAGIC (untyped int constant 2435016766) overflows int32". + // https://github.com/golang/go/issues/52061 + typ := int64(uint(fsinfo.Type)) + return typ == unix.BTRFS_SUPER_MAGIC || + typ == unix.EXT2_SUPER_MAGIC || + typ == unix.EXT3_SUPER_MAGIC || + typ == unix.EXT4_SUPER_MAGIC || + typ == unix.TMPFS_MAGIC }