Hi guys
I’m currently running nixOS on my computer and the command compact compile doesn’t work out of the box after installing compact from :
curl --proto ‘=https’ --tlsv1.2 -LsSf ``https://github.com/midnightntwrk/compact/releases/latest/download/compact-installer.sh`` | sh
compact 0.25.0 is currently installed
$ compact check
compact: x86_64-unknown-linux-musl – Up to date – 0.25.0
I’m getting this error:
$compact compile --help
Error: Failed to run compactc
Caused by:
0: Failed to spawn compactc command
1: No such file or directory (os error 2)
I’m looking for a fix, so any help is welcome.
Thanks
It sounds like the installed compactc binary is not compatible with nixOS, maybe some missing library which was dynamically linked, I’m guessing only since I don’t use nixOS.
compactc is not executable on my terminal, I wonder if it’s normal.
meanwhile:
/home/hk/.compact/bin/compactc
/home/hk/.compact/versions/0.25.0/x86_64-unknown-linux-musl/compactc
/home/hk/.compact/versions/0.25.0/x86_64-unknown-linux-musl/compactc.bin
Does compactc –-help return something on your side?
Yes, I’m able to run this and it returns the help menu:
$ ~/.compact/versions/0.25.0/x86_64-unknown-linux-musl/compactc --help
I just noticed the compactc is a script which just executes the compactc.bin:
#!/bin/bash
thisdir="$(cd $(dirname $0) ; pwd -P)"
PATH="$thisdir:$PATH"
exec "$thisdir/compactc.bin" "$@"
Perhaps you are having an issue related to this: Add /bin/bash to avoid unnecessary pain - Development - NixOS Discourse
Not sure, but perhaps you can just edit compactc and change #!/bin/bash to #!/usr/bin/env bash ?.. just guessing …
1 Like
bochaco:
#!/usr/bin/env bash
Yes, it was the issue!
Adding #!/usr/bin/env bash as the first line of the compactc bash file in ~/.compact/versions/0.25.0/x86_64-unknown-linux-musl resolved the issue.
Thank you!
2 Likes
Hello,
I encountered the same issue after updating to version 0.26.
I opened an issue on the Midnight network Compact repository.
…
opened 09:39PM - 09 Oct 25 UTC
public
compact
### Context & versions:
```
$ compact --version && compact list -i
compact 0.2.… 0
compact: installed versions
→ 0.26.0
0.25.0
0.24.0
```
```
$ neofetch --off
hk@nixos
--------
OS: NixOS 25.05.810656.5b5be50345d4 (Warbler) x86_64
Host: Dell Inc. 0P9FNW
Kernel: 6.12.49
Uptime: 2 hours, 26 mins
Packages: 1304 (nix-system), 576 (nix-user)
Shell: bash 5.2.37
```
### Steps to reproduce:
1- Run the compact install command on NixOS 25.05:
`curl --proto '=https' --tlsv1.2 -LsSf https://github.com/midnightntwrk/compact/releases/latest/download/compact-installer.sh | sh`
2- Update it to the latest version
`compact update`
3- Try to print the help of compact compile
`compact compile --help`
### Actual behavior:
```
$compact compile --help
Error: Failed to run compactc
Caused by:
0: Failed to spawn compactc command
1: No such file or directory (os error 2)
```
### Expected behavior:
The `compact compile --help` command print the help.
### Suggestion
Changing the bash script header to `#!/usr/bin/env bash` enhances script portability.
I've modified the bash script at
`/home/hk/.compact/versions/0.26.0/x86_64-unknown-linux-musl/compactc`
from:
```
#!/bin/bash
thisdir="$(cd $(dirname $0) ; pwd -P)"
PATH="$thisdir:$PATH"
exec "$thisdir/compactc.bin" "$@"
```
to :
```
#!/usr/bin/env bash
thisdir="$(cd $(dirname $0) ; pwd -P)"
PATH="$thisdir:$PATH"
exec "$thisdir/compactc.bin" "$@"
```
Solved the issue on my end.
1 Like
ohh wonderful.. thats been an issue for me as well but I was concerned it was my new mac os 26, and I just kinda gave up and took a breather.. This forum has been most useful..
1 Like