Cannot publish an executable

Hi, I am trying to publish a simple package: GitHub - etorreborre/chatgpt_rust: chatgpt_rust executable but I am getting an error:

flox publish                                                                                                                                                                                                                                                                                                                                                                                                                      /nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh: line 1372: shift: shift count out of range

and the debug session returns

[DEBUG] [flox::config] `$FLOX_CONFIG_HOME` not set, using "/Users/etorreborre/.config/flox/"
[DEBUG] [flox::config] `FLOX_CONFIG_HOME` not set, using "/Users/etorreborre/.config/flox/"
[DEBUG] [flox::utils::init::metrics] Attempting to read own UUID from file
[DEBUG] [flox::config::features] `FLOX_FEATURES_PUBLISH` unset or not "rust", falling back to legacy flox
[DEBUG] [flox] Running in flox with arguments: ["--debug", "publish"]
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:149 hash_commands( ansifilter awk basename bash cat chmod cmp column cp curl cut dasel date dirname getent gh git grep gum id jq ln man mkdir mktemp mv nix nix-editor nix-store pwd readlink realpath rm rmdir sed sh sleep sort stat tail tar tee touch tr uname uuid xargs zgrep )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:169 first_in_PATH( vim vi nano emacs ed )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/bootstrap.sh:25 floxUserMetaRegistry( get floxClientUUID )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:699 registry( /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.sahdOr77vQ 1 get floxClientUUID )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:611 invoke( /nix/store/3xxpk5nhfq92dx5kn63nknbzv9j49yk2-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.sahdOr77vQ --args -- get floxClientUUID )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/bootstrap.sh:27 floxUserMetaRegistry( get floxClientUUID )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:699 registry( /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.sahdOr77vQ 1 get floxClientUUID )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:611 invoke( /nix/store/3xxpk5nhfq92dx5kn63nknbzv9j49yk2-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.sahdOr77vQ --args -- get floxClientUUID )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/bootstrap.sh:34 floxUserMetaRegistry( get floxMetricsConsent )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:699 registry( /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.sahdOr77vQ 1 get floxMetricsConsent )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:611 invoke( /nix/store/3xxpk5nhfq92dx5kn63nknbzv9j49yk2-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.sahdOr77vQ --args -- get floxMetricsConsent )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/bootstrap.sh:57 floxUserMetaRegistry( get educatePublish )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:699 registry( /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.sahdOr77vQ 1 get educatePublish )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:611 invoke( /nix/store/3xxpk5nhfq92dx5kn63nknbzv9j49yk2-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.sahdOr77vQ --args -- get educatePublish )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/init.sh:350 updateFloxFlakeRegistry(  )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:1240 getChannelsJSON(  )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:1218 floxUserMetaRegistry( get channels )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:699 registry( /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.sahdOr77vQ 1 get channels )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:611 invoke( /nix/store/3xxpk5nhfq92dx5kn63nknbzv9j49yk2-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.sahdOr77vQ --args -- get channels )
trace:/dev/fd/63:1 invoke( /nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/libexec/flox/nix registry add --registry /Users/etorreborre/.config/flox/tmp.wZ7f9fmSDg etorreborre github:etorreborre/floxpkgs/main )
trace:/dev/fd/63:2 invoke( /nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/libexec/flox/nix registry add --registry /Users/etorreborre/.config/flox/tmp.wZ7f9fmSDg flox github:flox/floxpkgs/master )
trace:/dev/fd/63:3 invoke( /nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/libexec/flox/nix registry add --registry /Users/etorreborre/.config/flox/tmp.wZ7f9fmSDg nixpkgs-flox github:flox/nixpkgs-flox/master )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:1247 invoke( /nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/libexec/flox/nix registry add --registry /Users/etorreborre/.config/flox/tmp.wZ7f9fmSDg nixpkgs github:flox/nixpkgs/stable )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:1248 invoke( /nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/libexec/flox/nix registry add --registry /Users/etorreborre/.config/flox/tmp.wZ7f9fmSDg nixpkgs-stable github:flox/nixpkgs/stable )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:1249 invoke( /nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/libexec/flox/nix registry add --registry /Users/etorreborre/.config/flox/tmp.wZ7f9fmSDg nixpkgs-staging github:flox/nixpkgs/staging )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh:1250 invoke( /nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/libexec/flox/nix registry add --registry /Users/etorreborre/.config/flox/tmp.wZ7f9fmSDg nixpkgs-unstable github:flox/nixpkgs/unstable )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/libexec/flox/flox:132 submitMetric( publish )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/libexec/flox/flox:266 floxPublish(  )
trace:/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/commands/publish.sh:188 selectAttrPath( . publish )
/nix/store/bna0pb445rmw4q5cdgpclydia230qbhk-flox-0.0.10-r219/lib/utils.sh: line 1372: shift: shift count out of range

I am using the latest stable flox version

flox --version
Version: 0.1.4-r446-0.0.10-r224

What can I do? Thanks.

Hi Eric,

A few things:

  1. I’m not seeing the full version in your output above - can you append that again? Update: Robin pointed out that the output is a super-wide text box and I needed to scroll all the way to the right!
  2. We just released a new version of flox in both the flox/default and flox/prerelease environments - can you pull the latest generation of one of the above and confirm the problem is still present in this latest release (0.1.4-r446-0.0.10-r224)? Update: please ignore per the above.
  3. Can you try invoking flox --bash-passthru publish as a workaround?

Thanks!

Hi Michael,

(Yes I didn’t see that the version was not showing up in my message above).

I tried flox --bash-passthru publish but I am still getting the exact same error.

/nix/store/zgzwf8yyc16cqjmgzl0a5b3rf3zc13w0-flox-0.0.10-r224/lib/utils.sh: line 1372: shift: shift count out of range

Hey wanted to follow up and let you know that this bug has been fixed in our development branch and will be available soon in our next release.

Thanks for the report!

1 Like

Woot, thank you Alex!

2 Likes