gk-cli icon indicating copy to clipboard operation
gk-cli copied to clipboard

[BUG] help should not actually perform anything

Open pinage404 opened this issue 4 months ago • 10 comments

Description

I'm trying to upgrade gk-cli's package on nixpkgs

When i run one of the following commands :

gk --help
gk version

I got the following error :

Installing GitKraken core
cannot remove old binary: remove /etc/profiles/per-user/pinage404/bin/gk: read-only file system.
please, check if some MCP server is running, and shut it down

I am expecting that this commands do not write stuff on the filesystem

GitKraken CLI Version

3.1.9

OS Version

  • system: "x86_64-linux"
  • host os: Linux 6.12.40, NixOS, 25.05 (Warbler), 25.05.20250726.13e8d35
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.28.4
  • nixpkgs: /nix/store/vjk8x60zj28wj5n07276s0cj7594bncn-source

Git Version

git version 2.49.0

Logs, Screenshots, Screen Captures, URLs, etc

No response

pinage404 avatar Aug 02 '25 12:08 pinage404

Hi! We check for updates every 24 hours (only once a day) and, if any are available, we download them before executing any commands. This ensures that you're always running the latest version and that any bugs are fixed before executing any commands.

In your case, it looks like you're currently installing GitKraken Core. This indicates that it wasn't previously installed on your system, which is why we’re writing stuff on the filesystem

JBUinfo avatar Aug 05 '25 18:08 JBUinfo

Hi,

Nix is a package manager that focuses on reproducibility

Nix enforces reproducibility by ensuring that packages are read-only while being packaged

Once packaged, the package can write elsewhere in the system during execution, but it cannot rewrite itself

This prevents a system from working one day and not working the next because an unwanted update has occurred

I don't currently know how to package it

Could you add an option or environment variable to disable the update check ?

pinage404 avatar Aug 05 '25 19:08 pinage404

How about adding a flag called "--not-core" so you can use "gk version --not-core"? This will return the version of the packaged binary, but not the main/core binary that will be installed/updated by ourself

JBUinfo avatar Aug 05 '25 20:08 JBUinfo

the main/core binary that will be installed/updated by ourself

Does it mean that you will replace the existing binary later ?

If yes, i don't know how to package this

pinage404 avatar Aug 05 '25 20:08 pinage404

No, we are not replacing that binary. Let me clarify: we currently have two binaries. The first is the "launcher" (or "proxy"), which is the one you download or package. The second is the "core" binary, which is installed and automatically updated by the launcher

JBUinfo avatar Aug 05 '25 20:08 JBUinfo

In order to avoid trying to write on a read-only filesystem, can we customize the path of the core binary ?

pinage404 avatar Aug 06 '25 18:08 pinage404

No, we can't do that. The only viable solution I can see is to create a flag for the "version" command that prints the CLI version without downloading anything. For the rest of the commands, we need to install the “core” binary

JBUinfo avatar Aug 07 '25 15:08 JBUinfo

Maybe, instead of packaging only the launcher, the launcher + core binary can be packaged together

Can we have an URL that point to a pinned version of the core binary ?

pinage404 avatar Aug 08 '25 16:08 pinage404

The only solution I can offer is this: https://github.com/gitkraken/gk-cli/issues/136#issuecomment-3156463140

Modify our command to get the package version, but running any other command will download and install the other binary in other location

JBUinfo avatar Aug 13 '25 17:08 JBUinfo

Hi @pinage404 ! Have you thought about this? Do you think the solution is valid?

JBUinfo avatar Aug 22 '25 14:08 JBUinfo