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

Fix doubled warnings being printed for manifest warnings when loading ports. #1466

Merged

Conversation

BillyONeal
Copy link
Member

@BillyONeal BillyONeal commented Jul 30, 2024

Resolves microsoft/vcpkg#24084
Resolves microsoft/vcpkg#34095

The root cause of this bug is the separation between the BaselineProvider and the PortfileProvider. For the built in registry, to determine what the baseline version for the builtin registry is, we must load and parse the requested port to read what version is declared in its JSON/CONTROL file. However, the interface by which the registry tells the calling code what to do passed only the directory with the port inside:

    struct RegistryEntry
    {
        // This forces BuiltinRegistry to parse the JSON/CONTROL
        virtual ExpectedL<View<Version>> get_port_versions() const = 0;
 
        // This forces the caller to parse the JSON/CONTROL
        virtual ExpectedL<PortLocation> get_version(const Version& version) const = 0;
 
        virtual ~RegistryEntry() = default;
    };

Thus, callers were forced to parse the files again, causing reemission of any warnings like bad SPDX expressions.

The fix is to push the parsing of the port files into RegistryEntry so that the builtin registry can return a clone of the file it already parsed, rather than getting it to be parsed again.

src/vcpkg/registries.cpp Outdated Show resolved Hide resolved
@BillyONeal BillyONeal merged commit 33fe38d into microsoft:main Aug 3, 2024
6 checks passed
@BillyONeal BillyONeal deleted the double-format-manifest-warnings branch August 3, 2024 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants