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

failure to link with pipewire-jack-audio-connection-kit-devel #142

Closed
Be-ing opened this issue Jul 29, 2021 · 3 comments · Fixed by #154
Closed

failure to link with pipewire-jack-audio-connection-kit-devel #142

Be-ing opened this issue Jul 29, 2021 · 3 comments · Fixed by #154

Comments

@Be-ing
Copy link
Contributor

Be-ing commented Jul 29, 2021

Trying to build jackctl which uses this crate when I had the pipewire-jack-audio-connection-kit-devel package for PipeWire's reimplementation of JACK installed on Fedora 34 failed with:

error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-Wl,--as-needed" "-L" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.0.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.1.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.10.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.11.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.12.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.13.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.14.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.15.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.2.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.3.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.4.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.5.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.6.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.7.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.8.rcgu.o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.jackctl.d1khulwf-cgu.9.rcgu.o" "-o" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda" "/home/be/sw/jackctl/target/debug/deps/jackctl-80096682ac7f0dda.1bkduh507zxf6t5z.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/be/sw/jackctl/target/debug/deps" "-L" "/usr/lib64" "-L" "/usr/lib64" "-L" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/be/sw/jackctl/target/debug/deps/libctrlc-0940d25d08103348.rlib" "/home/be/sw/jackctl/target/debug/deps/liblibappindicator-2c75978358a907e1.rlib" "/home/be/sw/jackctl/target/debug/deps/liblibappindicator_sys-065ac8ad17283bfe.rlib" "/home/be/sw/jackctl/target/debug/deps/libpsutil-8f9f9b88cd2fb65f.rlib" "/home/be/sw/jackctl/target/debug/deps/libnum_cpus-1867b1d1f1eeb6be.rlib" "/home/be/sw/jackctl/target/debug/deps/libunescape-9ad7b4c5f54ef0b7.rlib" "/home/be/sw/jackctl/target/debug/deps/libnix-4b64dff957c45c90.rlib" "/home/be/sw/jackctl/target/debug/deps/libvoid-3b595864154952bf.rlib" "/home/be/sw/jackctl/target/debug/deps/libcfg_if-1159de22c3156f78.rlib" "/home/be/sw/jackctl/target/debug/deps/libplatforms-63b77c017fb43aa3.rlib" "/home/be/sw/jackctl/target/debug/deps/libglob-fb33f4861ccd3daa.rlib" "/home/be/sw/jackctl/target/debug/deps/libalsa-dd8c215391a9725c.rlib" "/home/be/sw/jackctl/target/debug/deps/libnix-f36ea31766ecf9f4.rlib" "/home/be/sw/jackctl/target/debug/deps/libalsa_sys-b17d3fd9992beb3e.rlib" "/home/be/sw/jackctl/target/debug/deps/libjack-6c07e244a9a08458.rlib" "/home/be/sw/jackctl/target/debug/deps/libjack_sys-a157ba59a4c67f60.rlib" "/home/be/sw/jackctl/target/debug/deps/liblibloading-0462710af1b4353e.rlib" "/home/be/sw/jackctl/target/debug/deps/libcfg_if-12c3c724f58e527b.rlib" "/home/be/sw/jackctl/target/debug/deps/liblazy_static-f5d86e1ec170516d.rlib" "/home/be/sw/jackctl/target/debug/deps/libgtk-f34b74c1aee61953.rlib" "/home/be/sw/jackctl/target/debug/deps/libgdk-55e7715ed2dfaa0c.rlib" "/home/be/sw/jackctl/target/debug/deps/libpango-0739036976913eca.rlib" "/home/be/sw/jackctl/target/debug/deps/libgdk_pixbuf-b7ff9fdcdfebd0f4.rlib" "/home/be/sw/jackctl/target/debug/deps/libgio-d2f776faeb9d018c.rlib" "/home/be/sw/jackctl/target/debug/deps/libfutures-c95325a25cc847eb.rlib" "/home/be/sw/jackctl/target/debug/deps/libcairo-69511da6c8252b6c.rlib" "/home/be/sw/jackctl/target/debug/deps/libthiserror-83ed4542e345010e.rlib" "/home/be/sw/jackctl/target/debug/deps/libatk-720bcda53d00a5e0.rlib" "/home/be/sw/jackctl/target/debug/deps/libglib-42f219cee70ef9b0.rlib" "/home/be/sw/jackctl/target/debug/deps/libfutures_executor-b3026fc863236796.rlib" "/home/be/sw/jackctl/target/debug/deps/libfutures_util-1cb8b91e17b0703e.rlib" "/home/be/sw/jackctl/target/debug/deps/libmemchr-6563c0822c16615d.rlib" "/home/be/sw/jackctl/target/debug/deps/libfutures_io-5222fe37bff8b1f4.rlib" "/home/be/sw/jackctl/target/debug/deps/libslab-489f89df33910b4f.rlib" "/home/be/sw/jackctl/target/debug/deps/libpin_project_lite-ed51174be9d5a65f.rlib" "/home/be/sw/jackctl/target/debug/deps/libpin_utils-6f8a4aaa80ed4960.rlib" "/home/be/sw/jackctl/target/debug/deps/libfutures_task-17c021bcbe835d3b.rlib" "/home/be/sw/jackctl/target/debug/deps/libfutures_channel-45adb552491665e0.rlib" "/home/be/sw/jackctl/target/debug/deps/libfutures_sink-655a1ab550ced51d.rlib" "/home/be/sw/jackctl/target/debug/deps/libfutures_core-582ccb9441c09c50.rlib" "/home/be/sw/jackctl/target/debug/deps/libgtk_sys-0dd3ed1c2a8e1ed1.rlib" "/home/be/sw/jackctl/target/debug/deps/libatk_sys-afadcaa3b91d3abb.rlib" "/home/be/sw/jackctl/target/debug/deps/libgdk_sys-871e385ab2147352.rlib" "/home/be/sw/jackctl/target/debug/deps/libpango_sys-b455331480384c4e.rlib" "/home/be/sw/jackctl/target/debug/deps/libgdk_pixbuf_sys-d0ebe0023e8a6c0e.rlib" "/home/be/sw/jackctl/target/debug/deps/libgio_sys-d1f5ed2c38cd95b6.rlib" "/home/be/sw/jackctl/target/debug/deps/libgobject_sys-172fafd783e8f004.rlib" "/home/be/sw/jackctl/target/debug/deps/libcairo_sys-0b27ef8d91b0a369.rlib" "/home/be/sw/jackctl/target/debug/deps/libglib_sys-9877b25c4240a295.rlib" "/home/be/sw/jackctl/target/debug/deps/libonce_cell-2f2bf520a600a215.rlib" "/home/be/sw/jackctl/target/debug/deps/libbitflags-7fc45c1c715a0b2d.rlib" "/home/be/sw/jackctl/target/debug/deps/liblibc-fe28b341931a1b2b.rlib" "-Wl,--start-group" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ccb93ee701cefe54.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-86fda5bb7f25e3ad.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-cf7c4e599a52c960.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-d863c0940bf3636e.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-ea57350c5e9b90aa.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-e669704e2ae044db.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-44a18cd8105cc2de.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-7ba8f100a5ff6014.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-6af777557544f37e.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-560adfb2fecfa97e.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-ea0bef97ed7733e7.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-ced40da1dca2f9f9.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-a015ff6201b8d725.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-1e81bc72b1437bdb.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-77b01fee737da538.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-ccd141052619bcc8.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-489fe89826b50778.rlib" "-Wl,--end-group" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-d0d2612c9a57fd1c.rlib" "-Wl,-Bdynamic" "-lappindicator3" "-ldbusmenu-glib" "-lgtk-3" "-lgdk-3" "-lpangocairo-1.0" "-lpango-1.0" "-lharfbuzz" "-latk-1.0" "-lcairo-gobject" "-lcairo" "-lgdk_pixbuf-2.0" "-lgio-2.0" "-lgobject-2.0" "-lglib-2.0" "-lasound" "-ljack" "-ldl" "-lgtk-3" "-lgdk-3" "-lpangocairo-1.0" "-lpango-1.0" "-lharfbuzz" "-latk-1.0" "-lcairo-gobject" "-lcairo" "-lgdk_pixbuf-2.0" "-lgio-2.0" "-lgobject-2.0" "-lglib-2.0" "-latk-1.0" "-lgobject-2.0" "-lglib-2.0" "-lgdk-3" "-lpangocairo-1.0" "-lpango-1.0" "-lharfbuzz" "-lgdk_pixbuf-2.0" "-lcairo-gobject" "-lcairo" "-lgobject-2.0" "-lglib-2.0" "-lpango-1.0" "-lgobject-2.0" "-lglib-2.0" "-lharfbuzz" "-lgdk_pixbuf-2.0" "-lgobject-2.0" "-lglib-2.0" "-lgio-2.0" "-lgobject-2.0" "-lglib-2.0" "-lgobject-2.0" "-lglib-2.0" "-lcairo-gobject" "-lgobject-2.0" "-lglib-2.0" "-lcairo" "-lglib-2.0" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc"
  = note: /usr/bin/ld: cannot find -ljack
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error; 16 warnings emitted

error: could not compile `jackctl`

Caused by:
  process didn't exit successfully: `rustc --crate-name jackctl --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=80096682ac7f0dda -C extra-filename=-80096682ac7f0dda --out-dir /home/be/sw/jackctl/target/debug/deps -C incremental=/home/be/sw/jackctl/target/debug/incremental -L dependency=/home/be/sw/jackctl/target/debug/deps --extern alsa=/home/be/sw/jackctl/target/debug/deps/libalsa-dd8c215391a9725c.rlib --extern ctrlc=/home/be/sw/jackctl/target/debug/deps/libctrlc-0940d25d08103348.rlib --extern gio=/home/be/sw/jackctl/target/debug/deps/libgio-d2f776faeb9d018c.rlib --extern glib=/home/be/sw/jackctl/target/debug/deps/libglib-42f219cee70ef9b0.rlib --extern gtk=/home/be/sw/jackctl/target/debug/deps/libgtk-f34b74c1aee61953.rlib --extern jack=/home/be/sw/jackctl/target/debug/deps/libjack-6c07e244a9a08458.rlib --extern libappindicator=/home/be/sw/jackctl/target/debug/deps/liblibappindicator-2c75978358a907e1.rlib --extern psutil=/home/be/sw/jackctl/target/debug/deps/libpsutil-8f9f9b88cd2fb65f.rlib -L native=/usr/lib64 -L native=/usr/lib64` (exit status: 1)

jackctl has no build.rs and I hope that can be avoided by fixing this upstream.

I ran into a similar issue building a C library that depends on JACK. The solution was to search for libjack in the path specified by pkgconfig rather than simply looking for libjack in the default library search path. The pipewire-jack-audio-connection-kit-devel package comes with a file /usr/lib64/pkgconfig/jack.pc which points to the location for the library:

prefix=/usr
libdir=${prefix}/lib64
includedir=${prefix}/include

server_libs=-L${libdir}\ -ljackserver

Name: jack
Description: PipeWire JACK API
Version: 1.9.17
Libs: -L${prefix}/lib64/pipewire-0.3/jack -ljack -ljacknet
Cflags: -I${includedir} -D_REENTRANT
@Be-ing
Copy link
Contributor Author

Be-ing commented Jul 29, 2021

Switching to JACK with:

sudo dnf install jack-audio-connection-kit-devel --allowerasing

then building jackctl works. After jackctl is built, the executable continues to work after reinstalling PipeWire's JACK implementation:

sudo dnf install pipewire-jack-audio-connection-kit-devel --allowerasing

@Be-ing Be-ing changed the title downstream project fails to link with pipewire-jack-audio-connection-kit-devel failure to link with pipewire-jack-audio-connection-kit-devel Jul 29, 2021
@Be-ing
Copy link
Contributor Author

Be-ing commented Jul 29, 2021

The pkg_config crate may help.

@Be-ing
Copy link
Contributor Author

Be-ing commented Jul 29, 2021

Building this crate by itself works. The failure only occurs when a downstream project tries to link.

ssssam added a commit to ssssam/boucle that referenced this issue Nov 16, 2021
CPAL cannot be used on Organelle.

  * Using default audio device gives a EPIPE error in snd_pcm_start()
  * Specifying device `default=CARD=Codec` fails because of
    RustAudio/cpal#615
  * Using JACK backend fails for reasons I didn't investigate - the
    `feedback` example fails with 'unsupported configuration' even
    though it's clearly using a supported configuration.

JACK is available on Organelle and can play sound, we just need to start
it in the run.sh script.

I don't have time to fix any of the CPAL problems so let's switch to
JACK for everything.

This can also be tested locally on desktop, but see:
RustAudio/rust-jack#142
ssssam added a commit to ssssam/boucle that referenced this issue Nov 21, 2021
CPAL cannot be used on Organelle.

  * Using default audio device gives a EPIPE error in snd_pcm_start()
  * Specifying device `default=CARD=Codec` fails because of
    RustAudio/cpal#615
  * Using JACK backend fails for reasons I didn't investigate - the
    `feedback` example fails with 'unsupported configuration' even
    though it's clearly using a supported configuration.

JACK is available on Organelle and can play sound, we just need to start
it in the run.sh script.

I don't have time to fix any of the CPAL problems so let's switch to
JACK for everything.

This can also be tested locally on desktop, but see:
RustAudio/rust-jack#142
Be-ing added a commit to Be-ing/rust-jack that referenced this issue Nov 30, 2021
This fixes linking with PipeWire's JACK headers.
Fixes RustAudio#142
Be-ing added a commit to Be-ing/rust-jack that referenced this issue Nov 30, 2021
This fixes linking with PipeWire's JACK headers.
Fixes RustAudio#142
Be-ing added a commit to Be-ing/rust-jack that referenced this issue Nov 30, 2021
This fixes linking with PipeWire's JACK headers.
Fixes RustAudio#142
Be-ing added a commit to Be-ing/rust-jack that referenced this issue Dec 1, 2021
This fixes linking with PipeWire's JACK headers.
Fixes RustAudio#142
wmedrano pushed a commit that referenced this issue Dec 13, 2021
* jack-sys: search for jack library with pkg-config

This fixes linking with PipeWire's JACK headers.
Fixes #142

* jack-sys: add package.links=jack to Cargo.toml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant