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.