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

[fmt] fix format conflict #25137

Merged
merged 3 commits into from
Jul 5, 2022
Merged

Conversation

Adela0814
Copy link
Contributor

@Adela0814 Adela0814 commented Jun 8, 2022

Fix #25109

Added patch fix-format-conflict.patch(fmtlib/fmt#2896), use qualified format_to call to avoid ADL conflict with std::format_to.

No feature needs to test.

@Adela0814 Adela0814 added category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed by the vcpkg team. labels Jun 8, 2022
@Adela0814 Adela0814 mentioned this pull request Jun 8, 2022
@Osyotr
Copy link
Contributor

Osyotr commented Jun 8, 2022

This looks wrong. The patch only modifies docs (doc/api.rst).

@Adela0814
Copy link
Contributor Author

Waiting for user verification.

@Adela0814
Copy link
Contributor Author

This looks wrong. The patch only modifies docs (doc/api.rst).

This change comes from upstream, format_to conflict with std::format_to, so add a namespace to avoid this.

@Neumann-A
Copy link
Contributor

@Adela0814:

I think you have the wrong patch. vcpkg shouldn't install docs so there is no reason to patch docs.

This change comes from upstream, format_to conflict with std::format_to, so add a namespace to avoid this.

I know about that and encountered that in HPX. *.rst files are not source files so your current change does not lead to a different output library. Basically FMT_DOC should be set to false/off in the portfile which it is

-DFMT_DOC=OFF

which thus deactivates the subfolder doc/ completely
https://github.com/fmtlib/fmt/blob/b135f1c01449f6f41be3933437797e768b54295a/CMakeLists.txt#L353-L355

So your change here doesn't do anything to the output of vcpkg.

@Neumann-A
Copy link
Contributor

You want to patch include/fmt/format-inl.h(78)

@Adela0814
Copy link
Contributor Author

@Adela0814:

I think you have the wrong patch. vcpkg shouldn't install docs so there is no reason to patch docs.

This change comes from upstream, format_to conflict with std::format_to, so add a namespace to avoid this.

I know about that and encountered that in HPX. *.rst files are not source files so your current change does not lead to a different output library. Basically FMT_DOC should be set to false/off in the portfile which it is

-DFMT_DOC=OFF

which thus deactivates the subfolder doc/ completely
https://github.com/fmtlib/fmt/blob/b135f1c01449f6f41be3933437797e768b54295a/CMakeLists.txt#L353-L355
So your change here doesn't do anything to the output of vcpkg.

Thanks for your comment, I will update this PR.

@Adela0814 Adela0814 marked this pull request as ready for review June 13, 2022 07:54
@JonLiu1993
Copy link
Member

@frits-greuter, Could you try if this PR solves your problem?

@JonLiu1993 JonLiu1993 added the info:reviewed Pull Request changes follow basic guidelines label Jun 24, 2022
- format_to(it, FMT_STRING("{}{}"), ERROR_STR, error_code);
+ fmt::format_to(it, FMT_STRING("{}{}"), message, SEP);
+ fmt::format_to(it, FMT_STRING("{}{}"), ERROR_STR, error_code);
FMT_ASSERT(out.size() <= inline_buffer_size, "");
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you link to the upstream fix?

@dan-shaw dan-shaw added requires:author-response and removed info:reviewed Pull Request changes follow basic guidelines labels Jun 27, 2022
FMT_ASSERT(out.size() <= inline_buffer_size, "");
}

diff --git a/src/os.cc b/src/os.cc
Copy link
Contributor Author

@Adela0814 Adela0814 Jun 28, 2022

Choose a reason for hiding this comment

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

@JonLiu1993 JonLiu1993 added info:reviewed Pull Request changes follow basic guidelines and removed requires:author-response labels Jun 28, 2022
@dan-shaw dan-shaw added the depends:different-pr This PR or Issue depends on a PR which has been filed label Jun 28, 2022
@vicroms vicroms merged commit 5dd5017 into microsoft:master Jul 5, 2022
@Adela0814 Adela0814 deleted the Dev/Mengna/fmt branch January 16, 2023 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support depends:different-pr This PR or Issue depends on a PR which has been filed info:internal This PR or Issue was filed by the vcpkg team. info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[fmt] Build error
7 participants