Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensures 32-bit platforms build #996

Merged
merged 1 commit into from
Jan 2, 2023
Merged

Ensures 32-bit platforms build #996

merged 1 commit into from
Jan 2, 2023

Conversation

codefromthecrypt
Copy link
Contributor

Trivy builds with linux_386, so this adds a check to ensure we cover 386 arch even if it may or may not work in interpreter (definitely not in compiler)

See aquasecurity/trivy#3355

@@ -213,6 +213,7 @@ format:
.PHONY: check
check:
@GOARCH=amd64 GOOS=dragonfly go build ./... # Check if the internal/platform can be built on compiler-unsupported platforms
@GOARCH=386 GOOS=linux go build ./... # Check if the internal/platform can be built on compiler-unsupported platforms
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the missing check, though theoretically we could fail on the various flavors of 32-bit arm or powerpc

Signed-off-by: Adrian Cole <adrian@tetrate.io>
return syscall.UtimesNano(path.Join(string(dir), name), []syscall.Timespec{
{Sec: atimeSec, Nsec: atimeNsec},
{Sec: mtimeSec, Nsec: mtimeNsec},
syscall.NsecToTimespec(atimeNsec),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the key is using this which implicitly coerces 64 bit to 32bit as needed.

@mathetake mathetake merged commit 4197caa into main Jan 2, 2023
@mathetake mathetake deleted the 386 branch January 2, 2023 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants