Skip to content

Bug: Fail to build on s390x and 32-bit architectures #648

@folliehiyuki

Description

@folliehiyuki

stacker version

v1.0.0

Describe the bug

I'm trying to package stacker for AlpineLinux at https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/60169. CI in the MR fails for different architectures as listed below:

32-bit platforms (x86, armhf, armv7)

The error comes from building submodule https://github.com/project-machine/atomfs.

# machinerun.io/atomfs/squashfs
vendor/machinerun.io/atomfs/squashfs/verity.go:112:22: cannot use _Ctype_ulong(verity.HashOffset / uint64(os.Getpagesize())) (value of type _Ctype_ulong) as _Ctype_uint64_t value in assignment
vendor/machinerun.io/atomfs/squashfs/verity.go:113:29: cannot use _Ctype_ulong(verity.HashOffset) (value of type _Ctype_ulong) as _Ctype_uint64_t value in assignment

s390x

On s390x, Statfs_t struct has element Type of uint32. The type is int32 for 32-bit platforms. Ref: https://cs.opensource.google/go/x/sys/+/refs/tags/v0.26.0:unix/ztypes_linux_s390x.go

# stackerbuild.io/stacker/pkg/stacker
pkg/stacker/check.go:107:26: cannot use st.Type (variable of type uint32) as int64 value in map index

To reproduce

make -C cmd/stacker/lxc-wrapper LDLIBS="$(pkg-config --libs lxc) -lpthread -ldl" lxc-wrapper

go build -v \
	-tags exclude_graphdriver_btrfs,exclude_graphdriver_devicemapper,containers_image_openpgp,osusergo,netgo,external_libzstd \
	-ldflags "-X stackerbuild.io/stacker/pkg/lib.StackerVersion=v$pkgver -X stackerbuild.io/stacker/pkg/lib.LXCVersion=$(pkg-config --modversion lxc)" \
	./cmd/stacker

Expected behavior

The build succeeds.

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugexternalSubmitted by non-maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions