FuelLabs / FuelLabs/fuelup

Possible inconsistencies with override versions

Open
#654 2 comments 0 reactions 1 assignee Claimed by @alfiedotwtf View on GitHub
bug
Dominant language
Rust
Stars
282
Forks
150
Avg merge
2d 17h
Merged PRs (30d)
2

Description

### Problem

Unless I'm mistaken, overrides works like the following:

> when an override file exists, then `forc`, **_all_** `components`, and **_all_** `plugins` should use the overridden version rather than fall back to `default` unless an individual component or plugin is explicitly set within the override.

This doesn't seem to be the case:

```
> cat fuel-toolchain.toml
[toolchain]
channel = "beta-3"

> forc --version
forc-tx 0.37.3

> forc-tx --version
component 'forc-tx' not found in currently active toolchain 'beta-3-aarch64-apple-darwin'
```

The issue #652 is related since we do want an error message here, but I think this is a bug seeing as `forc --version` above didn't acknowledge the overridden version.

Edit: related PRs:

- https://github.com/FuelLabs/fuelup/pull/665
- https://github.com/FuelLabs/fuelup/pull/666
- https://github.com/FuelLabs/fuelup/pull/667
- https://github.com/FuelLabs/fuelup/pull/668
- https://github.com/FuelLabs/fuelup/pull/669

### Steps

Let's start from scratch:

```
rm -f fuel-toolchain.toml

> fuelup show
Default host: aarch64-apple-darwin
fuelup home: /Users/alfie/.fuelup

Installed toolchains
--------------------
beta-3-aarch64-apple-darwin
latest-aarch64-apple-darwin (default)

active toolchain
----------------
latest-aarch64-apple-darwin (default)
forc : 0.62.0
- forc-client
- forc-deploy : 0.62.0
- forc-run : 0.62.0
- forc-crypto : 0.62.0
- forc-debug : 0.62.0
- forc-doc : 0.62.0
- forc-fmt : 0.62.0
- forc-lsp : 0.62.0
- forc-tx : 0.62.0
- forc-wallet : 0.8.2
fuel-core : 0.31.0
fuel-core-keygen : 0.31.0

fuels versions
--------------
forc : 0.65.1
forc-wallet : 0.65.0

> fuelup component list
latest-aarch64-apple-darwin

Installed:
forc 0.62.0 (latest: 0.63.1)
- forc-fmt
- forc-lsp
- forc-doc
- forc-deploy
- forc-run
forc-wallet 0.8.2 (latest: 0.9.0)
fuel-core 0.31.0 (latest: 0.34.0)
fuel-core-keygen 0.31.0 (latest: 0.34.0)

Installable:
```

Now we create the override:

```
> cat << EOF > fuel-toolchain.toml
[toolchain]
channel = "beta-3"
EOF

> cat fuel-toolchain.toml
[toolchain]
channel = "beta-3"

> fuelup show
Default host: aarch64-apple-darwin
fuelup home: /Users/alfie/.fuelup

Installed toolchains
--------------------
beta-3-aarch64-apple-darwin (override)
latest-aarch64-apple-darwin (default)

active toolchain
----------------
beta-3-aarch64-apple-darwin (override), path: /Users/alfie/BACKUP/work/fuellabs/worktrees/fuelup/652-warning-override/fuel-toolchain.toml
forc : 0.37.3
- forc-client
- forc-deploy : not found
- forc-run : not found
- forc-crypto : not found
- forc-debug : not found
- forc-doc : not found
- forc-fmt : not found
- forc-lsp : not found
- forc-tx : not found
- forc-wallet : 0.2.2
fuel-core : 0.17.11
fuel-core-keygen : not found

fuels versions
--------------
forc : 0.39
```

But when we now list the components, I'm expecting `fuel-core` to be at `0.17.11` as above but instead see:

```
> fuelup component list
latest-aarch64-apple-darwin

Installed:
forc 0.62.0 (latest: 0.63.1)
- forc-fmt
- forc-lsp
- forc-doc
- forc-deploy
- forc-run
forc-wallet 0.8.2 (latest: 0.9.0)
fuel-core 0.31.0 (latest: 0.34.0)
fuel-core-keygen 0.31.0 (latest: 0.34.0)

Installable:
```
... notice how the first line above show we are still on `latest-aarch64-apple-darwin` rather than `beta-3`.

### Possible Solution(s)

It's only after installing the `beta-3` toolchain do we get the proper output:

```
> fuelup toolchain install beta-3-aarch64-apple-darwin
Downloading: forc forc-wallet fuel-core
...

> fuelup show
Default host: aarch64-apple-darwin
fuelup home: /Users/alfie/.fuelup

Installed toolchains
--------------------
beta-3-aarch64-apple-darwin (override)
latest-aarch64-apple-darwin (default)

active toolchain
----------------
beta-3-aarch64-apple-darwin (override), path: /Users/alfie/BACKUP/work/fuellabs-20240822/worktrees/repos/counter-contract/fuel-toolchain.toml
forc : 0.37.3
- forc-client
- forc-deploy : 0.37.3
- forc-run : 0.37.3
- forc-crypto : not found
- forc-debug : not found
- forc-doc : 0.37.3
- forc-fmt : 0.37.3
- forc-lsp : 0.37.3
- forc-tx : 0.37.3
- forc-wallet : 0.2.2
fuel-core : 0.17.11
fuel-core-keygen : Could not parse version (empty string, expected a semver version)

fuels versions
--------------
forc : 0.39

> forc-tx --version
forc-tx 0.37.3
```

The problem is either:

- my understanding of how overriding works is incorrect
- the overriding documentation is incorrect
- there are bugs in the current overriding logic

Issue #652 deals with a side effect of this bug, but I'm thinking it's a larger issue.

### Notes

_No response_

### Fuelup version

```console
> fuelup --version
fuelup 0.26.0
```

### Installed components

```console
> fuelup check
latest - Update available (9 updates)
beta-3 - Up to date
fuelup - Up to date
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.