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

xx-info env: remove cond to print XX_TRIPLE #64

Merged
merged 1 commit into from
May 9, 2022

Conversation

crazy-max
Copy link
Collaborator

@crazy-max crazy-max commented Apr 27, 2022

XX_TRIPLE is not returned for windows platform with xx-info env and therefore CC and CXX vars are not exported with xx-go. Related to moby/moby#43529 (review).

Signed-off-by: CrazyMax crazy-max@users.noreply.github.com

base/xx-info Outdated
fi
case "$TARGETOS" in
Copy link
Owner

Choose a reason for hiding this comment

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

I don't really understand why there is a os filter at all in here. Maybe it is a historic relic from the time only Linux was supported.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks like this cond has been added here: 1b606ea#diff-2e3d3a4d78f2753f9464b79e8ac808928efdaeb5e0976104bad6f360448ad856R304-R307

Maybe it was to handle specific suffixes:

xx/base/xx-apt

Lines 160 to 167 in c6d3201

if [ "$XX_OS" = "windows" ]; then
case "$XX_ARCH" in
amd64) suffix="mingw-w64-x86-64" ;;
386) suffix="mingw-w64-i686" ;;
arm64) suffix="mingw-w64-aarch64" ;;
arm) suffix="mingw-w64-arm" ;;
esac
fi

...for mingw packages like the apt one?:

xx/base/xx-apt

Lines 193 to 208 in c6d3201

for p in ${packages2}; do
n=
if [ -n "$nocross" ]; then
n=${p}
elif checkpkg "${p}-${suffix}" >/dev/null 2>/dev/null; then
n="${p}-${suffix}"
elif [ "${XX_OS}" = "linux" ] && [ -n "${XX_APT_PREFER_CROSS}" ] && checkpkg "${p}-${XX_PKG_ARCH}-cross" >/dev/null 2>/dev/null; then
n="${p}-${XX_PKG_ARCH}-cross"
elif [ "${XX_OS}" = "linux" ]; then
n="${p}:${XX_PKG_ARCH}"
else
continue
fi
empty=
set -- "$@" "$n"
done

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

Choose a reason for hiding this comment

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

PKG_ARCH should probably remain under condition as we only support linux package managers.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes indeed we don't support Cygwin pkgs

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@crazy-max crazy-max changed the title xx-info env: XX_TRIPLE should be returned for windows platform xx-info env: remove cond to print XX_TRIPLE May 5, 2022
@tonistiigi tonistiigi merged commit 2c68a26 into tonistiigi:master May 9, 2022
@crazy-max crazy-max deleted the fix-info-env branch May 9, 2022 20:11
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