Closed freuk closed 7 years ago
This seems related to #53 do you have which
installed ?
See this comment by @dsheets https://github.com/dbuenzli/bos/issues/52#issuecomment-222643618
I do have which installed, although It will not be found in /bin/ or /usr/bin:
$ which which
/run/current-system/sw/bin/which
$ ls -lah /run/current-system/sw/bin/which
lrwxrwxrwx 1 root root 64 Jan 1 1970 /run/current-system/sw/bin/which -> /nix/store/gi2qk4pimynjhvpjqa8fh2wi28fffk6g-which-2.21/bin/which
conf-which installs without issue.
Could you make your topkg
invocation with -v -v
and post the result please.
Hum I think this is the issue
> which /usr/bin/ls
> echo $?
1
So which
with absolute paths exits with 1
.
So I guess that for absolute paths I should simply check the file's existence and if the exec bit is set (though at that point I should maybe simply implement #53).
Hum I think this is the issue
which /usr/bin/ls echo $? 1 So which with absolute paths exits with 1.
Rubish... ls
is in /bin/ls
.
> which /bin/ls
/bin/ls
>topkg distrib -v -v ~/sandbox/obandit
topkg: [INFO] topkg v0.8.1 running
topkg: [EXEC:15284] ["type"; "bzip2"]
topkg: [ERROR] bzip2: no such command
>which ls
/run/current-system/sw/bin/l
>secho $?
0
>TOPKG_BZIP2="/nix/store/yn142bzjxlngbvikkw5qgwzpy1ynbikj-bzip2-1.0.6.0.1-bin/bin/bzip2" topkg distrib -v -v ~/sandbox/obandit
topkg: [INFO] topkg v0.8.1 running
topkg: [EXEC:15520] ["type";
"/nix/store/yn142bzjxlngbvikkw5qgwzpy1ynbikj-bzip2-1.0.6.0.1-bin/bin/bzip2"]
topkg: [ERROR] /nix/store/yn142bzjxlngbvikkw5qgwzpy1ynbikj-bzip2-1.0.6.0.1-bin/bin/bzip2:
no such command
Ah topkg distrib
is handled by topkg
and not topkg-care
and hence does not depend on bos
. There's a minibos in topkg
itself due to bootstrapping purposes.
So the problem lies here: https://github.com/dbuenzli/topkg/blob/master/src/topkg_os.ml#L226-L247
Ooooh sorry for misleading you..
No problem. The system itself is a bit misleading.
So type
doesn't seem to work or nix
or what ?
It's simply not there on my system.
which: no type in [...]
I'm not sure there's a reason no to use which
there. I opened https://github.com/dbuenzli/topkg/issues/99. Are you able to find a type
to proceed ? If not tell me there I'll have a look at it today.
I've solved by putting
#!/bin/sh
builtin type "$@"
in ~/.bin/ . Not a pleasant solution but.. it does the job. the executable is actually made like this on fedora systems, and in general this appears to be a shell builtin.
Thank you very much for your help @dbuenzli
I've solved by putting
Ugh.
Not a pleasant solution but.. it does the job. the executable is actually made like this on fedora systems, and in general this appears to be a shell builtin.
But there's something I don't understand here. The topkg
code is using OCaml's Sys.command
so this should go through the shell.
The OS.Cmd.must_exist always fails on NixOS, due to line 84 in bos_os_cmd.ml "let exists line" function failing.
Example:
Any idea? I'd like to use the dependent packages :-) Thank you very much.