Chocobozzz / PeerTube

ActivityPub-federated video streaming platform using P2P directly in your web browser
https://joinpeertube.org/
GNU Affero General Public License v3.0
12.88k stars 1.48k forks source link

Failing to install 6.2.0 on Alpine Linux #6486

Closed EBendinelli closed 1 month ago

EBendinelli commented 1 month ago

Describe the problem

We've been running Peertube on an Alpine Linux VM for quite a few years now but we can't seem to update to 6.2.0 from 6.1.0. The problem seems to be related to something failing to compile (I assume related to the automatic transcription feature).

After installing cmake and libressl-dev to tackle some error messages we got trying to run the install, we're eventually faced with this error when running the yarn install command:

[97%] Building CXX object CMakeFiles/node_datachannel.dir/src/thread-safe-callback.cpp.o 
[ 97%] Building CXX object CMakeFiles/node_datachannel.dir/src/web-socket-wrapper.cpp.o 
[97%] Building CXX object CMakeFiles/node_datachannel.dir/src/web-socket-server-wrapper.cpp.o 
[100%] Building CXX object CMakeFiles/node_datachannel.dir/src/main.cpp.o 
[100%] Linking CXX shared library Release/node_datachannel.node
relocation against PKCS12_SAFEBAG_it' in read-only section.text'
/usr/lib/libcrypto.a(libcrypto_la-p12_asn.o): warning: /usr/lib/libssl.a(libssl_la-ssl_sigalgs.o):
/usr/lib/gcc/x86_64-alpine-linux-mus1/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-mus1/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: 
R_X86_64 PC32 against symbol sigalgs' can not be used when making a shared object; recompile with -fPIC 
/usr/lib/gcc/x86_64-alpine-linux-mus1/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: final link failed: bad value 
collect2: error: ld returned 1 exit status 
make[2]: *** [CMakeFiles/node_datachannel.dir/build.make: 279: Release/node_datachannel.node] Error 1 
make[1]: *** [CMakeFiles/Makefile2:368: CMakeFiles/node_datachannel.dir/all] Error 2
make: *** [Makefile: 136: all] Error 2
ERR! OMG Process terminated: 2
prebuild ERR! build Error: Failed to build cmake with exit code 1
prebuild ERR! build at ChildProcess.<anonymous> (/media/ceph/data/peertube/versions/peertube-v6.2.0/node_modules/node-datachan

Now I can't tell whether this is happening because we're missing certain packages on our distro to properly compile this or because of a bug upstream. Any support appreciated!

Additional information

Chocobozzz commented 1 month ago

Hi,

It's not related to transcription but to a PeerTube dependency update (see https://github.com/webtorrent/bittorrent-tracker/pull/519#issuecomment-2233173704)

Unfortunately I don't have a solution yet

ThaUnknown commented 1 month ago

this should work on npm? try not using yarn for this and see what hpns

EBendinelli commented 1 month ago

Thanks for the reply, seems that the bittorrent tracker is indeed the issue.

this should work on npm? try not using yarn for this and see what hpns

Doesn't seem to help:

npm WARN config production Use `--omit=dev` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: peertube@6.2.0
npm ERR! Found: chai@5.1.1
npm ERR! node_modules/chai
npm ERR!   dev chai@"^5.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer chai@">= 1.6.1 < 5" from chai-json-schema@1.5.1
npm ERR! node_modules/chai-json-schema
npm ERR!   dev chai-json-schema@"^1.5.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /media/ceph/data/peertube/.npm/_logs/2024-07-17T13_50_25_401Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /media/ceph/data/peertube/.npm/_logs/2024-07-17T13_50_25_401Z-debug-0.log
src386 commented 1 month ago

I tried to remove that lib from package.json. The build works, but peertube won't start.

ThaUnknown commented 1 month ago

ndc runs fine on all dists i tested if installed via npm, this is likely a yarn issue, from the error above seems like ur dependency tagging is wrong, downgrade chai to v <5

Chocobozzz commented 1 month ago

Please don't downgrade or remove things from package.json, just wait a proper fix :)

Chocobozzz commented 1 month ago

Should be fixed by https://github.com/Chocobozzz/PeerTube/commit/f7ec8401c54c40e3fe1f305210fd34055aeb177a

I hope it gets fixed upstream, because I'm not sure we can stick with this old webtorrent version forever, and I don't want to fork it.

src386 commented 1 month ago

Thank you sir, it works for me (FreeBSD aarch64).

EBendinelli commented 3 weeks ago

Also working here now, thanks for the fix