Skip to content

[spdx] downloadLocation unresolved when REF uses a string(REPLACE)-derived variable (e.g. curl port) #1996

@edroque93

Description

@edroque93

Summary

When a portfile derives the REF value via string(REPLACE ...) instead
of using ${VERSION} directly, the SPDX generator emits the intermediate
variable name unresolved in downloadLocation.

Reproduction

The curl portfile (ports/curl/portfile.cmake) does:

string(REPLACE "." "_" curl_version "curl-${VERSION}")

vcpkg_from_github(
    REPO curl/curl
    REF ${curl_version}
    ...
)

This is necessary because curl tags use underscores
(e.g. curl-8_19_0, not 8.19.0).

The generated vcpkg.spdx.json contains:

"downloadLocation": "git+https://github.com/curl/curl@${curl_version}"

instead of:

"downloadLocation": "git+https://github.com/curl/curl@curl-8_19_0"

Notes

PRs #1162, #1607 and #1622 fixed the literal ${VERSION} case but do
not evaluate variables derived from CMake expressions like
string(REPLACE ...). Any port using a transformed REF will hit this.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions