GithubHelp home page GithubHelp logo

Comments (14)

frontsideair avatar frontsideair commented on May 3, 2024 4

Also in my default.nix I have these lines for patching the flow I get from npm. I hope anyone reading here finds it useful.

    cp node_modules/flow-bin/flow-linux64-v*/flow flow
    chmod a+rw flow
    patchelf \
      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
      --set-rpath ".:${pkgs.stdenv.cc.libc}/lib" \
      flow

from flow-bin.

ysangkok avatar ysangkok commented on May 3, 2024

The problem is probably with the binary build having dependencies. Try running ldd on the binary file file in node_modules/flow-bin/flow-linux64-VERSION/flow. At least on my Alpine, it couldn't find libelf.

Since you are using NixOS, maybe you are familiar with patchelf, it might be able to fix your issue.

from flow-bin.

frontsideair avatar frontsideair commented on May 3, 2024

Thanks @ysangkok, I guess the problem is flow can't find glibc which is custom in NixOS and probably patchelf would solve it; but flow got updated in nixpkgs, so I guess I don't have to try it. 🎉

from flow-bin.

iclanzan avatar iclanzan commented on May 3, 2024

I hope you don't mind me commenting on this issue, but I would like to solve the problem presented in OP, namely I would like to get flow-bin working instead of using the global flow binary.

@ysangkok can you provide an example on how to use patchelf to patch the binary?

from flow-bin.

ysangkok avatar ysangkok commented on May 3, 2024

@iclanzan I started just using the binary in this Docker image instead: https://hub.docker.com/r/rezzza/docker-flow/

If you can run it with Docker directly, of course that is even better.

from flow-bin.

iclanzan avatar iclanzan commented on May 3, 2024

The problem is I need to use the specific flow version we have pinned down in package.json, so ideally I would get that one to run somehow.

from flow-bin.

Abdillah avatar Abdillah commented on May 3, 2024

In my case, all the ldd deps has been fulfilled, but it still error,

$ # version 0.64.0
$ ldd /home/fazbdillah/Project/Lineart/lineart/node_modules/flow-bin/flow-linux64-v0.64.0/flow
	linux-vdso.so.1 (0x00007ffcbf6a2000)
	libpthread.so.0 => /nix/store/HASH-glibc-2.25-49/lib/libpthread.so.0 (0x00007fafcb58e000)
	libm.so.6 => /nix/store/HASH-glibc-2.25-49/lib/libm.so.6 (0x00007fafcb27b000)
	libdl.so.2 => /nix/store/HASH-glibc-2.25-49/lib/libdl.so.2 (0x00007fafcb077000)
	libc.so.6 => /nix/store/HASH-glibc-2.25-49/lib/libc.so.6 (0x00007fafcacd8000)
	/lib64/ld-linux-x86-64.so.2 => /nix/store/HASH-glibc-2.25-49/lib64/ld-linux-x86-64.so.2 (0x00007fafcb7ac000)

Version mismatch?

P.S.
The global package is doing fine. As I need to use the local package on package.json script.

EDIT
I change the version from v0.56.0

from flow-bin.

Abdillah avatar Abdillah commented on May 3, 2024

In the case of global package, it needs different version than above shared libs,

$ flow version
Flow, a static type checker for JavaScript, version 0.64.0

$ ldd `which flow`                                                                                                                                                    
	linux-vdso.so.1 (0x00007ffd3f0b8000)
	libev.so.4 => /nix/store/HASH-libev-4.24/lib/libev.so.4 (0x00007ff2c4032000)
	libpthread.so.0 => /nix/store/HASH-glibc-2.26-131/lib/libpthread.so.0 (0x00007ff2c3e14000)
	librt.so.1 => /nix/store/HASH-glibc-2.26-131/lib/librt.so.1 (0x00007ff2c3c0c000)
	libm.so.6 => /nix/store/HASH-glibc-2.26-131/lib/libm.so.6 (0x00007ff2c38c0000)
	libdl.so.2 => /nix/store/HASH-glibc-2.26-131/lib/libdl.so.2 (0x00007ff2c36bc000)
	libc.so.6 => /nix/store/HASH-glibc-2.26-131/lib/libc.so.6 (0x00007ff2c330a000)
	/nix/store/HASH-glibc-2.26-131/lib/ld-linux-x86-64.so.2 => /nix/store/HASH-glibc-2.25-49/lib64/ld-linux-x86-64.so.2 (0x00007ff2c4240000)

from flow-bin.

arypurnomoz avatar arypurnomoz commented on May 3, 2024

@Abdillah i also got the exact same problem. Though the flow on nixpkgs is working, but the package version is way behind the current latest flow version.

from flow-bin.

frontsideair avatar frontsideair commented on May 3, 2024

Me and a few others try to keep flow on nixpkgs up-to-date, but stable can be behind the latest version. I use the unstable channel for my personal use.

from flow-bin.

tdietert avatar tdietert commented on May 3, 2024

@frontsideair would you mind pasting the exact flow override from your default.nix? I'm new to nix and am unsure exactly how I'd implement your patch. Thanks!

from flow-bin.

frontsideair avatar frontsideair commented on May 3, 2024

The whole default.nix may be too much but I'm pasting the related part:

yarn2nix.mkYarnPackage {
  src = ./.;
  buildPhase = ''
    set -e
    export HOME=`pwd`/yarn_home

    # patch flow
    cp node_modules/flow-bin/flow-linux64-v*/flow flow
    chmod a+rw flow
    patchelf \
      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
      --set-rpath ".:${pkgs.stdenv.cc.libc}/lib" \
      flow
  '';
};

from flow-bin.

srghma avatar srghma commented on May 3, 2024

for me solution was

patchelf \
  --set-interpreter "$(cat $(echo $(nix-build --no-out-link -E 'with import <nixpkgs> {}; pkgs.stdenv.cc')/nix-support/dynamic-linker))" \
  ./node_modules/flow-bin/flow-linux64-v0.105.1/flow

from flow-bin.

trusktr avatar trusktr commented on May 3, 2024

@srghma Would you mind providing some advice about this over here on the NixOS forums? https://discourse.nixos.org/t/running-node-electron-app-gives-enoent-error-in-nixos/5590

from flow-bin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.