-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Fail to install on Ubuntu 22 LTS #178
Comments
Thanks for reporting. |
I am just installing this lib as transient dependency, and fail to do so in this environment |
I have Ubuntu 20.04. I installed openssl 3.0.10 I can run the tests and can install as dependency without any problem. Could you please try with a new project? Here is my output
|
Ubuntu 20 works for me aswell, however with v 22 (I am using 22.04). It does not work longer work since it no longer ships OpenSSL 1.1 which this lib seems to require (not 3) |
You mean it is working also for you with 20.04 + OpenSSL 3? |
It succeds to install on Ubuntu 20 out of box without installing OpenSSL 3 because Ubuntu 20 already ships OpenSSL 1.1 (?). It fails to install on Ubuntu 22 out of the box. |
The problem is not related to Ubuntu 20 or 22.04 Please check note on README I got an error while trying to link it statically node-datachannel/CMakeLists.txt Line 24 in 9e35a20
Since I didn't have an aarch64 CPU I couldn't investigate more. Maybe you can. |
I'm getting the same error on arm64 Debian bookworm:
Installing the libssl1.1 package from bullseye seems to be an effective workaround. |
Hello, As I replied here #178 (comment); Please Check here; node-datachannel/CMakeLists.txt Line 27 in c8197e2
I dont have a arm64 PC so I can not test more. If anyone can find a solution for that I will be happy to merge it. |
FYI i'm on an M1 mac and I just started seeing this error with https://github.com/ipfs/helia-http-gateway. the dockerfile is at https://github.com/ipfs/helia-http-gateway/blob/main/Dockerfile and the error i get is:
I was able to change the "CMD" so that I could get into the container and investigate.
Now i'm working on a way to get libcrypto.so.1.1 installed on a newer version of debian |
@murat-dogan i'd be interested in helping figure out a way to not fallback to openssl1.1 for M1 builds. Can you guide me a little bit on what the process would look like? I cloned the repo and ran I modified CMakeLists.txt as follows: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6f29c3b..ed2b086 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,10 +24,10 @@ endif()
# /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: ../sysroot/usr/lib/aarch64-linux-gnu/libcrypto.a(sha1-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
# ../sysroot/usr/lib/aarch64-linux-gnu/libcrypto.a(sha1-armv8.o): in function `sha1_block_armv8':
# (.text+0x1240): dangerous relocation: unsupported relocation
-if(NOT ${NODE_ARCH} STREQUAL "arm64")
- set(OPENSSL_USE_STATIC_LIBS TRUE)
- find_package(OpenSSL REQUIRED)
-endif()
+#if(NOT ${NODE_ARCH} STREQUAL "arm64")
+set(OPENSSL_USE_STATIC_LIBS TRUE)
+find_package(OpenSSL REQUIRED)
+#endif()
include(FetchContent)
and got the following build log output with I'm happy to help if you have time to provide some guidance :) |
@SgtPooki Thank you. What I see from logs is you have OpenSSL v3 installed. So It will build also with it happily.
But the problem is we are building it as dynamically linked against OpenSSL. node-datachannel/CMakeLists.txt Lines 27 to 30 in a07715d
To be sure I created a new branch with required changes. https://github.com/murat-dogan/node-datachannel/tree/arm64-static-openssl This is github ci file I am using; |
I tried to build it with actions, it also built somehow :) Could you please check the result and actions? Could you download the binary and test it? |
This is the result for linux. It must be something like that.
|
I think i may try to build in the docker container for helia-http-gateway since i can repro the failure state more easily with that. Thanks for the guidance. I will try later tonight or tomorrow morning |
for both of the below, I first executed When I run root@bcf0b3696f76:/app/tmp# ldd build/Release/node_datachannel.node
not a dynamic executable macos doesn't have ╰─ ✘ 1 ❯ otool -L build/Release/node_datachannel.node
build/Release/node_datachannel.node:
@rpath/node_datachannel.node (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1200.3.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0) |
Trying to install the package from the branch you provided results in the following error:
so i ran |
I think it's fixed as long as running diff --git a/package.json b/package.json
index 7b171e0..00a2756 100644
--- a/package.json
+++ b/package.json
@@ -124,5 +124,8 @@
"patch-package": "^8.0.0",
"typescript": "5.x",
"wait-on": "^7.1.0"
+ },
+ "overrides": {
+ "node-datachannel": "github:murat-dogan/node-datachannel#arm64-static-openssl"
}
} and it runs successfully with I pushed these changes up to https://github.com/ipfs/helia-http-gateway/tree/test-node-datachannel if you need it for any reason. Note that this is on a debian based box.. I can test on ubuntu 22 LTS as well if desired. |
it's working in Ubuntu22 as well. Seems like things work fine? Let me know if you need anything else
You can probably remove the following node-datachannel/.github/workflows/build-mac-m1.yml Lines 21 to 25 in fa6f7c7
and replace with openssl3.0 install? but this may break users who currently depend on openssl1.0 and don't have openssl3.0 installed? (i.e. You could build a basic docker image that looks similar to the one I tested ubuntu22 with(see below) and run in your CI with something like: https://github.com/ipfs/helia-http-gateway/blob/da4c8609e143880e367c5483b200de1c1adfad5e/.github/workflows/docker.yml#L40-L49 Dockerfile for reproduction & posterity:To build it manually: # minimal.Dockerfile
FROM --platform=$BUILDPLATFORM ubuntu:22.04 as builder
RUN apt update
RUN apt install -y build-essential
RUN apt install -y cmake libssl-dev
RUN apt install -y wget curl
ENV NODE_MAJOR 20
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_MAJOR}.x | bash -
RUN apt-get install -y nodejs
WORKDIR /app
RUN apt install -y git
ENV PKG_JSON '{ }'
RUN echo $PKG_JSON > package.json
# node-datachannel@0.5.5 fails on npm install with Error: libcrypto.so.1.1: cannot open shared object file: No such file or directory
# RUN npm i --save node-datachannel@0.5.5
RUN npm i --save github:murat-dogan/node-datachannel#arm64-static-openssl
CMD [ "node", "node_modules/node-datachannel/test/connectivity.js" ] |
@marcus-pousette |
Ubuntu 22.04.2 LTS (GNU/Linux 5.19.0-1025-aws aarch64)
Node v19.9.0
But when I run
yields
Why do I need openssl-1.1.1 ?
The text was updated successfully, but these errors were encountered: