Skip to content

Conversation

@crazy-max
Copy link
Collaborator

@crazy-max crazy-max commented Sep 12, 2025

cc @rumpl

Copy link
Owner

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

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

Can we run all c/c++ tests also with this backend? Does xx-zig make sense?

src/xx-go Outdated
if command -v "$XX_TRIPLE-pkg-config" >/dev/null 2>/dev/null; then
export PKG_CONFIG="$XX_TRIPLE-pkg-config"
pkgconfig_set=1
if command -v "zig" >/dev/null 2>/dev/null; then
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure we should replace CC with zig just because it is installed. I guess this would be ok if there is no clang and gcc installed. Otherwise I would expect some opt-in env.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added XX_GO_PREFER_COMPILER as opt-in to use zig (defaults to clang if not set)

@crazy-max
Copy link
Collaborator Author

Can we run all c/c++ tests also with this backend?

Yes will add tests

Does xx-zig make sense?

Hum yes might make sense for zig build

@crazy-max
Copy link
Collaborator Author

Can we run all c/c++ tests also with this backend?

Yes will add tests

Does xx-zig make sense?

Hum yes might make sense for zig build

I will look at these as follow-up if that's fine to you

@crazy-max crazy-max marked this pull request as ready for review November 28, 2025 15:51
@crazy-max crazy-max requested a review from tonistiigi November 28, 2025 15:52
src/test-go.bats Outdated
skip "Zig not supported"
fi
export CGO_ENABLED=1
export XX_GO_PREFER_COMPILER=zig
Copy link
Owner

Choose a reason for hiding this comment

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

PREFER_C_COMPILER

src/xx-info Outdated
echo "XX_PKG_ARCH=${XX_PKG_ARCH}"
fi
echo "XX_TRIPLE=${XX_TRIPLE}"
echo "XX_ZIG_TRIPLE=${XX_ZIG_TRIPLE}"
Copy link
Owner

Choose a reason for hiding this comment

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

it is a bit weird to expose this in xx-info directly I think. We don't do this for other compilers with similar custom names. Maybe we should leave it to xx-go helper function for now and if we ever add xx-zig we can add smth like --print-target-triple there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good

@crazy-max crazy-max changed the title zig support xx-go: zig support Dec 3, 2025
@crazy-max crazy-max requested a review from tonistiigi December 3, 2025 10:05
Signed-off-by: CrazyMax <[email protected]>
@tonistiigi tonistiigi merged commit a5592ea into tonistiigi:master Dec 4, 2025
254 of 261 checks passed
@crazy-max crazy-max deleted the zig branch December 4, 2025 08:28
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