conan problems on windows build

Building and customizing Audacity from the source code.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
roadsterUK
Posts: 190
Joined: Sat Apr 15, 2017 8:00 pm
Operating System: Windows 10

conan problems on windows build

Post by roadsterUK » Sun Dec 19, 2021 5:59 pm

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!)

mike1504
Posts: 2
Joined: Sat Jan 08, 2022 2:45 am
Operating System: Windows 10

Re: conan problems on windows build

Post by mike1504 » Sat Jan 08, 2022 2:58 am

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:
<black>
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'
</black>
<red>
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)
</red>
Thanks

steve
Site Admin
Posts: 83928
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: conan problems on windows build

Post by steve » Sat Jan 08, 2022 1:53 pm

mike1504 wrote:
Sat Jan 08, 2022 2:58 am
I seem to be having this or a similar problem.
Have you tried uninstalling Conan and then installing the latest version of Conan?
Learn more about Nyquist programming at audionyq.com

werame5913
Posts: 41
Joined: Sun Nov 14, 2021 8:15 pm
Operating System: Windows 10

Re: conan problems on windows build

Post by werame5913 » Sat Jan 15, 2022 11:46 am

FWTW, I have similar conan errors on Windows:

Code: Select all

ERROR: expat/[email protected]/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

Code: Select all

>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
Last edited by werame5913 on Sat Jan 15, 2022 12:34 pm, edited 2 times in total.

jademan
Forum Crew
Posts: 2189
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Windows 10

Re: conan problems on windows build

Post by jademan » Sat Jan 15, 2022 12:14 pm


werame5913
Posts: 41
Joined: Sun Nov 14, 2021 8:15 pm
Operating System: Windows 10

Re: conan problems on windows build

Post by werame5913 » Sat Jan 15, 2022 12:43 pm

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:

Code: Select all

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.

mike1504
Posts: 2
Joined: Sat Jan 08, 2022 2:45 am
Operating System: Windows 10

Re: conan problems on windows build

Post by mike1504 » Wed Jan 26, 2022 3:11 pm

steve wrote:
Sat Jan 08, 2022 1:53 pm
mike1504 wrote:
Sat Jan 08, 2022 2:58 am
I seem to be having this or a similar problem.
Have you tried uninstalling Conan and then installing the latest version of Conan?
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)

Post Reply