Skip to content

libsodium: conan2 compatibility with msvc #14959

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

Closed
wants to merge 5 commits into from

Conversation

danimtb
Copy link
Member

@danimtb danimtb commented Dec 27, 2022

A small detail to make the recipe fully compatible as the comparison if self.settings.compiler == "Visual Studio" is not allowed on conan 2 because "Visual Studio" is not among the valid values for settings

@conan-center-bot

This comment has been minimized.

prince-chrismc
prince-chrismc previously approved these changes Dec 27, 2022
Comment on lines 110 to 111
def _msvc_sln_folder(self):
if self.settings.compiler == "Visual Studio":
if self.settings.compiler == "msvc":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this works because this function is never called with mac/linux compilers 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right 🙃

@@ -118,7 +108,13 @@ def source(self):

@property
def _msvc_sln_folder(self):
if self.settings.compiler == "Visual Studio":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess str(self.settings.compiler) == "Visual Studio" would also work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably so

Copy link
Contributor

@SpaceIm SpaceIm Dec 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are other checks like that afterwards, so it requires more modifications in this method.

Copy link
Contributor

@SpaceIm SpaceIm Dec 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would replace by something like this:

    @property
    def _msvc_sln_folder(self):
        sln_folders = {
            "Visual Studio": {
                "10": "vs2010",
                "11": "vs2012",
                "12": "vs2013",
                "14": "vs2015",
                "15": "vs2017",
                "16": "vs2019",
            },
            "msvc": {
                "170": "vs2012",
                "180": "vs2013",
                "190": "vs2015",
                "191": "vs2017",
                "192": "vs2019",
            }
        }
        if self.version != "1.0.18":
            sln_folders["Visual Studio"]["17"] = "vs2022"
            sln_folders["msvc"]["193"] = "vs2022"

        backup_folder = "vs2022" if self.version != "1.0.18" else "vs2019"

        return sln_folders.get(str(self.settings.compiler), {}).get(str(self.settings.compiler.version), backup_folder)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely right, I did this quickly and didn't check it further. Thank you for the code suggestion

@danimtb danimtb changed the title libsoidum: conan2 compatibility with msvc libsodium: conan2 compatibility with msvc Dec 29, 2022
@SpaceIm
Copy link
Contributor

SpaceIm commented Dec 29, 2022

This recipe has many issues in its Visual Studio branch anyway since its migration to conan v2, it needs far more love or improvement in MSBuild helper from conan client.

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline

All green in build 6 (36cf9e6dc9a4b4b5d121d2b8d8faaf029d55bbe0):

  • libsodium/cci.20220430@:
    All packages built successfully! (All logs)

  • libsodium/1.0.18@:
    All packages built successfully! (All logs)


Conan v2 pipeline (informative, not required for merge)

Failure in build 6 (36cf9e6dc9a4b4b5d121d2b8d8faaf029d55bbe0):

  • libsodium/1.0.18@:
    CI failed to create some packages (All logs)

    Logs for packageID 37528097d0726778529e8dd34f4e73ec2f157344:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=apple-clang
    compiler.libcxx=libc++
    compiler.version=13
    os=Macos
    [options]
    */*:shared=False
    
    ********************************************************************************
    conan install --require=libsodium/1.0.18@#3515a4e8f2e5c1ef9f6bf4648fc71f9e --build=libsodium/1.0.18 -pr:h /Users/jenkins/w/prod-v2/BuildSingleReference/7055/1e20b378-d766-4d3b-9607-11a8cf893978/profile_osx_13_libcpp_apple-clang_release_64.-shared-False.txt -c:h tools.system.package_manager:mode=install -c:h tools.system.package_manager:sudo=True -c:h tools.apple:sdk_path=/Applications/conan/xcode/13.0/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -pr:b /Users/jenkins/w/prod-v2/BuildSingleReference/7055/1e20b378-d766-4d3b-9607-11a8cf893978/profile_osx_13_libcpp_apple-clang_release_64.-shared-False.txt -c:b tools.system.package_manager:mode=install -c:b tools.system.package_manager:sudo=True -c:b tools.apple:sdk_path=/Applications/conan/xcode/13.0/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk
    ********************************************************************************
    ERROR: /Users/jenkins/w/prod-v2/BuildSingleReference/extensions/plugins/profile.py not found!
    
  • libsodium/cci.20220430@:
    Didn't run or was cancelled before finishing


Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

@ghost
Copy link

ghost commented Dec 29, 2022

I detected other pull requests that are modifying libsodium/all recipe:

This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there.

@SpaceIm
Copy link
Contributor

SpaceIm commented Dec 29, 2022

I've submitted another PR with more fixes: #14998

@danimtb
Copy link
Member Author

danimtb commented Jan 2, 2023

closing this one then, as #14998 already contained this fix. Thank you!

@danimtb danimtb closed this Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants