-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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] Remove start-of-string regex check for overlay triplet name matching.… #20059
[vcpkg] Remove start-of-string regex check for overlay triplet name matching.… #20059
Conversation
… This change allows for adding a prefix to android overlay ports, which many other systems support already. The android system relies on regex matching of the triplet name to deduce the ABI, so this change just allows for that string to be anywhere in the overlay triplet string.
I think... that's not correct. Let's see what's @talregev @christophe-calmejane @jherico said. |
Hmmm, I just tested it...
with my patch:
|
Well, I don't know if the policy changed, but when I added the regex match, I was specifically told to prevent matching something before |
Oh are the policies listed somewhere? I don't care to debate 😊... much less get into how things should or should not be named. The spirit of this PR is to make the system cmakes work in a similar manner to each other (at least in terms of overlay naming). Maybe that need isn't best fulfilled by loosening the naming on the android side. Perhaps we make the naming more stringent on the non-android side? So, some enforcement in the other systems? Or generalized frontend enforcement sourcing/validating the overlay triplets? Does anyone else see utility in being able to easily identify a triplet as being an overlay triplet (vs. vcpkg-controlled triplet), or the ability to side-by-side build and compare the artifacts of overlay triplets (vs. vcpkg-controlled triplets)? If nobody sees value here, perhaps we all just walk away :D |
Please do not remove the start from names. |
Triplet names are really overused for configuring the build. I don't really understand why it is necessary to parse the target triplet name when it would be fairly safe to read the triplet file (e.g. in a function scope, only exporting required variables such as I also don't see how this change might break reasonable use cases. Do we really need to worry about some custom |
The toolchain should be set according to the settings in the triplet file instead of using the triplet file name. |
It is only done in script mode (
I have to admit that I didn't think of triplets setting environment variables. But OTOH I wonder if it isn't desirable to configure the user project with the same environment as vcpkg (in awareness of the fact that the changes to the environment variables will be lost after CMake configuration, i.e. for the actual build). @ras0219 Any background information why reading triplets - or configuration exported from triplets - is avoided in the cmake toolchain (for user projects)? |
I hope my colleagues will put forward more points. |
It is intended that the name of the triplet is 100% independent from the meaning. The user should be able to make a triplet named That unfortunately is not the case for Android -- this issue was missed during the initial PR for Android and we don't block orthogonal improvements on fixing this original sin. However, we are strongly opposed to expanding this dependency. Given the above general concerns, this PR looks fine to me. There is no concern that "x64-windows-arm64-android" will be misinterpreted because the only way this file (android.cmake) is pulled in is if their triplet already says However, the larger long-term fix is likely to be some combination of:
The triplet is intended to be equivalent to a toolchain for portfiles, and the user owns both of them (via |
@dg0yt Any objections? |
No, in the context presented by @ras0219-msft: It is okay for now, but vcpkg needs to improve this in the future. |
This change allows for adding a prefix to android overlay ports, which many other systems support already. The android system relies on regex matching of the triplet name to deduce the ABI, so this change just allows for that string to be anywhere in the overlay triplet string.
What does your PR fix?
Fixes the android system behaving differently than other systems with regards to overlay tripets and naming. Android doesn't allow overlay triplets to have prefixes. At our site we like to prefix our overlay triplets with "overlay-" to completely differentiate them from built-in and community triplets. This is currently not possible with the android system since it's ABI deduction regex patterns match on start of the triplet string (name).
Which triplets are supported/not supported? Have you updated the CI baseline?
This change should not impact triplet support, only what the name of overlay triplets are allowed to be.
Does your PR follow the maintainer guide?
I think so.
If you have added/updated a port: Have you run
./vcpkg x-add-version --all
and committed the result?I have not.