Skip to content

[package] swig/4.0.2: SWIG_DIR (swiglib) is wrong on mac and points to the build machine #8674

@jmarrec

Description

@jmarrec

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: swig/4.0.2
  • Operating System+version: macOS
  • Compiler+version: apple-clang 11 12 13
  • Conan version: conan 1.44.0
  • Python version: Python 3.8

Steps to reproduce (Include if Applicable)

Using swig/4.0.2 revision 187cec21277aafbeae11dcc3b936ce74,

find_package(SWIG REQUIRED)
message(STATUS "FOUND SWIG_EXECUTABLE=${SWIG_EXECUTABLE}, SWIG_DIR=${SWIG_DIR}")

On Ubuntu and Windows this is just fine. it does output the correct SWIG_DIR

 -- Found SWIG: /home/conan/.conan/data/swig/4.0.2/_/_/package/ecb2d71ae4bad3b51dade00ec89140273402b5d7/bin/swig (found version "4.0.2")  
-- FOUND SWIG_EXECUTABLE=/home/conan/.conan/data/swig/4.0.2/_/_/package/ecb2d71ae4bad3b51dade00ec89140273402b5d7/bin/swig, SWIG_DIR=/home/conan/.conan/data/swig/4.0.2/_/_/package/ecb2d71ae4bad3b51dade00ec89140273402b5d7/bin/swiglib

https://github.com/NREL/conan-openstudio-ruby/runs/4740291834?check_suite_focus=true#step:5:3005


on macOS, it outputs a wrong path that's on the build machine

swig/4.0.2: Downloaded recipe revision 187cec21277aafbeae11dcc3b936ce74
[....]

-- Found SWIG: /Users/runner/.conan/data/swig/4.0.2/_/_/package/099d7b9cd06e9bd11e92b9a2ddf3b29cd986fdcb/bin/swig (found version "4.0.2")  
-- FOUND SWIG_EXECUTABLE=/Users/runner/.conan/data/swig/4.0.2/_/_/package/099d7b9cd06e9bd11e92b9a2ddf3b29cd986fdcb/bin/swig, SWIG_DIR=/Users/jenkins/w/BuildSingleReference@3/.conan/data/swig/4.0.2/_/_/package/099d7b9cd06e9bd11e92b9a2ddf3b29cd986fdcb/bin/swiglib

cf: https://github.com/NREL/conan-openstudio-ruby/runs/4740291938?check_suite_focus=true#step:5:3127

That cmake variable could be fixed by just doing SWIG_EXECUTABLE + "/swiglib" but the main problem is that the swig exe points to the wrong swig lib so any call to the exe would need to set the env variable SWIG_LIB (via ${CMAKE_COMMAND} -E env SWIG_LIB="${SWIG_EXECUTABLE}/swiglib" for eg)

Logs (Include/Attach if Applicable)

Cf the github actions run I linked to above

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions