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

[mediasoup-worker] Require C++17, Meson >= 1.1.0 and update subprojects #1081

Merged
merged 5 commits into from
May 17, 2023

Conversation

ibc
Copy link
Member

@ibc ibc commented May 16, 2023

Fixes #1080

  • We could just require C++14 but let's move to C++17.
  • Also update required meson version to 1.1.0.

TODO: Once published, update installation requirements in website.

Fixes #1080

We could just require C++14 but let's move to C++17.
@ibc ibc added this to the v3 updates milestone May 16, 2023
@ibc ibc requested review from jmillan and nazar-pc May 16, 2023 16:23
@ibc
Copy link
Member Author

ibc commented May 16, 2023

@nazar-pc which version of Meson should I set in meson.build? 1.1.0??? https://pypi.org/project/meson/

@nazar-pc
Copy link
Collaborator

Latest Meson release is 1.1.0 and was released weeks ago (we still use pre-1.0), I suggest using >=1.1.0 in this case unless we have any CI errors. Note that this will also increase Python requirements from 3.6 to 3.7.

@ibc
Copy link
Member Author

ibc commented May 16, 2023

Ok. Wondering if we could also update ninja version. Remember that we limit it to 1.10.2.4 in Makefile due to this:

# Let's use a specific version of ninja to avoid buggy version 1.11.1:
# https://mediasoup.discourse.group/t/partly-solved-could-not-detect-ninja-v1-8-2-or-newer/
# https://github.com/ninja-build/ninja/issues/2211
# https://github.com/ninja-build/ninja/issues/2212
NINJA_VERSION ?= 1.10.2.4

@ibc ibc changed the title [mediasoup-worker] Require C++17 and update subprojects [mediasoup-worker] Require C++17, Meson >= 1.1.0 and update subprojects May 16, 2023
@nazar-pc
Copy link
Collaborator

I don't think we need to limit either. Meson requirements are 1.8.2+, so we are good either way, but you can update to newer version if there is one.

@ibc
Copy link
Member Author

ibc commented May 16, 2023

Ok. Wondering if we could also update ninja version. Remember that we limit it to 1.10.2.4 in Makefile due to this:

# Let's use a specific version of ninja to avoid buggy version 1.11.1:
# https://mediasoup.discourse.group/t/partly-solved-could-not-detect-ninja-v1-8-2-or-newer/
# https://github.com/ninja-build/ninja/issues/2211
# https://github.com/ninja-build/ninja/issues/2212
NINJA_VERSION ?= 1.10.2.4

I cannot figure it out. Question made here: scikit-build/ninja-python-distributions#157 (comment)

@ibc
Copy link
Member Author

ibc commented May 16, 2023

OMG https://github.com/versatica/mediasoup/actions/runs/4994428077/jobs/8944973803?pr=1081

@ibc
Copy link
Member Author

ibc commented May 16, 2023

@nazar-pc I cannot run cargo test locally and it miserably fails with meson.build:1:0: ERROR: Meson version is 0.61.5 but project requires >= 1.1.0...

cargo test
   Compiling mediasoup-sys v0.5.4 (/Users/ibc/src/v3-mediasoup/worker)
error: failed to run custom build command for `mediasoup-sys v0.5.4 (/Users/ibc/src/v3-mediasoup/worker)`

Caused by:
  process didn't exit successfully: `/Users/ibc/src/v3-mediasoup/target/debug/build/mediasoup-sys-ecce322bae1686d4/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-search=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
  cargo:rustc-link-lib=dylib=c++
  cargo:rustc-link-lib=dylib=c++abi
  /Users/ibc/src/v3-mediasoup/target/debug/build/mediasoup-sys-f797145957fa5d57/out/out/pip/bin/meson setup \
  		--prefix /Users/ibc/src/v3-mediasoup/target/debug/build/mediasoup-sys-f797145957fa5d57/out \
  		--bindir '' \
  		--libdir '' \
  		--buildtype debug \
  		-Db_pie=true \
  		-Db_staticpic=true \
  		--reconfigure \
  		"" \
  		/Users/ibc/src/v3-mediasoup/target/debug/build/mediasoup-sys-f797145957fa5d57/out/build || \
  		/Users/ibc/src/v3-mediasoup/target/debug/build/mediasoup-sys-f797145957fa5d57/out/out/pip/bin/meson setup \
  			--prefix /Users/ibc/src/v3-mediasoup/target/debug/build/mediasoup-sys-f797145957fa5d57/out \
  			--bindir '' \
  			--libdir '' \
  			--buildtype debug \
  			-Db_pie=true \
  			-Db_staticpic=true \
  			"" \
  			/Users/ibc/src/v3-mediasoup/target/debug/build/mediasoup-sys-f797145957fa5d57/out/build
  The Meson build system
  Version: 0.61.5
  Source dir: /Users/ibc/src/v3-mediasoup/worker
  Build dir: /Users/ibc/src/v3-mediasoup/target/debug/build/mediasoup-sys-f797145957fa5d57/out/build
  Build type: native build

  meson.build:1:0: ERROR: Meson version is 0.61.5 but project requires >= 1.1.0

  A full log can be found at /Users/ibc/src/v3-mediasoup/target/debug/build/mediasoup-sys-f797145957fa5d57/out/build/meson-logs/meson-log.txt
  Directory already configured.

  Just run your build command (e.g. ninja) and Meson will regenerate as necessary.
  If ninja fails, run "ninja reconfigure" or "meson --reconfigure"
  to force Meson to regenerate.

  If build failures persist, run "meson setup --wipe" to rebuild from scratch
  using the same options as passed when configuring the build.
  To change option values, run "meson configure" instead.
  /Users/ibc/src/v3-mediasoup/target/debug/build/mediasoup-sys-f797145957fa5d57/out/out/pip/bin/meson compile -C /Users/ibc/src/v3-mediasoup/target/debug/build/mediasoup-sys-f797145957fa5d57/out/build -j 16 libmediasoup-worker
  ninja: Entering directory `/Users/ibc/src/v3-mediasoup/target/debug/build/mediasoup-sys-f797145957fa5d57/out/build'

@nazar-pc
Copy link
Collaborator

Try deleting /Users/ibc/src/v3-mediasoup/target/debug/build/mediasoup-sys-f797145957fa5d57/out, looks like you have Meson installed there from the older runs

@ibc
Copy link
Member Author

ibc commented May 16, 2023

Try deleting /Users/ibc/src/v3-mediasoup/target/debug/build/mediasoup-sys-f797145957fa5d57/out, looks like you have Meson installed there from the older runs

Thanks. But shouldn't some of the make clean-xxx we have do that?

@nazar-pc
Copy link
Collaborator

I don't think we have a separate cleanup method for that. It is cleaned up by default at the end actually, but not when error happens 😕

@ibc
Copy link
Member Author

ibc commented May 16, 2023

So cargo commands work in my computer. But CI fails with this error:

https://github.com/versatica/mediasoup/actions/runs/4994428077/jobs/8944973803?pr=1081

 /usr/bin/ld: /home/runner/work/mediasoup/mediasoup/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/libmediasoup-worker.a(absl_strings_internal_cord_rep_crc.cc.o): in function `absl::lts_20230125::cord_internal::CordRepCrc::CordRepCrc()':

Note that it's about mediasoup/target/debug/build. Why is it generating debug release? I cannot ssh the CI server and manually delete that folder...

@nazar-pc
Copy link
Collaborator

Maybe it succeeds on macOS, but requires something on Linux, I will look into it later.

Why is it generating debug release?

Why wouldn't it? Debug is the default for testing and similar purposes. We are caching some stuff in CI, but not target.

@ibc
Copy link
Member Author

ibc commented May 16, 2023

Why is it generating debug release?

Why wouldn't it? Debug is the default for testing and similar purposes. We are caching some stuff in CI, but not target.

True, ignore it please.

@ibc
Copy link
Member Author

ibc commented May 16, 2023

@jmillan it fails to build on our server (jsut run make on /tmp/mediasoup/worker) :(
This is a fresh clone of mediasoup using the branch in this PR:

Found ninja-1.10.2.git.kitware.jobserver-1 at /tmp/kk/mediasoup/worker/out/pip/bin/ninja
/tmp/kk/mediasoup/worker/out/pip/bin/meson compile -C /tmp/kk/mediasoup/worker/out/Release/build -j 2 mediasoup-worker
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /tmp/kk/mediasoup/worker/out/pip/bin/ninja -C /tmp/kk/mediasoup/worker/out/Release/build -j 2 mediasoup-worker
ninja: Entering directory `/tmp/kk/mediasoup/worker/out/Release/build'
[1061/1333] Compiling C++ object subprojects/abseil-cpp-20230125.1/libabsl_base.a.p/absl_base_internal_cycleclock.cc.o
FAILED: subprojects/abseil-cpp-20230125.1/libabsl_base.a.p/absl_base_internal_cycleclock.cc.o
c++ -Isubprojects/abseil-cpp-20230125.1/libabsl_base.a.p -Isubprojects/abseil-cpp-20230125.1 -I../../../subprojects/abseil-cpp-20230125.1 -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -std=c++14 -O3 -Wno-sign-compare -fPIC -pthread -MD -MQ subprojects/abseil-cpp-20230125.1/libabsl_base.a.p/absl_base_internal_cycleclock.cc.o -MF subprojects/abseil-cpp-20230125.1/libabsl_base.a.p/absl_base_internal_cycleclock.cc.o.d -o subprojects/abseil-cpp-20230125.1/libabsl_base.a.p/absl_base_internal_cycleclock.cc.o -c ../../../subprojects/abseil-cpp-20230125.1/absl/base/internal/cycleclock.cc
In file included from ../../../subprojects/abseil-cpp-20230125.1/absl/base/config.h:86:0,
                 from ../../../subprojects/abseil-cpp-20230125.1/absl/base/attributes.h:37,
                 from ../../../subprojects/abseil-cpp-20230125.1/absl/base/internal/cycleclock.h:48,
                 from ../../../subprojects/abseil-cpp-20230125.1/absl/base/internal/cycleclock.cc:23:
../../../subprojects/abseil-cpp-20230125.1/absl/base/policy_checks.h:57:2: error: #error "This package requires GCC 7 or higher."
 #error "This package requires GCC 7 or higher."
  ^~~~~
[1062/1333] Compiling C++ object subprojects/abseil-cpp-20230125.1/libabsl_base.a.p/absl_base_internal_low_level_alloc.cc.o
FAILED: subprojects/abseil-cpp-20230125.1/libabsl_base.a.p/absl_base_internal_low_level_alloc.cc.o
c++ -Isubprojects/abseil-cpp-20230125.1/libabsl_base.a.p -Isubprojects/abseil-cpp-20230125.1 -I../../../subprojects/abseil-cpp-20230125.1 -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -std=c++14 -O3 -Wno-sign-compare -fPIC -pthread -MD -MQ subprojects/abseil-cpp-20230125.1/libabsl_base.a.p/absl_base_internal_low_level_alloc.cc.o -MF subprojects/abseil-cpp-20230125.1/libabsl_base.a.p/absl_base_internal_low_level_alloc.cc.o.d -o subprojects/abseil-cpp-20230125.1/libabsl_base.a.p/absl_base_internal_low_level_alloc.cc.o -c ../../../subprojects/abseil-cpp-20230125.1/absl/base/internal/low_level_alloc.cc
In file included from ../../../subprojects/abseil-cpp-20230125.1/absl/base/config.h:86:0,
                 from ../../../subprojects/abseil-cpp-20230125.1/absl/base/attributes.h:37,
                 from ../../../subprojects/abseil-cpp-20230125.1/absl/base/internal/low_level_alloc.h:31,
                 from ../../../subprojects/abseil-cpp-20230125.1/absl/base/internal/low_level_alloc.cc:20:
../../../subprojects/abseil-cpp-20230125.1/absl/base/policy_checks.h:57:2: error: #error "This package requires GCC 7 or higher."
 #error "This package requires GCC 7 or higher."
  ^~~~~
ninja: build stopped: subcommand failed.
Makefile:199: recipe for target 'mediasoup-worker' failed
make: *** [mediasoup-worker] Error 1

So... #error "This package requires GCC 7 or higher."

Amazing :(

@ibc
Copy link
Member Author

ibc commented May 17, 2023

@nazar-pc @jmillan as said here we cannot update Meson version yet in our Makefile:

scikit-build/ninja-python-distributions#157 (comment)

@ibc
Copy link
Member Author

ibc commented May 17, 2023

it fails to build on our server

This has been fixed in our server by upgrading to gcc 7 (it was 6), done by @jmillan. We are good.

@jmillan
Copy link
Member

jmillan commented May 17, 2023

This has been fixed in our server by upgrading to gcc 7 (it was 6), done by @nazar-pc. We are good.

Hehehe

@ibc
Copy link
Member Author

ibc commented May 17, 2023

Hehehe

GH mobile sucks. Fixed.

@ibc
Copy link
Member Author

ibc commented May 17, 2023

@nazar-pc "good news" is that I can reproduce the Rust+Linux issue in our Debian 11 server by just running cargo test in main mediasoup folder:

$ cargo test
   Compiling mediasoup v0.11.4 (/home/deploy/src/mediasoup-git-repo/rust)
   Compiling mediasoup-sys v0.5.4 (/home/deploy/src/mediasoup-git-repo/worker)
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/tmp/rustcNe3S8z/symbols.o" "/home/deploy/src/mediasoup-git-repo/target/debug/deps/mediasoup_sys-afbcf8e1bac9f50a.15z88gheo1uq3l69.rcgu.o" "/home/deploy/src/mediasoup-git-repo/target/debug/deps/mediasoup_sys-afbcf8e1bac9f50a.1qemnk22vx794odi.rcgu.o" "/home/deploy/src/mediasoup-git-repo/target/debug/deps/mediasoup_sys-afbcf8e1bac9f50a.237r032jcn08csy2.rcgu.o" "/home/deploy/src/mediasoup-git-repo/target/debug/deps/mediasoup_sys-afbcf8e1bac9f50a.438yiyscz2ua5t5g.rcgu.o" "/home/deploy/src/mediasoup-git-repo/target/debug/deps/mediasoup_sys-afbcf8e1bac9f50a.4yeaguvuey6xpn9n.rcgu.o" "/home/deploy/src/mediasoup-git-repo/target/debug/deps/mediasoup_sys-afbcf8e1bac9f50a.2u30290lzyugjtd3.rcgu.o" "-Wl,--as-needed" "-L" "/home/deploy/src/mediasoup-git-repo/target/debug/deps" "-L" "/usr/lib/gcc/x86_64-linux-gnu/10/" "-L" "/home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out" "-L" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "-lstdc++" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-lmediasoup-worker" "-Wl,--no-whole-archive" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest-aa7b246d7b35480c.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts-6095bf995c453e89.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunicode_width-ae66bd5269d6d83c.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_std-6352d71bf8e7bd57.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-2a15b3cd0948397b.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-8f251cec381c549e.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-e8062a7445a64946.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-431dd9a65eafb1c5.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-5d5a85338b125cfb.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-3cf84ad460df483a.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-5a049915d61fbb5d.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-aabc21fad3549c98.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-dac6992ac677a0cb.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-3cd49acf880d0306.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-6c93f515800d4657.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-8a30445cf40d74de.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-47cbfc4f5b0f6f87.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-0b6ce813aa5d1704.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f0ffbd64420a69ad.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-60668236929c1cf5.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-2fb2d4481260f706.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-c888e061ea504c93.rlib" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-93189d615c3f2d6a.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/deploy/.rustup/toolchains/1.67.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/deploy/src/mediasoup-git-repo/target/debug/deps/mediasoup_sys-afbcf8e1bac9f50a" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-nodefaultlibs"
  = note: /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/libmediasoup-worker.a(absl_strings_cord.cc.o): in function `absl::lts_20230125::Cord::SetCrcCordState(absl::lts_20230125::crc_internal::CrcCordState)':
          /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:860: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::CrcCordState(absl::lts_20230125::crc_internal::CrcCordState&&)'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:860: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::~CrcCordState()'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:864: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::CrcCordState(absl::lts_20230125::crc_internal::CrcCordState&&)'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:864: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::~CrcCordState()'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:868: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::CrcCordState(absl::lts_20230125::crc_internal::CrcCordState&&)'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:868: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::~CrcCordState()'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:860: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::~CrcCordState()'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:864: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::~CrcCordState()'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:868: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::~CrcCordState()'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/libmediasoup-worker.a(absl_strings_cord.cc.o): in function `absl::lts_20230125::Cord::SetExpectedChecksum(unsigned int)':
          /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:875: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::CrcCordState()'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:878: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::CrcCordState(absl::lts_20230125::crc_internal::CrcCordState&&)'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:878: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::~CrcCordState()'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:875: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::~CrcCordState()'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:878: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::~CrcCordState()'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:875: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::~CrcCordState()'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/libmediasoup-worker.a(absl_strings_cord.cc.o): in function `absl::lts_20230125::Cord::ExpectedChecksum() const':
          /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:893: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::Checksum() const'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/libmediasoup-worker.a(absl_strings_cord.cc.o): in function `absl::lts_20230125::DumpNode(absl::lts_20230125::cord_internal::CordRep*, bool, std::ostream*, int)':
          /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/cord.cc:1273: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::Checksum() const'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/libmediasoup-worker.a(absl_strings_cord.cc.o): in function `absl::lts_20230125::cord_internal::CordRepCrc::~CordRepCrc()':
          /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/internal/cord_rep_crc.h:36: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::~CrcCordState()'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/libmediasoup-worker.a(absl_strings_internal_cord_rep_crc.cc.o): in function `absl::lts_20230125::cord_internal::CordRepCrc::New(absl::lts_20230125::cord_internal::CordRep*, absl::lts_20230125::crc_internal::CrcCordState)':
          /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/internal/cord_rep_crc.cc:31: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::operator=(absl::lts_20230125::crc_internal::CrcCordState&&)'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/internal/cord_rep_crc.cc:43: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::operator=(absl::lts_20230125::crc_internal::CrcCordState&&)'
          /usr/bin/ld: /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/libmediasoup-worker.a(absl_strings_internal_cord_rep_crc.cc.o): in function `absl::lts_20230125::cord_internal::CordRepCrc::CordRepCrc()':
          /home/deploy/src/mediasoup-git-repo/target/debug/build/mediasoup-sys-7ed5151ea7b1f08b/out/build/../../../../../../worker/subprojects/abseil-cpp-20230125.1/absl/strings/internal/cord_rep_crc.h:36: undefined reference to `absl::lts_20230125::crc_internal::CrcCordState::CrcCordState()'
          collect2: error: ld returned 1 exit status

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `mediasoup-sys` due to previous error
warning: build failed, waiting for other jobs to finish...

I don't really understand what is going on. make and make test Makefile tasks do work. How can the above failure happen when running cargo? It's obviously a linking issue but no idea which one.

@ibc
Copy link
Member Author

ibc commented May 17, 2023

Maybe this: https://stackoverflow.com/questions/69866575/why-cant-linker-find-absl-references

A guy having a similar problem with abseil-cpp when building his project using C++17.

@nazar-pc
Copy link
Collaborator

Does using C++14 solve the problem for now? I think that would be the easiest to do for now, we don't have to use C++17 right now.

@ibc
Copy link
Member Author

ibc commented May 17, 2023

Protobuf also having similar problems: protocolbuffers/protobuf#12292

@ibc
Copy link
Member Author

ibc commented May 17, 2023

undefined reference to `absl::lts_20230125::crc_internal::

Trying to build with C++14 right now. For whatever reason it takes forever to build when running cargo test.

@nazar-pc
Copy link
Collaborator

For whatever reason it takes forever to build when running cargo test.

It doesn't cache anything between builds, so needs cores to build faster.

@ibc
Copy link
Member Author

ibc commented May 17, 2023

Same problem with C++14. I suspect it's not related to C++ version but to the updated version of abseil-cpp.

@ibc
Copy link
Member Author

ibc commented May 17, 2023

And I cannot try with C++11 (as in v3) because updated version of abseil-cpp requires C++14 or greater.

@nazar-pc
Copy link
Collaborator

As mentioned in mesonbuild/wrapdb#932 latest release is somewhat broken. When I was doing upgrades, I was checking the diff of CMakeFiles between releases, something might have happened that was not accounted for. There is WIP mesonbuild/wrapdb#996 that might address it eventually, I have downgraded abseil-cpp to the previous release for now. Still requires C++14 and should be new enough to resolve original issue.

Feel free to investigate what happened to abseil-cpp upstream, I'm not in the mood to dig into it right now.

@ibc
Copy link
Member Author

ibc commented May 17, 2023

Are you 100% sure that abseil-cpp-20220623.0 also contains the fix? See #1080 (comment)

@nazar-pc
Copy link
Collaborator

No, not 100%. @estnml would you mind to try this branch and confirm or deny?

GitHub Actions doesn't have GCC 13 yet either.

@ibc
Copy link
Member Author

ibc commented May 17, 2023

As mentioned in mesonbuild/wrapdb#932 latest release is somewhat broken. When I was doing upgrades, I was checking the diff of CMakeFiles between releases, something might have happened that was not accounted for. There is WIP mesonbuild/wrapdb#996 that might address it eventually

Just in case, I was replied this (but I have no idea what it means):

protocolbuffers/protobuf#12292 (comment)

CleanShot-2023-05-17-at-18 00 04@2x

So options are:

  1. We can wait for new version of abseil-cpp in Meson Wrapdb (indeed there is a known linking issue in the current latest one).
  2. Or we can use previous version assuming that @estnml confirms that this branch works with gcc 13.

@nazar-pc
Copy link
Collaborator

There is also option 3: fix it ourselves instead of waiting 😉

@ibc
Copy link
Member Author

ibc commented May 17, 2023

There is also option 3: fix it ourselves instead of waiting 😉

Fix where?

@nazar-pc
Copy link
Collaborator

Wherever the issue is. Likely in Meson wrap, but investigation is probably necessary.

@estnml
Copy link

estnml commented May 17, 2023

Hi @ibc @nazar-pc , here is what i did:

  1. clone the mediasoup repo
  2. change branch to "require-c++17-and-update-subprojects"
  3. run "npm install" on the folder.

The command ran successfully.

gcc --version: gcc (GCC) 13.1.1 20230429

@nazar-pc
Copy link
Collaborator

Should be good enough for now then, thanks for verifying!

@estnml
Copy link

estnml commented May 17, 2023

I'm glad I could help, and thanks for this beautiful project.

@ibc
Copy link
Member Author

ibc commented May 17, 2023

Thanks a lot! Merging. Will release tomorrow.

@ibc ibc merged commit 07827b4 into v3 May 17, 2023
@ibc ibc deleted the require-c++17-and-update-subprojects branch May 17, 2023 17:20
@ibc
Copy link
Member Author

ibc commented May 17, 2023

mediasoup-node 3.11.25 released and website updated (required Python >= 3.7 and C++17).

@jmillan
Copy link
Member

jmillan commented May 18, 2023

Beautiful, thanks guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

old version of abseil causes error during installation
4 participants