Comments (14)
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.
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.
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.
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.
@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.
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.
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.
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.
@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.
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.
@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.
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.
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.
@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)
- Optional chaining error
- Lates Flow-bin broken HOT 3
- empty Object is inexact HOT 2
- docs react elementtype fail HOT 1
- why error? Why in React ElementType with AbstractComponent config empty? HOT 1
- Flow server reporting wrong version HOT 2
- flow-bin 0.125.0 is missing binaries HOT 1
- $FlowFixMe not taken into account anymore in some situations with 0.129.0 HOT 8
- Support for Stage-4 ES proposal-logical-assignment HOT 1
- Passing props to stylesheet returns error
- Slow Server rechecks HOT 1
- Need to close/re-open file for flow to re-analyze it, autocomplete and show definition not working HOT 1
- Flow complains about nullable value inside useEffect HOT 2
- Object.entries always returns type [ string, mixed ] HOT 1
- flow is crashing on windows system HOT 2
- Flow server crashes on the Gitlab CI HOT 1
- Flow crashes on macOS HOT 1
- Unhandled exception: Unix.Unix_error(Unix.EINVAL, "ftruncate", "") HOT 1
- Local modules not resolved with v0.178 HOT 1
- Could not start Flow server! [Server_start_failed (exit, 8)] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flow-bin.