-
Notifications
You must be signed in to change notification settings - Fork 296
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
Add warning message for change in default triplet to host triplet #881
Conversation
So it will always change to |
What is the current default triplet for arm64 windows systems? I'm guessing it is |
I think the user expects a native build. So the default triplet should generally become what is the auto-detected host triplet. Even x86-windows for those machines. |
i thinkl the default triplet should be the detected host triplet. I mean vcpkg already as a default for that right? |
I'm pretty sure that already doesn't work because we try to fetch amd64 dependencies. |
src/vcpkg/triplet.cpp
Outdated
} | ||
else | ||
{ | ||
for (auto&& arg : args.command_arguments) |
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.
Does this trigger on vcpkg search
or vcpkg create
or vcpkg find
?
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.
I thought those commands do not use the default triplet?
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.
Then that's good -- the answer's no. I just wanted to confirm that you've checked them.
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.
Oh -- does this trigger on an invalid command? vcpkg asdf zlib
?
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.
Yes it will trigger for that.
include/vcpkg/base/messages.h
Outdated
DECLARE_MESSAGE(DefaultTriplet, | ||
(msg::triplet), | ||
"", | ||
"Starting with the September 2023 release, the default triplet for builds will change from " | ||
"x86-windows to the detected host triplet ({triplet})."); |
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.
We need to tell the user what to do about the message if they want it to go away:
Starting with the September 2023 release, the default triplet for builds will change from x86-windows to the detected host triplet ({triplet}). To resolve this message, add --triplet {triplet}
for the new value, or --triplet {value}
to keep the same behavior after the change.
src/vcpkg/triplet.cpp
Outdated
} | ||
else | ||
{ | ||
for (auto&& arg : args.command_arguments) |
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.
I'm really not a fan of assuming that the command arguments are ports regardless of the executed command like this. For instance, I believe this will do the wrong thing for things like add artifact
. (That is vcpkg add artifact gcc
should not emit a warning but I believe this will make it do so)
I think commands that are calling check_and_get_full_package_spec
need different handling here than commands that do not.
You might want to consider something like:
then pass this around instead of the naked triplet through all the bits that are processing user input. Then, so long as they never call In particular,
would become:
|
src/vcpkg/commands.upgrade.cpp
Outdated
@@ -96,6 +96,7 @@ namespace vcpkg::Commands::Upgrade | |||
const std::vector<PackageSpec> specs = Util::fmap(args.command_arguments, [&](auto&& arg) { | |||
return check_and_get_package_spec(std::string(arg), default_triplet, COMMAND_STRUCTURE.example_text, paths); | |||
}); | |||
print_default_triplet_warning(args, args.command_arguments); |
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.
vcpkg upgrade
shouldn't emit a warning -- it doesn't use the target triplet.
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.
Sorry, while I was making this comment before I made a mistake; vcpkg upgrade
alone shouldn't emit a warning. However, vcpkg upgrade zlib
does use the target triplet.
So, specifically, when args.command_arguments
is empty, we should not emit a warning.
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.
Thanks!
@@ -305,6 +305,7 @@ namespace vcpkg::Commands::DependInfo | |||
return check_and_get_full_package_spec( | |||
std::string{arg}, default_triplet, COMMAND_STRUCTURE.example_text, paths); | |||
}); | |||
print_default_triplet_warning(args, args.command_arguments); |
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.
I still think it would be better to do this as part of check_and_get_full_package_spec
but that's nitpick territory.
I made a mistake in my previous comment on commands.upgrade.cpp -- please take a look again. |
# Conflicts: # include/vcpkg/base/messages.h # locales/messages.json # src/vcpkg/base/messages.cpp
Thanks a bunch! |
No description provided.