-
Notifications
You must be signed in to change notification settings - Fork 3k
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
set proper triplets for Windows #8994
base: master
Are you sure you want to change the base?
Conversation
CT Test Results 3 files 141 suites 49m 23s ⏱️ Results for commit cea3638. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A missing makefile dependency made CI use the cache when it should not, so this error was not detected by github actions. The fault caused all system_architectures to becomes aarch64-pc
-windows :)
Actually... although it won't cause issues for x86/x64 Windows but if I'm not mistaken, some files produced during compile-time are put in directories like Status = case erlang:load_nif(Lib, ?ASN1_NIF_VSN) of
ok -> ok;
{error, {load_failed, _}}=Error1 ->
ArchLibDir =
filename:join([PrivDir, "lib",
erlang:system_info(system_architecture)]),
Candidate =
filelib:wildcard(
filename:join([ArchLibDir,LibName ++ "*" ]),
erl_prim_loader),
case Candidate of
[] -> Error1;
_ ->
ArchLib = filename:join([ArchLibDir, LibName]),
erlang:load_nif(ArchLib, ?ASN1_NIF_VSN)
end;
Error1 -> Error1
end, A better solution is to change the value of if [ X"$X64" = X"true" ]; then
echo_setenv OVERRIDE_TARGET win32 ';'
echo_setenv CONFIG_SUBTYPE win64 ';'
elif [ X"$ARM64" = X"arm64" -o X"$ARM64" = X"x64_arm64" ]; then
echo_setenv OVERRIDE_TARGET aarch64-pc-windows ';'
echo_setenv CONFIG_SUBTYPE "$ARM64" ';'
else
echo_setenv OVERRIDE_TARGET win32 ';'
fi Yet there're also quite a few places are using the hard-coded ifeq ($(TARGET), win32)
OPENSSL_LIB = $(OPENSSL_OBJDIR)/$(OPENSSL_LIB_NAME).lib It won't be too hard to find all these cases and make corresponding changes, but I'm not quite sure if I should go this route... |
Thanks for the PR! Unless we shove ARM64 Windows under I don't expect having We'd have to discuss it though. :-) |
I'm looking forward to this change! One change I recently did in https://github.com/erlef/otp_builds was to exactly standardize on the target triple, these macOS builds now report If you'd consider publishing windows aarch64 builds, given we already have files like
so in this hypothetical new pattern, https://github.com/erlang/otp/releases/latest/download/otp-aarch64-pc-windows.zip would just work (without first knowing what is the latest version) which would be a really nice-to-have for tools like http://elixir-install.org and https://github.com/tsloughter/beamup. This is all fairly niche so it's probably not worth it to break the existing pattern but I thought I'd mention this on an off chance that it doesn't really matter one way or another so might as well. |
An update: we'd like to have proper triplets for all architectures on Windows too, with |
Absolutely no problem! I was worried that maybe Erlang/OTP would prefer to keep the old conventions for 64bit Windows so I haven't changed anything. I'll update the PR during the weekend or next week! |
Actually fixing this by using if ($architecture eq "win32") {
if (%ENV{"CONFIG_SUBTYPE"} eq "arm64" || %ENV{"CONFIG_SUBTYPE"} eq "x64_arm64") {
$architecture = "aarch64-pc-windows";
} elsif (%ENV{"CONFIG_SUBTYPE"} eq "win64") {
$architecture = "x86_64-pc-windows";
} elsif (%ENV{"CONFIG_SUBTYPE"} eq "win32") {
$architecture = "i686-pc-windows";
}
} The attempt to use |
We're not in any rush, OTP 28 is over half a year away so you can take as much time as you need. Otherwise, if this is blocking other work, that minimal fix looks alright for now. :-) |
Okay, maybe we can merge one for now if the name of these standardized triplets looks good to you! I'll squash the commits into a single one and change the PR title in a minute. I'll list the issues/questions I had when I was attempting to using |
Signed-off-by: Cocoa <[email protected]> Co-authored-by: Lukas Backström (FKA Larsson) <[email protected]>
ac2a3a4
to
cea3638
Compare
ERLANG_ARCHITECTURE
to aarch64-pc-windows
for ARM64 Windows
Great, I'll add it to our nightly builds tomorrow :) |
This PR should partially address the issue reported in #8767.
As described in #8767, ideally the following should return a triple like
x86_64-pc-windows
.As this is what's described in the official docs:
But changing this from
win32
tox86_64-pc-windows
for AMD64 Windows andi686-pc-windows
for 32-bit Windows could lead to a large blast radius -- I can imagine that many libraries would have to update their code.However, it's still fixable for ARM64 Windows as there isn't an official build/release of Erlang/OTP for ARM64 Windows yet, so newer and existing libraries can adapt to this if they decide to support ARM64 Windows.