Skip to content

Linux native module references libsdkencryptedappticket.so using CI absolute path #1

Description

@mprevel

Hi,

First of all, thanks for your work on this project! I'm currently evaluating @node-3d/steam-api for an Electron game and encountered a small issue with the Linux binary.

Environment

  • @node-3d/steam-api: 0.4.0
  • Electron: 44.0.0
  • Linux x64

Problem

Loading @node-3d/steam-api from Electron fails with:

Error: /home/runner/work/steam-api/steam-api/.sdk/sdk/public/steam/lib/linux64/libsdkencryptedappticket.so: cannot open shared object file: No such file or directory
    ...
code: 'ERR_DLOPEN_FAILED'

I inspected the native module with:

find node_modules/@node-3d/steam-api -name '*.node' -exec \
  readelf -d {} \; | grep -E 'NEEDED|RPATH|RUNPATH'

which gives:

NEEDED  Shared library: [libsteam_api.so]
NEEDED  Shared library: [/home/runner/work/steam-api/steam-api/.sdk/sdk/public/steam/lib/linux64/libsdkencryptedappticket.so]
NEEDED  Shared library: [libstdc++.so.6]
NEEDED  Shared library: [libc.so.6]
RUNPATH Library runpath: [$ORIGIN]

libsdkencryptedappticket.so itself is correctly included in the npm package:

node_modules/@node-3d/steam-api/bin-linux/libsdkencryptedappticket.so

So it looks like the absolute path from the GitHub Actions build environment is being recorded in the ELF dependency.

Workaround

I was able to make it work by replacing the absolute dependency:

patchelf \
  --replace-needed \
  /home/runner/work/steam-api/steam-api/.sdk/sdk/public/steam/lib/linux64/libsdkencryptedappticket.so \
  libsdkencryptedappticket.so \
  <native-module>.node

After that, readelf reports:

NEEDED  Shared library: [libsteam_api.so]
NEEDED  Shared library: [libsdkencryptedappticket.so]
RUNPATH Library runpath: [$ORIGIN]

and the package loads successfully from Electron.

Would it be possible to adjust the Linux release build so that the published native module references libsdkencryptedappticket.so rather than the absolute CI path?

Thanks again for the project and for taking a look!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions