Hello, me again lol upgrading pact to use V3, from...
# pact-js
h
Hello, me again lol upgrading pact to use V3, from
9.17.2
to
10.0.0-beta.60
it causes GLIBC error
Copy code
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /app/node_modules/@pact-foundation/pact-core/build/Release/libpact_ffi.so)
is there any fix / recommendation to work around that?
m
You’ll need to ensure glibc version 2.25 is installed. Are you running a really new / old OS?
h
maybe perhaps old version causes issue
Copy code
root@05bea7a0a1d7:/app/app# apt list libc6
Listing... Done
libc6/now 2.24-11+deb9u4 amd64 [installed,local]

root@05bea7a0a1d7:/app/app# ldd --version
ldd (Debian GLIBC 2.24-11+deb9u4) 2.24
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
try to upgrade now
the latest stable version of glibc which debian 9 supported is 2.24, do we need to upgrade OS? , if so which one is recommended? it is for CI pipeline
node:14-slim
we are using now, do we need to upgrade?
it is little bit weird, we upgrade to node-16 slim
Debian GNU/Linux 10 (buster)
now it complaints
Copy code
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.29' not found
m
Is is technically (just!) Out of support and end of life.
🤔
Looks like libc wants a different glib C. You can have both I believe
h
it looks like always complaints version lol when we tried node-14, it installed 2.24 but looking for 2.25 node-16 it installed 2.28 but looking for 2.29 lol
m
Interesting. I'll see if I can reproduce. I know we need a specific glib C min but if the OS brings in a new set there will be different transitive dependencies
t
You can tell gcc to compile against a lower glibc (the default is the highest, I believe). However, I'm confused about why it complains about different requirements on different OS / node combinations. Is this
.so
file compiled on demand? It could be a problem in the toolchain somewhere.
or some complexity that I don't know about 😕
m
It is compiled on demand
The FFI is dynamic though, as you know
As an aside, I think an update to the issue template will be warranted here
t
libpact_ffi.so
<-- is this compiled by the rust thingy, or by the node-gyp machinery? (I forget)
If the node-gyp machinery, I suspect it is misconfigured. If by rust, then perhaps the glibc requirements can be lowered
m
That's pre compiled. Good idea, but not sure it explains the problem here? (I think glibc 25 is required from memory)
If you pin to say, glibc 22 my assumption is it's forward compatible?
👍 1
t
Yes, I think that's right. I'm confused about why the version changed when the OS (probably the culprit) and node version changed, though.
h
Hello, so should I try glibc 22??
and node-14:slim is out of support , right?
t
Could you make a reproduceable docker container?
h
yeap I hace docker file, but we pull down image from organisation AWS lol I will share brief one, before update to
beta
it was working btw
Copy code
FROM `{THIS IS ORGANISAION AWS}`/node:14-slim

RUN apt-get update -y && \
    apt-get install -y git g++ libpq-dev awscli curl && \
     curl -L "<https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64>" \
     -o /usr/local/bin/cc-test-reporter && \
     chmod +x /usr/local/bin/cc-test-reporter && \
     rm -rf /var/lib/apt/lists/*

RUN yarn global add aws-cdk@latest typescript ts-node

COPY package.json /app/package.json
COPY yarn.lock /app/yarn.lock

WORKDIR /app
RUN yarn
t
The stable release doesnt do this compilation, so that's not a surprise. I'm curious why the version error is changing between docker images- probably I just don't understand something
We can't reproduce with that docker image, because we don't have the images or the files it is copying
h
the only change, we did is
"@pact-foundation/pact": "~9.17.2",
to beta version
10.0.0-beta.60
lol
t
If you can reproduce this with a public docker image and package.json (etc), that would be helpful
h
ok let me try
some reproducible error here
Copy code
#9 175.8 make: Entering directory '/app/node_modules/@pact-foundation/pact-core/build'
#9 175.8   CXX(target) Release/obj.target/pact/native/addon.o
#9 175.8   CXX(target) Release/obj.target/pact/native/ffi.o
#9 175.8   CXX(target) Release/obj.target/pact/native/consumer.o
#9 175.8   CXX(target) Release/obj.target/pact/native/provider.o
#9 175.8   CXX(target) Release/obj.target/pact/native/plugin.o
#9 175.8   SOLINK_MODULE(target) Release/obj.target/pact.node
#9 175.8 /usr/bin/ld: skipping incompatible /app/node_modules/@pact-foundation/pact-core/ffi/libpact_ffi.so when searching for -lpact_ffi
#9 175.8 /usr/bin/ld: cannot find -lpact_ffi
#9 175.8 collect2: error: ld returned 1 exit status
#9 175.8 make: *** [<http://pact.target.mk:152|pact.target.mk:152>: Release/obj.target/pact.node] Error 1
#9 175.8 make: Leaving directory '/app/node_modules/@pact-foundation/pact-core/build'
m
thanks!
For the last bit of the repro, can you please show the steps you used to run the container?
h
1. download pact-demo.zip 2. upzip then go do unziped folder 3. run
docker build .
command 4. then you can see this error on your terminal 🙂
m
perfect, thanks
👍 1
h
thanks Matt !
m
/usr/bin/ld: skipping incompatible /app/node_modules/@pact-foundation/pact-core/ffi/libpact_ffi.so when searching for -lpact_ffi
that’s the key line. Are you running on M1 by any chance?
h
yeap mine is M1
but FYI original issue starts from CI docker image lol
m
right, so it works for me when I run like this
docker build --platform linux/amd64 .
I suspect your CI problem is different (in fact, the logs look different so I think it is)
The issue with the M1 build, is that it’s trying to use a linux x86_64 shared library (pact_ffi) but the OS architecture is actually linux arm because you’re running it on M1
h
oh yeap it works with paltform lol hum, so it looks like beta version with public docker image build well….
👍 1
maybe it has an sissue with inhouse image(adding extra library built in)
m
if you can help repro that, it would be ideal
I’ll update beta docs with the note about M1 above. I think there was a discussion about building for linux/arm but that it was fraught with issues
👍 1
h
yeap I will keep try to run same ci setup to my local to generate same message ! let you know
👍 1
I got it, so what I did 1. download pact-demo.zip 2. upzip then go do unziped folder 3. run
docker build --platform linux/amd64 -t test-pact-beta .
4. after build image, run
docker run test-pact-beta
Copy code
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.29' not found (required by /app/node_modules/@pact-foundation/pact-core/build/Release/libpact_ffi.so)

      at Runtime._loadModule (node_modules/jest-runtime/build/index.js:893:29)
      at bindings (node_modules/bindings/bindings.js:112:48)
      at Object.<anonymous> (node_modules/@pact-foundation/pact-core/src/ffi/index.ts:6:21)
exact same error from CI
👍 1
another additional info
node:18-slim
it does not cause error lol so only node 14, and 16
🤔 1