peroxide icon indicating copy to clipboard operation
peroxide copied to clipboard

src/scheme-lib/init.scm - No such file

Open milahu opened this issue 4 years ago • 2 comments

should be verbose error

current output

$ ./result/bin/main
No previous history.
Error: No such file or directory (os error 2)

$ strace --trace=file ./result/bin/main 2>&1 | grep 'No such file' | grep -v -e /nix/store -e /etc/ld-nix.so.preload
openat(AT_FDCWD, "history.txt", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "src/scheme-lib/init.scm", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
Error: No such file or directory (os error 2)

https://github.com/MattX/peroxide/blob/a36a6359dba9351533066de7aa5e655855f53760/src/bin/main.rs#L62

the file path src/scheme-lib/init.scm is relative to the current workdir (cwd) suggestion: allow to set library path via argv or env

peroxide --scheme-lib /usr/share/peroxide/scheme-lib
SCHEME_LIB=/usr/share/peroxide/scheme-lib peroxide

milahu avatar Nov 26 '21 18:11 milahu

Yeah, that seems like a good option, and there should probably also be a mechanism to specify the library path at build time, probably through a build.rs script?

MattX avatar Nov 29 '21 19:11 MattX

This should be partially resolved with dee2de6, but I'd also like to add a way to change the library file location at build time, so we can keep this as a tracking issue.

MattX avatar Dec 07 '21 04:12 MattX