Skip to content

compact compile does not work out of the box on NixOS #17

@honoratkablansi

Description

@honoratkablansi

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions