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

[vcpkg-tool] New field "conflicts" for vcpkg.json-manifest #44080

Open
Agorath opened this issue Feb 28, 2025 · 0 comments
Open

[vcpkg-tool] New field "conflicts" for vcpkg.json-manifest #44080

Agorath opened this issue Feb 28, 2025 · 0 comments
Assignees
Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed

Comments

@Agorath
Copy link
Contributor

Agorath commented Feb 28, 2025

The vcpkg.json manifest needs a new field to specify whether a port conflicts with another port and cannot be built alongside it or vice versa.

Please review the discussion in #44023 to see why this issue arose.

To summarise, SDL3 is superseding SDL2. The team behind SDL has thus provided a drop-in replacement for SDL2 legacy applications, which uses SDL3 behind the scenes to make migration easier. As SDL2-compat is meant as a drop-in replacement for SDL2, its CMakeLists.txt places header files with the same name in the same directories and defines the library with the same name (SDL2::SDL2) as SDL2 does. Thus, the ports sdl2 and sdl2-compat can't be built next to each other.

One suggestion by @Cheney-W to achieve mutual exclusivity was to modify the portfiles of both ports to detect whether the other was also built, as has been done for other conflicting ports. But as @dg0yt pointed out in his comment this won't work in all cases.

I would thus like to suggest adding a new field, i.e. conflicts, to the vcpkg.json-manifest. It could look like the following:

{
    "name": "portZ",
    "version": "1.0.0",
    "dependencies": [],
    "conflicts": [
        "portX",
        "portY"
    ]
}

This way, a port can specify that it conflicts with another port, preventing conflicting ports from being built next to each other.

What do you think about this? Is this a valid approach for vcpkg or am I missing something?
If this approach is feasible, I would volunteer to try implementing this new feature and opening a pull request for vcpkg-tool when I'm done.

Looking forward to your feedback. 🙂

@Cheney-W Cheney-W self-assigned this Feb 28, 2025
@Cheney-W Cheney-W added the category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed
Projects
None yet
Development

No branches or pull requests

3 participants