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?
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..
Hi I have the same issue however when I changed the `bin/bash` to usr/bin/env bash, the `compact compile –help ` command doesn’t work it returns failed to run compactc caused by 0:failed to spawn compactc command1: Exec format error (os error 8) however when I run ./compactc –help it works. Why does this happen?
Hi, sorry for the late reply. I’m using version 0.26.0. I’ve been able to fix the issue, apparently the first line of my compactc file was whitespace and my #!/usr/bin/env bash was on the second line. Cleared the whitespace and that fixed it for me
Thanks man. I tried using buildFHSUserEnv too I created a shell.nix file and added curl as a targetPkg, I ran nix-shell on it and when I installed the compact compiler I still hit the same issue, an os 2 error. I understand that buildFHSUserEnv tool is used to simulate an environment that makes use of the normal Linux FHS. Did compact compile --Help fail because I didn’t specify compact and all the required packages in my buildFHSUserEnv tool? What do you think?
Thanks for the update. Using buildFHSUserEnv was a great idea!
But even inside the FHS sandbox, the compact compile command points to hardcoded paths outside of the isolated environment. (When you leave the nix-shell, compact is still installed on the system.)
This means the ‘os 2 error’ is probably the first-line shebang issue again.
Patching this every time is annoying, but a quick bash script to automate the first-line fix would definitely be useful here.
With the next release of the compiler, you won’t have to manually modify the bash script anymore. Standard users will be able to run the compiler without encountering errors related to that issue.
However, setting up a contained virtual dev environment is another story…