Skip to content

Please add support for underscores in triplet names #45013

@cjdb

Description

@cjdb

Describe the bug
My toolchain files are named according to the toolchain triplet that they work with (e.g. config/cmake/toolchains/linux/x86_64-unknown-linux-gnu.cmake). I also want my triplets to have the same name as their chainload for consistency (e.g. config/cmake/toolchains/vcpkg/x86_64-unknown-linux-gnu.cmake).

Underscores were permitted until either a very late 2024 release, or sometime in 2025.

Environment

$ cmake --version
cmake version 4.0.1
$ vcpkg/vcpkg --version
vcpkg package management program version 2025-04-07-b8b513ba8778c918cff49c3e837aae5999d5d2aa

To Reproduce
Steps to reproduce the behavior:

  1. Create a triplet with an underscore in its name (e.g. x86_64-unknown-linux-gnu.cmake).
  2. Configure with -DVCPKG_TARGET_TRIPLET=x86_64-unknown-linux-gnu.

Expected behavior
Underscores are an accepted character.

Failure logs

error: Invalid triplet name. Triplet names are all lowercase alphanumeric+hyphens.
  on expression: x86_64-unknown-linux-llvm-asan
                    ^
Built-in Triplets:
<snip>

Metadata

Metadata

Assignees

Labels

category:vcpkg-featureThe issue is a new capability of the tool that doesn’t already exist and we haven’t committed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions