conan build on linux fails to find the system portmidi
Bug description
When building audacity from source with the conan build, and specifying to use system portmidi with:
-Daudacity_use_midi=system
It fails to find the system installed version of portmidi. The build log is attached.
System version of portmidi is 1:2.0.4-1, and it installs the following files:
extra/portmidi 1:2.0.4-1 (41.6 KiB 118.2 KiB) (Installed)
Cross platform library for interfacing with OS MIDI I/O APIs
[evert@Evert audacity-local-git]$ yay -Ql portmidi
portmidi /usr/
portmidi /usr/include/
portmidi /usr/include/pmutil.h
portmidi /usr/include/portmidi.h
portmidi /usr/include/porttime.h
portmidi /usr/lib/
portmidi /usr/lib/cmake/
portmidi /usr/lib/cmake/PortMidi/
portmidi /usr/lib/cmake/PortMidi/PortMidiConfig.cmake
portmidi /usr/lib/cmake/PortMidi/PortMidiConfigVersion.cmake
portmidi /usr/lib/cmake/PortMidi/PortMidiTargets-none.cmake
portmidi /usr/lib/cmake/PortMidi/PortMidiTargets.cmake
portmidi /usr/lib/libportmidi.so
portmidi /usr/lib/libportmidi.so.2
portmidi /usr/lib/libportmidi.so.2.0.3
portmidi /usr/lib/pkgconfig/
portmidi /usr/lib/pkgconfig/portmidi.pc
portmidi /usr/share/
portmidi /usr/share/doc/
portmidi /usr/share/doc/portmidi/
portmidi /usr/share/doc/portmidi/CHANGELOG.txt
portmidi /usr/share/doc/portmidi/README.txt
portmidi /usr/share/licenses/
portmidi /usr/share/licenses/portmidi/
portmidi /usr/share/licenses/portmidi/license.txt
[evert@Evert audacity-local-git]$
Steps to reproduce
Fetch PKGBUILD for audacity-local-git from Arch Linux AUR
Edit the PKGBUILD to use system version of portmidi and wxwidgets
run makepkg
Expected behavior
Clean build of audacity
Actual behavior
Conan fails to detect the system version of portmidi, and the build fails.
Audacity Version
current master / alpha / nightly build
Operating system
Linux
Additional context
Audacity-local-git_2023-11-14.txt
About this system:
Operating System: Arch Linux
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11
Kernel Version: 6.6.1-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 32 × 13th Gen Intel® Core™ i9-13900HX
Memory: 62.5 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Manufacturer: TUXEDO
Product Name: PD5x_7xSNC_SND_SNE
System Version: Not Applicable
Just on a side comment, if you build with conan off, the build scripts detect portmidi just fine, and the source builds successfully.
This is failing for me too on Arch Linux:
make[1]: *** [CMakeFiles/Makefile2:142: pm_dylib/CMakeFiles/portmidi-dynamic.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:116: pm_common/CMakeFiles/portmidi-static.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
portmidi/r234@audacity/stable: ERROR:
Package 'd2e71594f4319e9148d8468b588a82c8c2783157' build failed
portmidi/r234@audacity/stable: WARN: Build folder /home/serqetry/.conan2/p/b/portma5830f7cbc74e/b/build/Debug
ERROR: portmidi/r234@audacity/stable: Error in build() method, line 57
cmake.build()
ConanException: Error 2 while executing
Generating build profile...
Generating base host profile...
Generating options profile...
Generating host-debug profile...
Generating host-release profile...
Generating host-relwithdebinfo profile...
Generating host-minsizerel profile...
Traceback (most recent call last):
File "/home/serqetry/audacity-ai/audacity/conan/conan_runner.py", line 109, in <module>
subprocess.check_call(conan_options, stdin=subprocess.DEVNULL)
File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/serqetry/audacity-ai/conan-venv/bin/conan', 'install', '/home/serqetry/audacity-ai/audacity/conan', '--build=missing', '--output-folder', '/home/serqetry/audacity-ai/audacity-build', '--remote', 'audacity-binaries-conan2', '--profile:build', '/home/serqetry/audacity-ai/audacity-build/conan/profiles/build.profile', '--profile:host', '/home/serqetry/audacity-ai/audacity-build/conan/profiles/host-debug.profile']' returned non-zero exit status 1.
CMake Error at cmake-proxies/cmake-modules/AudacityDependencies.cmake:209 (message):
Conan failed to install dependencies (1)
/home/serqetry/audacity-ai/conan-venv/bin/python3.12
Call Stack (most recent call first):
CMakeLists.txt:586 (include)
-- Configuring incomplete, errors occurred!
Hmm I tried adding -Daudacity_use_midi=system and it got further but it still failed:
CMake Error at src/CMakeLists.txt:1426 (target_link_libraries):
Target "Audacity" links to:
portmidi::portmidi
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
I have the portmidi 1:2.0.4-1 Arch Linux package installed.
Seems it's impossible for me to build any version of Audacity now.
Hi Miranda. Have you tried building AUR/audacity-local-git? It build for me on Arch, and is the Audacity that I use for my day to day stuff. It is using the Conan version of portmidi, and not the version that comes with Arch
Hi Miranda. Have you tried building AUR/audacity-local-git? It build for me on Arch, and is the Audacity that I use for my day to day stuff. It is using the Conan version of portmidi, and not the version that comes with Arch
I don't think that will work for me since I'm trying to build Audacity in order to build the openvino AI plugins for Audacity.
The strange thing is I was able to do this just fine with Audacity 3.5.0 alpha. But something updated on my system and then the plugins stopped loading... so I was trying to rebuild them with 3.5.1... however now I can't build any version of Audacity, not even 3.4.2 because of that portmidi problem.
Hi there, Miranda.
Did you ever find a workaround on this issue?
Hi there, Miranda.
Did you ever find a workaround on this issue?
No, I gave up trying to build Audacity for Arch Linux, it was impossible. I ended up using a Distrobox container so I could build the Ubuntu version instead.
I guess technically that is a workaround, but a rather extreme one.
Hello! We just switched development to Audacity 4 which uses a different build system. This bug should no longer be applicable.