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

Why is SDL2 being installed when I dont depend on it? #23

Open
jonatino opened this issue Jun 13, 2024 · 1 comment
Open

Why is SDL2 being installed when I dont depend on it? #23

jonatino opened this issue Jun 13, 2024 · 1 comment

Comments

@jonatino
Copy link

jonatino commented Jun 13, 2024

I'm just trying to get the opencv4 vcpkg.

[package.metadata.vcpkg]
git = "https://github.com/microsoft/vcpkg"
rev = "94a50e8"
dependencies = ["opencv4[contrib,nonfree]"]

[package.metadata.vcpkg.target]
x86_64-pc-windows-msvc = { triplet = "x64-windows-static-md" }

But for some reason when running cargo vcpkg build, it always trys to install sdl2?

> cargo vcpkg build
     Cloning https://github.com/microsoft/vcpkg
    Checkout rev 94a50e8
   Compiling vcpkg
  Installing sdl2 opencv4[contrib,nonfree]
@jonatino
Copy link
Author

jonatino commented Jun 14, 2024

Did some more debugging and enabled some previously commented out dbg! statements. Initially, I used the example from the README.md and I ran the cargo vcpkg build command then after a few seconds Ctrl+C to cancel it. Then I switched the dependencies to the ones I want, but for some reason it seemed like my first example with the sdl2 from the README is still cached somehow in metadata? I've tried to delete Cargo.lock file but it does not fix the issue.

Here is the print statement from https://github.com/mcgoo/cargo-vcpkg/blob/master/src/main.rs#L344

[src\main.rs:339:5] &metadata.workspace_metadata = Null
[src\main.rs:344:13] &v = Metadata {
    vcpkg: Vcpkg {
        target: {
            "x86_64-pc-windows-msvc": Target {
                triplet: Some(
                    "x64-windows-static-md",
                ),
                dependencies: None,
                dev_dependencies: None,
            },
        },
        branch: None,
        rev: Some(
            "261c458af6e3eed5d099144aff95d2b5035f656b",
        ),
        git: Some(
            "https://github.com/microsoft/vcpkg",
        ),
        tag: None,
        dependencies: Some(
            [
                "sdl2",
            ],
        ),
        dev_dependencies: Some(
            [
                "sdl2",
                "sdl2-image[libjpeg-turbo,tiff,libwebp]",
                "sdl2-ttf",
                "sdl2-gfx",
                "sdl2-mixer",
            ],
        ),
        overlay_triplets_path: None,
        build_type: None,
    },
}
[src\main.rs:344:13] &v = Metadata {
    vcpkg: Vcpkg {
        target: {
            "x86_64-pc-windows-msvc": Target {
                triplet: Some(
                    "x64-windows-static",
                ),
                dependencies: Some(
                    [
                        "opencv4[contrib,nonfree]",
                    ],
                ),
                dev_dependencies: None,
            },
        },
        branch: None,
        rev: Some(
            "94a50e8",
        ),
        git: Some(
            "https://github.com/microsoft/vcpkg",
        ),
        tag: None,
        dependencies: None,
        dev_dependencies: None,
        overlay_triplets_path: None,
        build_type: None,
    },
}

The first print was the example I copied and I Ctrl+C'ed mid run and the second is the actual metadata from my project.

Hopefully that helps.

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

No branches or pull requests

1 participant