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

stduuid: fix conditional dependency on ms-gsl #20499

Merged
merged 5 commits into from
Oct 11, 2023

Conversation

Ahajha
Copy link
Contributor

@Ahajha Ahajha commented Oct 10, 2023

Specify library name and version: stduuid/all

See #20360

In this PR:

  • Stop propagating the ms-gsl include directory - this caused all consumers to use the wrong header file when doing #include <span> (note from @jcar87: recipes should not propagate paths to other libraries in package info).

  • Fix conditional for check_min_cppstd in validate() method - it was not checking anything due to a typo

  • Remove option with_cxx20_span for version 1.0: it's not an option, it is unconditionally assumed regardless of version of C++ standard.

  • When cppstd is defined as is greater or equal than 20, conditionally set the default value of option with_cxx20_span to True and assume is available

  • Patch uuid.h in such a way that if the recipe logic determines that ms-gsl is a dependency, the gsl header is included and its types are used - rather than leave this to chance by doing compiler macro introspection (see issue Regression: lib doesn't build with GCC 10 with c++20 anymore mariusbancila/stduuid#80) -

Close #20360

Testing:

Tested the following on Linux with gcc 12 (and compiler.cppstd=gnu17 by default unless mentioned):

conan create . --version=1.0                                                                    => uses ms-gsl, test_package succeeds
conan create . --version=1.0 -s compiler.cppstd=20                                              => uses ms-gsl, test_package succeeds
conan create . --version=1.2.2 -s compiler.cppstd=17                                            => uses ms-gsl, test_package succeeds
conan create . --version=1.2.2 -s compiler.cppstd=20                                            => does *not* use ms-gsl, test_package succeeds
conan create . --version=1.2.2 -s compiler.cppstd=20 -o "stduuid/*:with_cxx20_span=False"       => uses ms-gsl, test_package succeeds
conan create . --version=1.2.3 -s compiler.cppstd=17                                            => uses ms-gsl, test_package succeeds
conan create . --version=1.2.3 -s compiler.cppstd=20                                            => does *not* use ms-gsl, test_package succeeds
conan create . --version=1.2.3 -s compiler.cppstd=20 -o "stduuid/*:with_cxx20_span=False"       => uses ms-gsl, test_package succeeds

@CLAassistant
Copy link

CLAassistant commented Oct 10, 2023

CLA assistant check
All committers have signed the CLA.

@conan-center-bot

This comment has been minimized.

@jcar87 jcar87 self-assigned this Oct 10, 2023
@jcar87 jcar87 changed the title Stduuid fix stduuid: fix conditional dependency on ms-gsl Oct 10, 2023
@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 4 (cfb173e5292123d49cc904954db7f4917715ebe7):

  • stduuid/1.2.3:
    All packages built successfully! (All logs)

  • stduuid/1.2.2:
    All packages built successfully! (All logs)

  • stduuid/1.0:
    All packages built successfully! (All logs)


Conan v2 pipeline ✔️

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

All green in build 4 (cfb173e5292123d49cc904954db7f4917715ebe7):

  • stduuid/1.0:
    All packages built successfully! (All logs)

  • stduuid/1.2.2:
    All packages built successfully! (All logs)

  • stduuid/1.2.3:
    All packages built successfully! (All logs)

@conan-center-bot conan-center-bot merged commit bb3c48a into conan-io:master Oct 11, 2023
5 checks passed
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.

[package] stduuid: Under default config, breaks any time std::span is used
5 participants