Error: Failed to run compactc

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. :slight_smile:

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

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.

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