artifacts:path variable expansion does not work as documented on virtualbox executor with windows guest

Summary

Under a specific set of conditions, variables in the artifacts:path field do not expand as documented.

Steps to reproduce

Run a pipeline using variables in the artifacts:path field on a virtualbox executor with a windows guest.

.gitlab-ci.yml
variables:
  GIT_SUBMODULE_STRATEGY: recursive
  BUILD_TYPE: Release
  BUILD_DIR: build
  PRODUCT_NAME: someproduct

.matrix: &matrix
  parallel:
    matrix:
      - PLATFORM: Linux
        TAG: a_linux_docker_runner
      - PLATFORM: macOS
        TAG: a_mac_ssh_runner
      - PLATFORM: Windows
        TAG: a_virtualbox_windows_runner
  tags:
    - $TAG

stages:
  - build

# ##############
# BUILD
# ##############

build:
  stage: build
  image: $CI_REGISTRY/aDockerImageWithGCCAndCMake
  <<: *matrix
  before_script:
    - DIR="${BUILD_DIR}_${PLATFORM}"
  script:
    - cmake -B $DIR -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
    - cmake --build $DIR --config ${BUILD_TYPE}
  artifacts:
    paths:
      - ${BUILD_DIR}_${PLATFORM}

Actual behavior

This works on both our selfhosted Unix runners (Linux host with docker executor and a mac host with shell executor). The variable expansion fails on the Linux host when using the Virtualbox executor with a Windows 10 Guest.

This is rather unfortunate, as it removes any utility of the parallel:matrix feature to simplify build configs across multiple build platforms as soon as both Unix & Windows are involved.

Expected behavior

Variable expansion works on all executors and the artifacts get uploaded.

Relevant logs and/or screenshots

image

Environment description

Virtualbox executor running Windows 10 as guest on Ubuntu 24.04 host.

config.toml
concurrent = 2
check_interval = 0
connection_max_age = "15m0s"
shutdown_timeout = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "theHostName"
  url = "https://gitlab.com"
  id = 0
  token = "sometoken"
  token_obtained_at = 0001-01-01T00:00:00Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "virtualbox"
  limit = 1
  [runners.cache]
    MaxUploadedArchiveSize = 0
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]
  [runners.ssh]
    user = "username"
    password = "password"
    disable_strict_host_key_checking = true
  [runners.virtualbox]
    base_name = "WindowsRunner_v2"
    base_folder = ""
    disable_snapshots = true
    start_type = ""

Used GitLab Runner version

Version:      18.6.2
Git revision: 83dc1e70
Git branch:   18-6-stable
GO version:   go1.24.6 X:cacheprog
Built:        2025-11-25T20:34:07Z
OS/Arch:      linux/amd64
Edited by Sebastian Grill