Skip to content
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

Delete BuildInfo::version. #1259

Closed

Conversation

BillyONeal
Copy link
Member

In the only place this was used, create_binary_control_file, the version is passed in via the constructor of BinaryParagraph:

    BinaryParagraph::BinaryParagraph(const SourceParagraph& spgh,
                                     const std::vector<std::string>& default_features,
                                     Triplet triplet,
                                     const std::string& abi_tag,
                                     std::vector<PackageSpec> deps)
        : spec(spgh.name, triplet)
        , version(spgh.raw_version)    // <-- !!!
        , port_version(spgh.port_version)
        , description(spgh.description)
        , maintainers(spgh.maintainers)
        , feature()
        , default_features(default_features)
        , dependencies(std::move(deps))
        , abi(abi_tag)
    {
        canonicalize();
    }

In the only place this was used, create_binary_control_file, the version is passed in via the constructor of BinaryParagraph:

```�    BinaryParagraph::BinaryParagraph(const SourceParagraph& spgh,
                                     const std::vector<std::string>& default_features,
                                     Triplet triplet,
                                     const std::string& abi_tag,
                                     std::vector<PackageSpec> deps)
        : spec(spgh.name, triplet)
        , version(spgh.raw_version)
        , port_version(spgh.port_version)
        , description(spgh.description)
        , maintainers(spgh.maintainers)
        , feature()
        , default_features(default_features)
        , dependencies(std::move(deps))
        , abi(abi_tag)
    {
        canonicalize();
    }
```
@@ -617,10 +616,7 @@ namespace vcpkg
action.spec.triplet(),
action.public_abi(),
fspecs_to_pspecs(find_itr->second));
if (const auto p_ver = build_info.version.get())
{
bpgh.version = *p_ver;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This records the fetched source version when users use --head: https://github.com/microsoft/vcpkg/blob/0e2a0e0ad1a370f85a637452be52e2ddf2dcac0b/scripts/build_info.cmake#L44-L46

Arguably this should probably be a combination (+=) and not a replacement

@BillyONeal BillyONeal marked this pull request as draft October 31, 2023 23:55
@BillyONeal BillyONeal closed this Nov 1, 2023
BillyONeal added a commit to BillyONeal/vcpkg-tool that referenced this pull request Nov 1, 2023
@BillyONeal BillyONeal deleted the delete-build-info-version branch November 1, 2023 03:39
BillyONeal added a commit that referenced this pull request Nov 3, 2023
* Add test case for the recording head version feature noted in #1259 (comment)

* Sanitize detected head versions to make sure they are at least version-strings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants