{"action":"created","issue":{"url":"https://api.github.com/repos/conan-io/conan/issues/4768","repository_url":"https://api.github.com/repos/conan-io/conan","labels_url":"https://api.github.com/repos/conan-io/conan/issues/4768/labels{/name}","comments_url":"https://api.github.com/repos/conan-io/conan/issues/4768/comments","events_url":"https://api.github.com/repos/conan-io/conan/issues/4768/events","html_url":"https://github.com/conan-io/conan/issues/4768","id":422690526,"node_id":"MDU6SXNzdWU0MjI2OTA1MjY=","number":4768,"title":"conan test_package with static library","user":{"login":"danielhalati","id":16553732,"node_id":"MDQ6VXNlcjE2NTUzNzMy","avatar_url":"https://avatars0.githubusercontent.com/u/16553732?v=4","gravatar_id":"","url":"https://api.github.com/users/danielhalati","html_url":"https://github.com/danielhalati","followers_url":"https://api.github.com/users/danielhalati/followers","following_url":"https://api.github.com/users/danielhalati/following{/other_user}","gists_url":"https://api.github.com/users/danielhalati/gists{/gist_id}","starred_url":"https://api.github.com/users/danielhalati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielhalati/subscriptions","organizations_url":"https://api.github.com/users/danielhalati/orgs","repos_url":"https://api.github.com/users/danielhalati/repos","events_url":"https://api.github.com/users/danielhalati/events{/privacy}","received_events_url":"https://api.github.com/users/danielhalati/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"memsharded","id":15367152,"node_id":"MDQ6VXNlcjE1MzY3MTUy","avatar_url":"https://avatars2.githubusercontent.com/u/15367152?v=4","gravatar_id":"","url":"https://api.github.com/users/memsharded","html_url":"https://github.com/memsharded","followers_url":"https://api.github.com/users/memsharded/followers","following_url":"https://api.github.com/users/memsharded/following{/other_user}","gists_url":"https://api.github.com/users/memsharded/gists{/gist_id}","starred_url":"https://api.github.com/users/memsharded/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/memsharded/subscriptions","organizations_url":"https://api.github.com/users/memsharded/orgs","repos_url":"https://api.github.com/users/memsharded/repos","events_url":"https://api.github.com/users/memsharded/events{/privacy}","received_events_url":"https://api.github.com/users/memsharded/received_events","type":"User","site_admin":false},"assignees":[{"login":"memsharded","id":15367152,"node_id":"MDQ6VXNlcjE1MzY3MTUy","avatar_url":"https://avatars2.githubusercontent.com/u/15367152?v=4","gravatar_id":"","url":"https://api.github.com/users/memsharded","html_url":"https://github.com/memsharded","followers_url":"https://api.github.com/users/memsharded/followers","following_url":"https://api.github.com/users/memsharded/following{/other_user}","gists_url":"https://api.github.com/users/memsharded/gists{/gist_id}","starred_url":"https://api.github.com/users/memsharded/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/memsharded/subscriptions","organizations_url":"https://api.github.com/users/memsharded/orgs","repos_url":"https://api.github.com/users/memsharded/repos","events_url":"https://api.github.com/users/memsharded/events{/privacy}","received_events_url":"https://api.github.com/users/memsharded/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2019-03-19T11:53:14Z","updated_at":"2019-03-20T12:14:00Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI don't know if this is a real issue or it's just me now knowing to deal with conan very well. I am using conan to pack some precompiled binary packages. The binary packages can be shared, static or headeronly.\r\n\r\n```\r\nimport os\r\nfrom conans import ConanFile, CMake, tools\r\n\r\nclass Package(ConanFile):\r\n    name = '$name'\r\n    version = '$version'\r\n    license = '''$license'''\r\n    url = '$url'\r\n    description = '$description'\r\n    settings = 'os', 'compiler', 'build_type', 'arch'\r\n    options = {'Type': ['shared', 'static', 'headeronly']}\r\n    default_options = 'Type=shared'\r\n    generators = 'cmake'\r\n    \r\n    def package_info(self):\r\n        self.cpp_info.libs = tools.collect_libs(self)\r\n```\r\n\r\nThis is how my conanfile.py looks like. I have some python script wrapper over the conan create command which will provide the arguments as necessary for this recipe. Everything is great at this point. The package is created as expected.\r\n\r\nThe issue that I encounter is with the testing package:\r\n\r\n```\r\nimport os\r\nimport shutil\r\nfrom conans import ConanFile, CMake\r\n\r\nclass TestPackage(ConanFile):\r\n    options = {'Type': ['shared', 'static', 'headeronly']}\r\n    default_options = 'Type=shared'\r\n    generators = 'cmake'\r\n    \r\n    def build(self):\r\n        cmake = CMake(self)\r\n        cmake.configure()\r\n        cmake.build()\r\n\r\n    def imports(self):\r\n        self.copy('*.dll', dst='bin', src='bin')\r\n        self.copy('*.so*', dst='bin', src='lib')\r\n\r\n    def test(self):\r\n        os.chdir('bin')\r\n        self.run('.%sexample' % os.sep)\r\n```\r\n\r\nWhen I create a package where Type option is set to static, the test package still look for the package where the option is set as shared. \r\n\r\nWhat am I doing wrong here? I am calling conan test_package with the same settings and options as I called conan create for the other recipe.\r\n"},"comment":{"url":"https://api.github.com/repos/conan-io/conan/issues/comments/474803836","html_url":"https://github.com/conan-io/conan/issues/4768#issuecomment-474803836","issue_url":"https://api.github.com/repos/conan-io/conan/issues/4768","id":474803836,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3NDgwMzgzNg==","user":{"login":"danielhalati","id":16553732,"node_id":"MDQ6VXNlcjE2NTUzNzMy","avatar_url":"https://avatars0.githubusercontent.com/u/16553732?v=4","gravatar_id":"","url":"https://api.github.com/users/danielhalati","html_url":"https://github.com/danielhalati","followers_url":"https://api.github.com/users/danielhalati/followers","following_url":"https://api.github.com/users/danielhalati/following{/other_user}","gists_url":"https://api.github.com/users/danielhalati/gists{/gist_id}","starred_url":"https://api.github.com/users/danielhalati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielhalati/subscriptions","organizations_url":"https://api.github.com/users/danielhalati/orgs","repos_url":"https://api.github.com/users/danielhalati/repos","events_url":"https://api.github.com/users/danielhalati/events{/privacy}","received_events_url":"https://api.github.com/users/danielhalati/received_events","type":"User","site_admin":false},"created_at":"2019-03-20T12:14:00Z","updated_at":"2019-03-20T12:14:00Z","author_association":"NONE","body":"I have another issue on Linux right now: Linux distribution is OpenSUSE 42.1\r\n\r\n```\r\nRunning CreateBuildPkg\r\nExporting conan package ... \r\nconan export-pkg /home/user/Desktop/Projects/conan/zlib/conan zlib/1.2.8@daniel/stable -s os=Linux -s arch=x86_64 -s build_type=Debug -o shared=True -pf /home/user/Desktop/Projects/conan/_Sandbox_BUILD/zlib/stage/zlib-1.2.8 --force --profile /home/user/Desktop/Toolchain/profiles/x86_64-Linux\r\n\r\nWARN: Migration: Generating missing metadata files\r\nMigration: Generating missing metadata files finished OK!\r\n\r\n/usr/lib/python2.7/site-packages/conans/util/fallbacks.py:9: UserWarning: Provide the output argument explicitly to function 'conans.client.tools.files.replace_in_file'\r\n  warnings.warn(\"Provide the output argument explicitly{}\".format(fn_str))\r\nWARN: replace_in_file didn't find pattern '[plugins]' in '/home/user/.conan/conan.conf' file.\r\n\r\nPython 2 will soon be deprecated. It is strongly recommended to use Python 3 with Conan:\r\nhttps://docs.conan.io/en/latest/installation.html#python-2-deprecation-notice\r\n\r\nExporting package recipe\r\nLinter warnings\r\n    WARN: Linter. Line 1: Unused import os\r\n    WARN: Linter. Line 2: Unused CMake imported from conans\r\nzlib/1.2.8@daniel/stable: The stored package has not changed\r\nzlib/1.2.8@daniel/stable: WARN: Forced build from source\r\nPackaging to fec28e58d9bbccca4f42312b1b480aeea3055453\r\nzlib/1.2.8@daniel/stable: Exporting to cache existing package from user folder\r\nzlib/1.2.8@daniel/stable: Package folder /home/user/.conan/data/zlib/1.2.8/wenglor/stable/package/fec28e58d9bbccca4f42312b1b480aeea3055453\r\nzlib/1.2.8@daniel/stable: Packaged 1 '.8' file: libz.so.1.2.8\r\nzlib/1.2.8@daniel/stable: Packaged 2 '.h' files: zconf.h, zlib.h\r\nzlib/1.2.8@daniel/stable: Packaged 1 '.1' file: libz.so.1\r\nzlib/1.2.8@daniel/stable: Packaged 1 '.so' file: libz.so\r\nzlib/1.2.8@daniel/stable: Package 'fec28e58d9bbccca4f42312b1b480aeea3055453' created\r\nTesing conan package ... \r\nconan test /home/user/Desktop/Projects/conan/zlib/conan/test_package zlib/1.2.8@daniel/stable -s os=Linux -s arch=x86_64 -s build_type=Debug -o zlib:shared=True\r\n\r\n\r\nPython 2 will soon be deprecated. It is strongly recommended to use Python 3 with Conan:\r\nhttps://docs.conan.io/en/latest/installation.html#python-2-deprecation-notice\r\n\r\nConfiguration:\r\n[settings]\r\narch=x86_64\r\narch_build=x86_64\r\nbuild_type=Debug\r\ncompiler=gcc\r\ncompiler.libcxx=libstdc++\r\ncompiler.version=4.8\r\nos=Linux\r\nos_build=Linux\r\n[options]\r\nzlib:shared=True\r\n[build_requires]\r\n[env]\r\n\r\nzlib/1.2.8@daniel/stable (test package): Installing package\r\nRequirements\r\n    zlib/1.2.8@daniel/stable from local cache - Cache\r\nPackages\r\n    zlib/1.2.8@daniel/stable:f275daa1df80eb173d418881c6b9b9a548f4fe88 - Missing\r\n\r\nzlib/1.2.8@daniel/stable: WARN: Can't find a 'zlib/1.2.8@daniel/stable' package for the specified settings, options and dependencies:\r\n- Settings: arch=x86_64, build_type=Debug, compiler=gcc, compiler.libcxx=libstdc++, compiler.version=4.8, os=Linux\r\n- Options: shared=True\r\n- Dependencies: \r\n- Package ID: f275daa1df80eb173d418881c6b9b9a548f4fe88\r\n\r\nERROR: Missing prebuilt package for 'zlib/1.2.8@daniel/stable'\r\nTry to build it from sources with \"--build zlib\"\r\nOr read \"http://docs.conan.io/en/latest/faq/troubleshooting.html#error-missing-prebuilt-package\"\r\n\r\n```"}}
{"actor":{"display_login":"danielhalati"}}