8000 conflict between gsl-lite and ms-gsl · Issue #39699 · microsoft/vcpkg · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

conflict between gsl-lite and ms-gsl #39699

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

Open
dg0yt opened this issue Jul 5, 2024 · 8 comments
Open

conflict between gsl-lite and ms-gsl #39699

dg0yt opened this issue Jul 5, 2024 · 8 comments
Assignees
Labels
category:question This issue is a question

Comments

@dg0yt
Copy link
Contributor
dg0yt commented Jul 5, 2024

Do I understand correctly that we already have two alternative implmentations of the GSL which cannot be used at the same time?

Yes. Both ms-gsl and gsl-lite define things under the gsl namespace, which causes type conflicts and ODR violations.

Originally posted by @wongjk in #39619 (comment)

@dg0yt
Copy link
Contributor Author
dg0yt commented Jul 5, 2024

Both ports exists since 2017.
ms-gsl has 6 uses in vcpkg.
gsl-lite has 4 uses in vcpkg.

@jimwang118 jimwang118 added the category:question This issue is a question label Jul 5, 2024
@jimwang118
Copy link
Contributor

Confirm that there is a header file conflict.

Copy link

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

@github-actions github-actions bot added the Stale label Aug 10, 2024
@dg0yt
Copy link
Contributor Author
dg0yt commented Aug 10, 2024

Not stale.

@github-actions github-actions bot removed the Stale label Aug 11, 2024
@mbeutel
Copy link
Contributor
mbeutel commented Nov 13, 2024

Maintainer of gsl-lite here. I am aware of this problem and plan to resolve this by renaming our namespace to gsl_lite so we can coexist with M-GSL.

The new namespace has already been available as opt-in for some time, cf. https://github.com/gsl-lite/gsl-lite?tab=readme-ov-file#using-gsl-lite-in-libraries, so if you use gsl-lite, please use version-1 defaults, include <gsl-lite/gsl-lite.hpp> and use namespace gsl_lite rather than gsl (define a local namespace alias gsl in your own namespace if desired). Moving our definitions over to the new namespace will be an ABI-breaking change, which is why I have been procrastinating it for a while.

@dg0yt
Copy link
Contributor Author
dg0yt commented Nov 13, 2024

vcpkg is based on building from source and tracking source and configuration changes (via "ABI hashes"). Changing ABI is not so much an issue here.

@mbeutel
Copy link
Contributor
mbeutel commented Nov 13, 2024

Thanks – I am familiar with Vcpkg, and of course you're right that ABI compatibility is not much of a concern here. But it may be for users of gsl-lite outside Vcpkg; we always have been very careful with breaking changes. The next major-version release will introduce several breaking changes (most of them through flipping the default for a configuration option, so everyone who already opted in to version-1 defaults should not notice a thing). I intend to take this opportunity to also introduce the inevitable ABI break.

I acknowledge that this should have happened much sooner. One of the things that held me back from finally changing the namespace was that I sort of kept hoping for a resolution to isocpp/CppCoreGuidelines#1519. But after five years without reply I think we'd better follow our own judgement, even if that separates us from Rome forever.

@mbeutel
Copy link
Contributor
mbeutel commented May 28, 2025

gsl-lite v1.0 migrated to namespace gsl_lite and is compatible with Microsoft GSL. Vcpkg has now updated to gsl-lite v1.0.1 (#45612), so I consider this issue resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

3 participants
0