smartcontractkit / smartcontractkit/cre-cli

cre update fails with "invalid cross-device link" when /tmp and install dir are on different partitions

Open
#249 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
24
Forks
25
Avg merge
10h 10m
Merged PRs (30d)
13

Description

The cre update command fails to complete the update process because it attempts a rename operation across different device boundaries. This is a common issue when /tmp is mounted as a tmpfs or is on a separate partition from the user's home/installation directory.

Error Output:

Updating cre CLI...
Downloading: https://github.com/smartcontractkit/cre-cli/releases/download/v1.0.7/cre_linux_amd64.tar.gz
Error: failed to replace binary: rename /tmp/cre_update_3483520469/cre_v1.0.7_linux_amd64 /root/.cre/bin/cre: invalid cross-device link

Environment:

  • OS: Debian (Linux)
  • Version: upgrading from v1.0.6 to v1.0.7
  • Install Path: /root/.cre/bin/cre

Suggested Fix: In the update logic, if os.Rename fails with an EXDEV error (invalid cross-device link), the tool should fall back to copying the file contents and then deleting the source, or use a temporary directory located on the same partition as the target binary.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the cre update command's binary replacement logic and locate its os.Rename call. Reproduce the failure with /tmp and the installation directory on different partitions, then verify that the update completes without the cross-device-link error while preserving the existing replacement behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.