conan-io / conan-package-tools

Conan Package Tools. Helps with massive package creation and CI integration (Travis CI, Appveyor...)
MIT License
166 stars 71 forks source link

run in docker build, wrong 'cmd' seleced. #376

Closed Mingyiz closed 5 years ago

Mingyiz commented 5 years ago

Description of Problem, Request, or Question

When I build zlib Linux lib on Windows 10 (With Widnows desktop docker), error happend on running command. from the log, the reason is becuase of 'cmd /C' instead of 'bash -c'

I want to know, what's the proper way to solve this issue.

Environment Details

Steps to reproduce (Include if Applicable)

git clone https://github.com/conan-community/conan-zlib set CONAN_USERNAME=edgeos-oss set CONAN_GCC_VERSIONS=5 set CONAN_DOCKER_IMAGE=conanio/gcc5

Build logs (Include if Available)

conan_runner Traceback (most recent call last): File "build.py", line 9, in builder.run() File "C:\Python37\lib\site-packages\cpt\packager.py", line 475, in run self.run_builds(base_profile_name=base_profile_name) File "C:\Python37\lib\site-packages\cpt\packager.py", line 589, in run_builds docker_entry_script=self.docker_entry_script) File "C:\Python37\lib\site-packages\cpt\runner.py", line 236, in run raise Exception("Error updating the image: %s" % command) Exception: Error updating the image: docker run -e CONAN_DOCKER_IMAGE="conanio/gcc5" -e CONAN_GCC_VERSIONS="5" -e CONAN_USERNAME="edgeos-oss" -e CONAN_CHANNEL="stable" -e CONAN_LOGIN_USERNAME="edgeos-oss" -e CONAN_REFERENCE="zlib/1.2.11@edgeos-oss/stable" -e CPT_PROFILE="@@include(default)@@@@[settings]@@arch=x86@@build_type=Release@@compiler=gcc@@compiler.version=5@@[options]@@zlib:shared=True@@[env]@@@@[build_requires]@@@@" -e CONAN_TEMP_TEST_FOLDER="1" -e CPT_UPLOAD_RETRY="3" -e CPT_CONANFILE="conanfile.py" --name conan_runner conanio/gcc5 cmd /C " pip install conan_package_tools==0.26.0 --upgrade --no-cache && pip install conan==1.14.5 --no-cache"

full logs see attached. cpt-zlib.log

uilianries commented 5 years ago

Hi @Mingyiz !

It's a bug. As you are running on Windows, CPT will use cmd automatically because you can run Docker over Windows with Windows docker images.

We need to check if the docker image is Linux based or not.

Compiler commented 5 years ago

Sup

On Tue, Sep 10, 2019 at 17:04 Uilian Ries notifications@github.com wrote:

Hi @Mingyiz https://github.com/Mingyiz !

It's a bug. As you are running on Windows, CPT will use cmd automatically because you can run Docker over Windows with Windows docker images.

We need to check if the docker image is Linux based or not.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/conan-io/conan-package-tools/issues/376?email_source=notifications&email_token=AC7LIQ72EY6ZNT7AXHRMRRLQJADWNA5CNFSM4HK2NH6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6MPSTQ#issuecomment-530118990, or mute the thread https://github.com/notifications/unsubscribe-auth/AC7LIQZUYDFQM7VJBPHMHKLQJADWNANCNFSM4HK2NH6A .

Compiler commented 5 years ago

Reopened via #583

On Tue, Oct 29, 2019 at 11:15 Luis Martinez de Bartolome Izquierdo < notifications@github.com> wrote:

Closed #376 https://github.com/conan-io/conan-package-tools/issues/376 via #405 https://github.com/conan-io/conan-package-tools/pull/405.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/conan-io/conan-package-tools/issues/376?email_source=notifications&email_token=AC7LIQ2XITIQ6RDVRMJXO4TQRBHQRA5CNFSM4HK2NH6KYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOUQIQ7EQ#event-2752581522, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC7LIQ7SPDF7EUPOISZQ353QRBHQRANCNFSM4HK2NH6A .

bredej commented 4 years ago

When using Linux Containers on Docker Desktop for Windows remember to set CONAN_DOCKER_PLATFORM=linux and enable Docker daemon with experimental features in Docker Desktop settings. If you don't want to enable experimental features you can try to set the following instead CONAN_DOCKER_HOME=/home/conan CONAN_DOCKER_SHELL=/bin/bash -c

Linux Containers are the default when installing Docker Desktop for Windows and maybe it should be the same for cpt.

Compiler commented 4 years ago

sounds good dude