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

[vcpkg] Do not use raw paths inside regexes #12964

Merged
merged 3 commits into from
Aug 22, 2020

Conversation

hanst99
Copy link
Contributor

@hanst99 hanst99 commented Aug 17, 2020

vcpkg_fixup_pkgconfig uses raw paths in regexes in a couple of places. This causes problems if the path contains characters with special meaning for regexes, e.g. /home/hypothetical-user/Documents/C++, which would fail to compile as it's not a valid regex – causing any invocation of this script to fail if vcpkg is on such a path.

vcpkg_fixup_pkgconfig uses raw paths in regexes in a couple of places.
This causes problems if the path contains characters with special
meaning for regexes (e.g. /home/hypothetical-user/Documents/C++).
@hanst99
Copy link
Contributor Author

hanst99 commented Aug 17, 2020

Related issue: #12965

@NancyLi1013 NancyLi1013 changed the title Do not use raw paths inside regexes [vcpkg] Do not use raw paths inside regexes Aug 18, 2020
@PhoebeHui PhoebeHui added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Aug 18, 2020
@BillyONeal
Copy link
Member

macos geogram failure didn't repro for me locally, merged with master to try to fix

Copy link
Contributor

@PhoebeHui PhoebeHui left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,4 @@
function(vcpkg_escape_regex_control_characters out_var string_with_regex_characters)
string(REGEX REPLACE "([][+.*()^\\])" "\\\\\\1" _vercc_out "${string_with_regex_characters}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I added that.

Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

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

@hanst99 Can you confirm that you are OK with my edit? (Will merge ASAP assuming you like it) Thanks for your contribution!

@BillyONeal BillyONeal removed their assignment Aug 21, 2020
@BillyONeal BillyONeal merged commit 299f581 into microsoft:master Aug 22, 2020
@BillyONeal
Copy link
Member

Thanks for your contribution!

remz1337 pushed a commit to remz1337/vcpkg that referenced this pull request Aug 23, 2020
Co-authored-by: Billy Robert O'Neal <bion@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants