conan-docker-tools icon indicating copy to clipboard operation
conan-docker-tools copied to clipboard

Mount conan cache folder in windows docker?

Open NukeBird opened this issue 5 years ago • 4 comments

Description of Problem, Request, or Question

Environment Details

  • Conan Docker Tools image: conanio/clang11:latest
  • Operating System: Windows
  • Operation System Version: 10

Steps to reproduce (Include if Applicable)

function build {
    if [[ -z "$1" || -z "$2" ]]; 
        then echo Invalid parameters && return -1
    fi

    winpty docker run -it --rm -v/$(pwd):/project -v/${CONAN_HOME}:/home/conan/.conan $1 bash -c "cd /project && rm -rf $2 && mkdir $2 && cd $2 && conan install .. --build=missing && cmake .. && cmake --build ."
}

(${CONAN_HOME} is mounted properly, I can see how files appear there) (if I remove -v/${CONAN_HOME}:/home/conan/.conan everything builds fine)

build conanio/clang11 test3

conanfile.txt is

[requires]
assimp/5.0.1
glm/0.9.9.8
stb/20200203

[generators]
cmake

Build logs (Include if Available)

$ build conanio/clang11 test3
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=clang
compiler.libcxx=libstdc++
compiler.version=11
os=Linux
os_build=Linux
[options]
[build_requires]
[env]

irrxml/1.2: WARN: Package is corrupted, removing folder: /home/conan/.conan/data
/irrxml/1.2/_/_/package/a16e582b6208f9dcfa44325507b9c20f9157bfc7
conanfile.txt: Installing package
Requirements
    assimp/5.0.1 from 'conan-center' - Cache
    glm/0.9.9.8 from 'conan-center' - Cache
    irrxml/1.2 from 'conan-center' - Cache
    stb/20200203 from 'conan-center' - Cache
    zlib/1.2.11 from 'conan-center' - Cache
Packages
    assimp/5.0.1:92856d0da46febfe2b1b8730c45f6d639e8a7bc1 - Build
    glm/0.9.9.8:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    irrxml/1.2:a16e582b6208f9dcfa44325507b9c20f9157bfc7 - Build
    stb/20200203:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    zlib/1.2.11:d988447fa516eac7400b2f34e2d4b89e42b4b1a8 - Build

Installing (downloading, building) binaries...
glm/0.9.9.8: Already installed!
irrxml/1.2: WARN: Build folder is dirty, removing it: /home/conan/.conan/data/ir
rxml/1.2/_/_/build/a16e582b6208f9dcfa44325507b9c20f9157bfc7
irrxml/1.2: WARN: Trying to remove corrupted source folder
irrxml/1.2: WARN: This can take a while for big packages
irrxml/1.2: Configuring sources in /home/conan/.conan/data/irrxml/1.2/_/_/source
Downloading irrxml-1.2.zip  : 100%|##########| 84.4k/84.4k [00:00<00:00, 597kB/s

Downloading irrxml-1.2.zip completed [84.44k]


Unzipping 157.5KB, this can take a while
Unzipping 100 %
ERROR: irrxml/1.2: Error in source() method, line 33
        os.rename(extracted_folder, self._source_subfolder)
        FileNotFoundError: [Errno 2] No such file or directory: 'irrxml-1.2' ->
'source_subfolder'

NukeBird avatar Oct 20 '20 14:10 NukeBird

I'm using Git Bash

NukeBird avatar Oct 20 '20 14:10 NukeBird

Do you use short_paths? It may be a problem, as it then points to C:.conan instead of conan home

AndreyMlashkin avatar Jul 19 '21 08:07 AndreyMlashkin

I run windows container on a windows host and if I set the CONAN_USER_HOME inside the mount folder the conan builds gives an error -- Detecting C compiler ABI info - failed Set the CONAN_USER_HOME anywhere else inside the container and it works For sure the CONAN_USER_HOME_SHORT=None to disable short paths Might be related to your issue https://gitlab.kitware.com/cmake/cmake/-/issues/18600

SirCosty avatar Feb 14 '22 01:02 SirCosty

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 25 '22 21:05 stale[bot]

This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.

stale[bot] avatar Sep 08 '22 19:09 stale[bot]