Merge branch 'user/shawn/buildUX' of https://github.com/microsoft/WSL into user/shawn/buildUX

This commit is contained in:
Shawn Yuan
2026-04-10 12:12:47 +08:00
2 changed files with 8 additions and 5 deletions

View File

@@ -60,7 +60,7 @@
XML entities: &quot; = " &lt; = < &gt; = > -->
<Error Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(WslcImage.Identity)', '[/\\:*?&quot;&lt;&gt;|]'))"
Code="WSLC0004"
Text="WslcImage '%(WslcImage.Identity)' contains characters not valid in file names. Use a simple name as the item identity and pass the full image reference via Tag metadata." />
Text="WslcImage '%(WslcImage.Identity)' contains characters not valid in file names. Use a simple, file-name-safe value for the item identity. If needed, specify only the image tag suffix via Tag metadata." />
</Target>
<!-- Dispatch each WslcImage via MSBuild task instead of batching directly because:

View File

@@ -91,10 +91,13 @@ function(wslc_add_image _target_name)
if(NOT ARG_IMAGE)
message(FATAL_ERROR "wslc_add_image: IMAGE is required")
endif()
# IMAGE must not contain a tag — use the TAG parameter instead
string(FIND "${ARG_IMAGE}" ":" _colon_pos)
if(NOT _colon_pos EQUAL -1)
message(FATAL_ERROR "wslc_add_image: IMAGE '${ARG_IMAGE}' contains ':'. Specify the tag separately with the TAG parameter.")
# IMAGE must not contain a tag — use the TAG parameter instead.
# Allow ':' in the registry host portion (for example, localhost:5000/myimg)
# and only reject ':' when it appears after the last '/'.
string(FIND "${ARG_IMAGE}" "/" _last_slash_pos REVERSE)
string(FIND "${ARG_IMAGE}" ":" _last_colon_pos REVERSE)
if(_last_colon_pos GREATER _last_slash_pos)
message(FATAL_ERROR "wslc_add_image: IMAGE '${ARG_IMAGE}' contains a tag. Specify the tag separately with the TAG parameter.")
endif()
if(NOT ARG_DOCKERFILE)
message(FATAL_ERROR "wslc_add_image: DOCKERFILE is required")