Skip to content

Delete Strings::format and no longer used unlocalized infrastructure.#909

Merged
BillyONeal merged 7 commits intomicrosoft:mainfrom
BillyONeal:localization-more-more
Mar 4, 2023
Merged

Delete Strings::format and no longer used unlocalized infrastructure.#909
BillyONeal merged 7 commits intomicrosoft:mainfrom
BillyONeal:localization-more-more

Conversation

@BillyONeal
Copy link
Copy Markdown
Member

@BillyONeal BillyONeal commented Feb 16, 2023

This PR is the ultimate result of merging the following localization PRs:

This fixes all known localization problems and makes future ones less likely by mostly removing the infrastructure to print unlocalized messages outright.

Audited:

  • print2 (deleted)
  • vcpkg::printf (deleted)
  • Checks::not-msg (deleted)
  • Strings::format (deleted)
  • ExpectedS (deleted)
  • Strings::append (retained)
  • Strings::concat (retained)
  • add_generic_error (retained)

@BillyONeal BillyONeal marked this pull request as draft February 16, 2023 05:03
@BillyONeal BillyONeal force-pushed the localization-more-more branch from 6220f6a to a86608b Compare February 16, 2023 22:15
BillyONeal added a commit to BillyONeal/vcpkg-tool that referenced this pull request Feb 27, 2023
@BillyONeal BillyONeal force-pushed the localization-more-more branch from e1b97d3 to 7edf251 Compare February 27, 2023 19:59
@BillyONeal BillyONeal mentioned this pull request Feb 27, 2023
@BillyONeal BillyONeal force-pushed the localization-more-more branch from 7edf251 to 43e69f7 Compare February 27, 2023 23:37
@BillyONeal BillyONeal changed the title Fix all known missing localization. Delete Strings::format and no longer used unlocalized infrastructure. Feb 27, 2023
@BillyONeal BillyONeal marked this pull request as ready for review March 3, 2023 01:32
@@ -91,25 +91,26 @@ namespace vcpkg::CMakeVars
const auto& fs = paths.get_filesystem();
std::string extraction_file;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We could construct extraction_file with the initial prelude.

{
const std::string name = package.package;
nodes.append(Strings::format("<Node Id=\"%s\" />", name));
fmt::format_to(std::back_inserter(nodes), "<Node Id=\"{}\" />", name);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[no change requested] This should really use XmlSerializer...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah :(

BillyONeal and others added 2 commits March 3, 2023 23:23
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
@BillyONeal BillyONeal merged commit cb90d76 into microsoft:main Mar 4, 2023
@BillyONeal BillyONeal deleted the localization-more-more branch March 4, 2023 09:31
@autoantwort
Copy link
Copy Markdown
Contributor

This kind of broke the output format of duration.
Before

Detecting compiler hash for triplet arm64-osx...
The following packages will be rebuilt:
    boost-uninstall[core]:arm64-osx -> 1.81.0#2
Removing 1/2 boost-uninstall:arm64-osx
Elapsed time to handle boost-uninstall:arm64-osx: 1.948 ms
Restored 0 package(s) from /Users/leanderSchulten/.cache/vcpkg/archives in 114.9 us. Use --debug to see more details.
Attempting to fetch 1 package(s) from HTTP servers
Restored 0 package(s) from HTTP servers in 206 ms. Use --debug to see more details.
Installing 2/2 boost-uninstall:arm64-osx...
Building boost-uninstall[core]:arm64-osx...
warning: -- Using community triplet arm64-osx. This triplet configuration is not guaranteed to succeed.
-- [COMMUNITY] Loading triplet configuration from: /Users/leanderSchulten/git_projekte/vcpkg/triplets/community/arm64-osx.cmake
-- 
Please use the following command when you need to remove all boost ports/components:
    "./vcpkg remove boost-uninstall:arm64-osx --recurse"

-- Performing post-build validation
Uploaded binaries to 1 HTTP remotes.
Stored binary cache: "/Users/leanderSchulten/.cache/vcpkg/archives/66/669209711bf44e71d0470196cd78bc9b486cef0cf363c6cd577f9b70a053e1dc.zip"
Elapsed time to handle boost-uninstall:arm64-osx: 278.4 ms
Total install time: 487.1 ms

After:

Detecting compiler hash for triplet arm64-osx...
The following packages will be rebuilt:
    boost-uninstall[core]:arm64-osx -> 1.81.0#2
Removing 1/2 boost-uninstall:arm64-osx
Elapsed time to handle boost-uninstall:arm64-osx: 1.88325 ms
Restored 0 package(s) from /Users/leanderSchulten/.cache/vcpkg/archives in 682.708 us. Use --debug to see more details.
Attempting to fetch 1 package(s) from HTTP servers
Restored 0 package(s) from HTTP servers in 210.244292 ms. Use --debug to see more details.
Installing 2/2 boost-uninstall:arm64-osx...
Building boost-uninstall[core]:arm64-osx...
warning: -- Using community triplet arm64-osx. This triplet configuration is not guaranteed to succeed.
-- [COMMUNITY] Loading triplet configuration from: /Users/leanderSchulten/git_projekte/vcpkg/triplets/community/arm64-osx.cmake
-- 
Please use the following command when you need to remove all boost ports/components:
    "./vcpkg remove boost-uninstall:arm64-osx --recurse"

-- Performing post-build validation
Uploaded binaries to 1 HTTP remotes.
Stored binary cache: "/Users/leanderSchulten/.cache/vcpkg/archives/ea/ea1a7b9817b0c937939d837215893858a607c709475ce50a9119f085c3cf5089.zip"
Elapsed time to handle boost-uninstall:arm64-osx: 293.621666 ms
Total install time: 506.937584 ms

@autoantwort
Copy link
Copy Markdown
Contributor

autoantwort commented Mar 19, 2023

Since this PR vcpkg depend-info --dot vtk crashes with

vcpkg has crashed. Please create an issue at https://github.com/microsoft/vcpkg containing a brief summary of what you were trying to do and the following information.

Version=2999-12-31-unknownhash-debug
EXCEPTION=unmatched '}' in format string
CMD=
vcpkg|
depend-info|
--dot|
vtk|

.string_arg("Bypass")
.string_arg("-Command")
.string_arg(Strings::format("& {& '%s' }", script_path));
.string_arg(fmt::format("& {& '{}' }", script_path));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Probably the reason for the following crash: microsoft/vcpkg#30283

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It can solve the problem of {} in the parsing path.

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.

4 participants