conan problems on windows build

I’ve just hit a few snags using the build instructions related to out of date conan references and SSL certificates. In a nutshell I had to:-

use pip to uninstall and then reinstall conan to get the latest version
use conan remote to remove and then add both conancenter and conan-center both of these pointing to
https://center.conan.io rather than previous targets.

After this all was plain sailing ( but slow!)

I seem to be having this or a similar problem. Tried to do the suggested solutions, but I’m still getting errors. Perhaps not the same, or perhaps I didn’t know how to solve the problems. Any help would be appreciated. Here is the cmake output:

ERROR: wxwidgets/3.1.3.2-audacity: Error in source() method, line 168
os.rename(extracted_dir, self._source_subfolder)
PermissionError: [WinError 5] Access is denied: ‘wxWidgets-3.1.3.1-audacity’ → ‘source_subfolder’


CMake Error at cmake-proxies/cmake-modules/conan.cmake:638 (message):
Conan install failed=‘1’
Call Stack (most recent call first):
cmake-proxies/cmake-modules/AudacityDependencies.cmake:255 (conan_cmake_install)
cmake-proxies/cmake-modules/AudacityDependencies.cmake:274 (_conan_install)
CMakeLists.txt:554 (resolve_conan_dependencies)

Thanks

Have you tried uninstalling Conan and then installing the latest version of Conan?

FWTW, I have similar conan errors on Windows:

ERROR: expat/2.2.9@audacity/stable: Error in source() method, line 36
        os.rename(extracted_dir, self._source_subfolder)
        PermissionError: [WinError 5] Access is denied: 'expat-2.2.9' -> 'source_subfolder'
CMake Error at cmake-proxies/cmake-modules/conan.cmake:638 (message):
  Conan install failed='1'
Call Stack (most recent call first):
  cmake-proxies/cmake-modules/AudacityDependencies.cmake:255 (conan_cmake_install)
  cmake-proxies/cmake-modules/AudacityDependencies.cmake:274 (_conan_install)
  CMakeLists.txt:554 (resolve_conan_dependencies)


-- Configuring incomplete, errors occurred!
See also "M:/gh/aud-build/CMakeFiles/CMakeOutput.log".
See also "M:/gh/aud-build/CMakeFiles/CMakeError.log".

Never used conan before, so I don’t know how to debug them. Also, FWTW, this is what got installed through pip

>conan --version
Conan version 1.44.0

Apparently conan suffers from race conditions on Windows that even its devs don’t know how to debug https://github.com/conan-io/conan/issues/5205

Ok, maybe they did manage to fix it in the end, https://github.com/conan-io/conan/pull/8915
but apparently they’ve created a new api for that: tools.rename instead of os.rename.
Whatever Audacity is using (directly or indirectly) is apparently still using the old,
race-prone API os.rename. https://github.com/conan-io/hooks/pull/294

See this post: https://forum.audacityteam.org/t/visual-studio-2019-16-8-3-has-a-bug-open-cmake-unknown-error/60836/1

Filed here https://github.com/audacity/audacity/issues/2430

Disabling the anti-virus or adding an exception for C:\Users<YourUserName>.conan is a temporary workaround. It’s usually the AV that causes rename races, but not the only source, the Windows search indexer can also cause these etc. There’s a special trick to avoid these races, IIRC, which robocopy is using. (I don’t remember the details, but it’s probably discussed in https://youtu.be/uhRWMGBjlO8?t=506)

I’m like 75% sure the problem is that some other process (like the AV) opens a file in that tree without FILE_SHARE_DELETE. https://youtu.be/uhRWMGBjlO8?t=818 Since conan downloads large zip packages with binaries in them, the AV will take a while to finish scanning them, and os.rename will fail in the meantime. Worth noting that I’m not building on the C: drive, which makes some tricks like moving files to %TEMP% fail, because they are non-atomic if you build on a different drive.

Although the cmake managed to build a whole lot after that (I turned off the AV), it still failed for me gain with a different kind of error… :cry:

wxwidgets/3.1.3.2-audacity: WARN: Build folder C:\Users\WR\.conan\data\wxwidgets\3.1.3.2-audacity\_\_\build\137b263629b603e3e9a720b48b59cebe945627db
ERROR: wxwidgets/3.1.3.2-audacity: Error in build() method, line 260
        cmake.build()
        ConanException: Error 1 while executing cmake --build C:\Users\WR\.conan\data\wxwidgets\3.1.3.2-audacity\_\_\build\137b263629b603e3e9a720b48b59cebe945627db\build_subfolder --config Debug -- /m:4 /verbosity:minimal
        CMake Error at cmake-proxies/cmake-modules/conan.cmake:638 (message):
  Conan install failed='1'

This one is different in nature from the os.rename one, looks like some kind of permission problem. I guess I’ll take the invitation to discord for this.

Well, I found the root cause of that myself https://github.com/audacity/audacity/issues/2431 Basically you have to use the x86_64 cross-compiler for now, using the native x64 compiler will fail to compile libmp3lame, at least, and possibly other parts.

Several times. along with python and all the build tools. It stops at the same place every time.


wxwidgets/3.1.3.1-audacity:
Configuring sources in C:\Users\Mike.conan\data\wxwidgets\3.1.3.1-audacity__\source



ERROR: wxwidgets/3.1.3.1-audacity: Error in source() method, line 164
os.rename(extracted_dir, self._source_subfolder)
PermissionError: [WinError 5] Access is denied: ‘wxWidgets-3.1.3.1-audacity’ → ‘source_subfolder’

CMake Error at cmake-proxies/cmake-modules/conan.cmake:631 (message):
Conan install failed=‘1’
Call Stack (most recent call first):
cmake-proxies/cmake-modules/AudacityDependencies.cmake:255 (conan_cmake_install)
cmake-proxies/cmake-modules/AudacityDependencies.cmake:274 (_conan_install)
CMakeLists.txt:541 (resolve_conan_dependencies)