Skip to content

[spdlog] fix wchar support#24830

Merged
ras0219-msft merged 1 commit intomicrosoft:masterfrom
diablodale:fix-spdlog-wchar
May 23, 2022
Merged

[spdlog] fix wchar support#24830
ras0219-msft merged 1 commit intomicrosoft:masterfrom
diablodale:fix-spdlog-wchar

Conversation

@diablodale
Copy link
Copy Markdown
Contributor

What does your PR fix?

Errant code/bugs in the spdlog port itself

  • correct errant vcpkg feature define
  • remove vcpkg_replace_string() because it duplicates the defines already in vcpkg_cmake_configure().
    Such duplication leads to compiler errors+warning of dups/conflicts

Which triplets are supported/not supported? Have you updated the [CI baseline]

No change in triplet support.

Does your PR follow the maintainer guide?

yes

If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

yes

@ghost
Copy link
Copy Markdown

ghost commented May 20, 2022

CLA assistant check
All CLA requirements met.

Comment thread ports/spdlog/portfile.cmake Outdated
Comment on lines 48 to 51
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.

This is probably needed for integrations other than CMake. If you are annoyed by the warning do a #undef first.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is the mission and requirements of vcpkg to support its use outside cmake?
Please do point me to related requirements, as since vcpkg is based on cmake, that seems an unusual request.

When such is documented, I am happy to revisit the fixes as well as additional changes that may be needed. I doubt I would ever undef in my code as that would be special casing an issue that is actually in vcpkg. But like I wrote, I can revisit if you point me to related requirements

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.

Is the mission and requirements of vcpkg to support its use outside cmake?

Yes. https://github.com/microsoft/vcpkg/blob/master/docs/users/buildsystems/integration.md

Also internally it needs to work with meson/autotools and other build systems. So the headers need to define the required stuff without knowing about possible defines from cmake.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok, thanks for info. 👍
I will update this PR with changes so that someone can point to the vcpkg/install/........ directory manually without cmake and the needed defines will be present. I think I have to add one or two more.

Comment thread ports/spdlog/portfile.cmake Outdated
Copy link
Copy Markdown
Contributor

@Osyotr Osyotr May 20, 2022

Choose a reason for hiding this comment

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

According to #18041, SPDLOG_WCHAR_SUPPORT and SPDLOG_WCHAR_FILENAMES are both valid and serve different purposes.
This change is invalid.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There are two separate issues then...

  1. Today's port does not work correctly on non-cmake integration. Why? Because while there is a mapping of SPDLOG_WCHAR_SUPPORT as a vcpkg feature, there is nothing in the port which changes the tweakme.h to make it work outside cmake.
  2. Unicode filenames. Also known as wchar filenames. Unfortunately, the existing spdlog project doesn't overload both...it is one or the other. Therefore, I guess this falls into the "alternatives exclusion" rule for vcpkg. If that is true, then I will just do this on my local branch of vcpkg.

- correct vcpkg feature `wchar`
- add support for integrations other than cmake
- update port-version + vcpkg x-add-version spdlog
@diablodale
Copy link
Copy Markdown
Contributor Author

force pushed with feedback changes

@LilyWangLL LilyWangLL added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label May 23, 2022
@LilyWangLL LilyWangLL changed the title fix spdlog wchar support [spdlog] fix wchar support May 23, 2022
@LilyWangLL LilyWangLL added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label May 23, 2022
@ras0219-msft
Copy link
Copy Markdown
Contributor

Awesome, thanks for the PR! Looks great after having taken in all the feedback :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants