Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fluidsynth] Update to 2.3.2 #30625

Merged
merged 9 commits into from
Apr 19, 2023

Conversation

FtZPetruska
Copy link
Contributor

  • Changes comply with the maintainer guide
  • SHA512s are updated for each updated download
  • The "supports" clause reflects platforms that may be fixed by this new version
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

The add-usage-requirements patch is no longer necessary as upstream now handles it.

Update the logic for setting the CMake options:

  • Make sure all debug options are disabled (coverage, ubsan, trap-on-fpe, etc)
  • Make per-platform option lists so the options for other platforms can be used in MAYBE_UNUSED_VARIABLESmore easily.
  • Add an option list for Android. Oboe could also be enabled, but it is not guaranteed to be available unlike OpenSLES which is bundled with the ndk.

The usage requirements patch is no longer required as a similar patch
has been merged upstream.
- List out the options per-platform.
- Set the proper options for Android.
@FtZPetruska
Copy link
Contributor Author

The linux CI errors seem to be related to ALSA:

/usr/bin/ld: /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libasound.a(dlmisc.o): in function `snd_dlinfo_origin':
/mnt/vcpkg-ci/buildtrees/alsa/x64-linux-dbg/src/.././../src/v1.2.6.1-b673b0105e.clean/src/dlmisc.c:75: undefined reference to `dladdr1'
/usr/bin/ld: /mnt/vcpkg-ci/buildtrees/alsa/x64-linux-dbg/src/.././../src/v1.2.6.1-b673b0105e.clean/src/dlmisc.c:77: undefined reference to `dlinfo'
/usr/bin/ld: /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libasound.a(dlmisc.o): in function `__snd_dlopen':
/mnt/vcpkg-ci/buildtrees/alsa/x64-linux-dbg/src/.././../src/v1.2.6.1-b673b0105e.clean/src/dlmisc.c:174: undefined reference to `dlopen'
/usr/bin/ld: /mnt/vcpkg-ci/buildtrees/alsa/x64-linux-dbg/src/.././../src/v1.2.6.1-b673b0105e.clean/src/dlmisc.c:180: undefined reference to `dlerror'
/usr/bin/ld: /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libasound.a(dlmisc.o): in function `snd_dlclose':
/mnt/vcpkg-ci/buildtrees/alsa/x64-linux-dbg/src/.././../src/v1.2.6.1-b673b0105e.clean/src/dlmisc.c:210: undefined reference to `dlclose'
/usr/bin/ld: /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libasound.a(dlmisc.o): in function `snd_dlsym_verify':
/mnt/vcpkg-ci/buildtrees/alsa/x64-linux-dbg/src/.././../src/v1.2.6.1-b673b0105e.clean/src/dlmisc.c:240: undefined reference to `dlsym'
/usr/bin/ld: /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libasound.a(dlmisc.o): in function `snd_dlsym':
/mnt/vcpkg-ci/buildtrees/alsa/x64-linux-dbg/src/.././../src/v1.2.6.1-b673b0105e.clean/src/dlmisc.c:288: undefined reference to `dlsym'
/usr/bin/ld: /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libasound.a(pcm_ladspa.o): in function `snd_pcm_ladspa_free_plugins':
/mnt/vcpkg-ci/buildtrees/alsa/x64-linux-dbg/src/pcm/../.././../src/v1.2.6.1-b673b0105e.clean/src/pcm/pcm_ladspa.c:188: undefined reference to `dlclose'
/usr/bin/ld: /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libasound.a(pcm_ladspa.o): in function `snd_pcm_ladspa_check_file':
/mnt/vcpkg-ci/buildtrees/alsa/x64-linux-dbg/src/pcm/../.././../src/v1.2.6.1-b673b0105e.clean/src/pcm/pcm_ladspa.c:1094: undefined reference to `dlopen'
/usr/bin/ld: /mnt/vcpkg-ci/buildtrees/alsa/x64-linux-dbg/src/pcm/../.././../src/v1.2.6.1-b673b0105e.clean/src/pcm/pcm_ladspa.c:1096: undefined reference to `dlsym'
/usr/bin/ld: /mnt/vcpkg-ci/buildtrees/alsa/x64-linux-dbg/src/pcm/../.././../src/v1.2.6.1-b673b0105e.clean/src/pcm/pcm_ladspa.c:1114: undefined reference to `dlclose'
/usr/bin/ld: /mnt/vcpkg-ci/buildtrees/alsa/x64-linux-dbg/src/pcm/../.././../src/v1.2.6.1-b673b0105e.clean/src/pcm/pcm_ladspa.c:1131: undefined reference to `dlclose'
/usr/bin/ld: /mnt/vcpkg-ci/buildtrees/alsa/x64-linux-dbg/src/pcm/../.././../src/v1.2.6.1-b673b0105e.clean/src/pcm/pcm_ladspa.c:1139: undefined reference to `dlclose'

It should be noted that upstream has switched from pkg_check_modules(alsa ...) to find_package(ALSA).

I can't seem to be able to reproduce the failure locally on the fedora:latest and ubuntu:latest docker images. Running vcpkg install fluidsynth succeeds, and checking the logs indicate that the vcpkg build of alsa is indeed used and that the link command is identical.

@jimwang118 jimwang118 added the category:port-update The issue is with a library, which is requesting update new revision label Apr 3, 2023
@jimwang118
Copy link
Contributor

I cloned your branch code locally, and then compiled it on Ubuntu and had the same problem as CI.

: && /usr/bin/c++ -fPIC -Wall -W -Wpointer-arith -Wcast-qual -Wno-unused-parameter -Wcast-align -g -Wl,--as-needed src/CMakeFiles/fluidsynth.dir/fluidsynth.c.o -o src/fluidsynth -L/data/fluidsynth/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib -Wl,-rpath,/data/fluidsynth/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib:  src/libfluidsynth.a  /data/fluidsynth/vcpkg/installed/x64-linux/debug/lib/libglib-2.0.a  /data/fluidsynth/vcpkg/installed/x64-linux/debug/lib/libglib-2.0.a  -lpthread  /data/fluidsynth/vcpkg/installed/x64-linux/debug/lib/libgthread-2.0.a  -lglib-2.0  -lm  -lpcre2-8  /data/fluidsynth/vcpkg/installed/x64-linux/debug/lib/libasound.a && :
/usr/bin/ld: /data/fluidsynth/vcpkg/installed/x64-linux/debug/lib/libasound.a(dlmisc.o): in function `snd_dlinfo_origin':
/data/fluidsynth/vcpkg/buildtrees/alsa/x64-linux-dbg/src/.././../src/v1.2.6.1-b673b0105e.clean/src/dlmisc.c:75: undefined reference to `dladdr1'
/usr/bin/ld: /data/fluidsynth/vcpkg/buildtrees/alsa/x64-linux-dbg/src/.././../src/v1.2.6.1-b673b0105e.clean/src/dlmisc.c:77: undefined reference to `dlinfo'
/usr/bin/ld: /data/fluidsynth/vcpkg/installed/x64-linux/debug/lib/libasound.a(dlmisc.o): in function `__snd_dlopen':
/data/fluidsynth/vcpkg/buildtrees/alsa/x64-linux-dbg/src/.././../src/v1.2.6.1-b673b0105e.clean/src/dlmisc.c:174: undefined reference to `dlopen'
/usr/bin/ld: /data/fluidsynth/vcpkg/buildtrees/alsa/x64-linux-dbg/src/.././../src/v1.2.6.1-b673b0105e.clean/src/dlmisc.c:180: undefined reference to `dlerror'
/usr/bin/ld: /data/fluidsynth/vcpkg/installed/x64-linux/debug/lib/libasound.a(dlmisc.o): in function `snd_dlclose':
/data/fluidsynth/vcpkg/buildtrees/alsa/x64-linux-dbg/src/.././../src/v1.2.6.1-b673b0105e.clean/src/dlmisc.c:210: undefined reference to `dlclose'
/usr/bin/ld: /data/fluidsynth/vcpkg/installed/x64-linux/debug/lib/libasound.a(dlmisc.o): in function `snd_dlsym_verify':
/data/fluidsynth/vcpkg/buildtrees/alsa/x64-linux-dbg/src/.././../src/v1.2.6.1-b673b0105e.clean/src/dlmisc.c:240: undefined reference to `dlsym'
/usr/bin/ld: /data/fluidsynth/vcpkg/installed/x64-linux/debug/lib/libasound.a(dlmisc.o): in function `snd_dlsym':
/data/fluidsynth/vcpkg/buildtrees/alsa/x64-linux-dbg/src/.././../src/v1.2.6.1-b673b0105e.clean/src/dlmisc.c:288: undefined reference to `dlsym'
/usr/bin/ld: /data/fluidsynth/vcpkg/installed/x64-linux/debug/lib/libasound.a(pcm_ladspa.o): in function `snd_pcm_ladspa_free_plugins':
/data/fluidsynth/vcpkg/buildtrees/alsa/x64-linux-dbg/src/pcm/../.././../src/v1.2.6.1-b673b0105e.clean/src/pcm/pcm_ladspa.c:188: undefined reference to `dlclose'
/usr/bin/ld: /data/fluidsynth/vcpkg/installed/x64-linux/debug/lib/libasound.a(pcm_ladspa.o): in function `snd_pcm_ladspa_check_file':
/data/fluidsynth/vcpkg/buildtrees/alsa/x64-linux-dbg/src/pcm/../.././../src/v1.2.6.1-b673b0105e.clean/src/pcm/pcm_ladspa.c:1094: undefined reference to `dlopen'
/usr/bin/ld: /data/fluidsynth/vcpkg/buildtrees/alsa/x64-linux-dbg/src/pcm/../.././../src/v1.2.6.1-b673b0105e.clean/src/pcm/pcm_ladspa.c:1096: undefined reference to `dlsym'
/usr/bin/ld: /data/fluidsynth/vcpkg/buildtrees/alsa/x64-linux-dbg/src/pcm/../.././../src/v1.2.6.1-b673b0105e.clean/src/pcm/pcm_ladspa.c:1114: undefined reference to `dlclose'
/usr/bin/ld: /data/fluidsynth/vcpkg/buildtrees/alsa/x64-linux-dbg/src/pcm/../.././../src/v1.2.6.1-b673b0105e.clean/src/pcm/pcm_ladspa.c:1131: undefined reference to `dlclose'
/usr/bin/ld: /data/fluidsynth/vcpkg/buildtrees/alsa/x64-linux-dbg/src/pcm/../.././../src/v1.2.6.1-b673b0105e.clean/src/pcm/pcm_ladspa.c:1139: undefined reference to `dlclose'
/usr/bin/ld: /data/fluidsynth/vcpkg/installed/x64-linux/debug/lib/libasound.a(pcm_meter.o): in function `snd_pcm_meter_add_scope_conf':
/data/fluidsynth/vcpkg/buildtrees/alsa/x64-linux-dbg/src/pcm/../.././../src/v1.2.6.1-b673b0105e.clean/src/pcm/pcm_meter.c:676: undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

@FtZPetruska
Copy link
Contributor Author

Thank you for the confirmation.

It sorts of look like an ALSA issue, where ALSA depends on libdl but does not link to it,

For the time being, what do you think about adding the following patch:

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 114fa163..2ea55ddc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -365,7 +365,7 @@ if ( PULSE_SUPPORT )
 endif()

 if ( TARGET ALSA::ALSA AND ALSA_SUPPORT )
-    target_link_libraries ( libfluidsynth-OBJ PUBLIC ALSA::ALSA )
+    target_link_libraries ( libfluidsynth-OBJ PUBLIC ALSA::ALSA ${CMAKE_DL_LIBS} )
 endif()

 if ( TARGET PortAudio::PortAudio AND PORTAUDIO_SUPPORT )

While I still cannot reproduce the issue locally, the output looks sane to me:

  • Link command: ld ... /root/vcpkg/installed/x64-linux/lib/libasound.a -ldl
  • Installed FluidSynthTargets.cmake:
    set_target_properties(FluidSynth::libfluidsynth-OBJ PROPERTIES
      INTERFACE_LINK_LIBRARIES "m;Threads::Threads;GLib2::glib-2;GLib2::gthread-2;ALSA::ALSA;dl"
    )

@jimwang118
Copy link
Contributor

The features and usage have been tested successfully locally.

@jimwang118 jimwang118 added the info:reviewed Pull Request changes follow basic guidelines label Apr 19, 2023

vcpkg_find_acquire_program(PKGCONFIG)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
"-DVCPKG_HOST_TRIPLET=${HOST_TRIPLET}"
-DVCPKG_HOST_TRIPLET="${HOST_TRIPLET}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this transform is correct. At least, https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#command-arguments seems to indicate that this will cause the argument to be broken into 2 arguments?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was checking and while the resulting configure command looks odd "-DVCPKG_HOST_TRIPLET="arm64-osx"", the value in the cache is properly set:

//No help, variable specified on the command line.
VCPKG_HOST_TRIPLET:UNINITIALIZED=arm64-osx

But it's probably safer to keep it fully quoted as it used to be.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inner quotes are part of the CMake value and work with some build systems and shells. It is not portable. That's why we want quotes around the CMake value so that CMake can treat the value as needed when forwarding it to specific build systems and shells.


if ( TARGET ALSA::ALSA AND ALSA_SUPPORT )
- target_link_libraries ( libfluidsynth-OBJ PUBLIC ALSA::ALSA )
+ target_link_libraries ( libfluidsynth-OBJ PUBLIC ALSA::ALSA ${CMAKE_DL_LIBS} )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should ALSA::ALSA already be including CMAKE_DL_LIBS if necessary? (Should that port be fixed rather than this one?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am having a hard time reproducing the error in question locally, but I agree that it seems a lot like an ALSA issue. Its pkg-config file does include dl, but the upstream FindALSA module from Kitlab does not seem to search for any potential transitive usage requirements.

I will see about making a vcpkg-cmake-wrapper for ALSA.

@FtZPetruska FtZPetruska mentioned this pull request Apr 19, 2023
7 tasks
@BillyONeal BillyONeal merged commit 134f30d into microsoft:master Apr 19, 2023
@BillyONeal
Copy link
Member

Thanks for the update!

@FtZPetruska FtZPetruska deleted the bump-fluidsynth-2.3.2 branch April 20, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-update The issue is with a library, which is requesting update new revision info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants