![]() gifsicle_x86_64 (even on a x86_64 system) to reproduce the creation of the dangling file. bash does this well and refuses to execute the file, but dash (which is the default shell on debian based distros) doesn’t and happily starts to execute it, behaving in an undefined way. The shell however may refuse to run such file, but there is no guarantee. On Ubuntu/Debian and aarch64, you’ll see the dangling file created.Īpparently, falling back to a shell in case exec* errors with ENOEXEC is what’s specified in POSIX and what’s implemented in glibc. ELF.Ġ0000010: 0200 3e00 0100 0000 f034 4000 0000 0000 4000 0000 0000 0000 f0eb 0a00 0000 0000 this creates the file named after the weird random bytes following the > character (and explains the few errors we get when running yarn or npm in -verbose mode).Īnd indeed, if you run: require("child_process").spawnSync("/path/to/gifsicle_x86_64", ).stderr.toString() As you can see the ELF file starts with something that looks like a shell redirection (notice the > character): $ curl -Lo - '' 2> /dev/null | xxd | head -3Ġ0000000: 7f45 4c46 0201 0100 0000 0000 0000 0000. At this point, as the x86_64 ELF file is not executable on an ARM64 architecture, it gets executed by as some shell script (sic). It passes through a bunch of libraries (bin-wrapper, bin-check and execa) and eventually execa invokes the command through node’s child_process.spawn which ends up invoking unix’s execvp in a subprocess. The gifsicle -version command is used to detect at installation whether the provided binary works on the current platform (to rebuild gifsicle if it isn’t). Because the file name is not a valid utf-8 string it makes yarn 1 crash at linking step, but yarn 2 (berry) seems to be fine with it and can proceed normally (like npm). ARM64 builds should also be provided along with this package.Īfter digging a bit, I found that the weird empty file is created at this point. I opened #145 which is more a workaround than an actual fix. this project shouldn’t try to execute 圆4 binary on arm64 arch in the first place, so there’s probably also a bug to fix here (or in one of the libraries).yarn 2+ will still create the dangling file (like npm), but at least won’t crash because of it. sudo ln -fs /bin/bash /bin/sh should prevent the dangling file from being created and fix the build in all cases (but may have unintended side-effects).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |