Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible inconsistencies with override versions #654

Open
alfiedotwtf opened this issue Aug 26, 2024 · 2 comments
Open

Possible inconsistencies with override versions #654

alfiedotwtf opened this issue Aug 26, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@alfiedotwtf
Copy link
Contributor

alfiedotwtf commented Aug 26, 2024

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:

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

> fuelup --version
fuelup 0.26.0

Installed components

> fuelup check
latest - Update available (9 updates)
beta-3 - Up to date
fuelup - Up to date
@alfiedotwtf alfiedotwtf added the bug Something isn't working label Aug 26, 2024
@FuelLabs FuelLabs deleted a comment Aug 26, 2024
@FuelLabs FuelLabs deleted a comment Aug 26, 2024
@alfiedotwtf alfiedotwtf self-assigned this Aug 26, 2024
@FuelLabs FuelLabs deleted a comment Aug 26, 2024
@FuelLabs FuelLabs deleted a comment Aug 26, 2024
@sdankel
Copy link
Member

sdankel commented Aug 26, 2024

Nice find, this does look like a bug in how overrides work.

@alfiedotwtf
Copy link
Contributor Author

There are 2 problems here:

  • fuelup show is not showing the correct component and plugin versions when overridden
  • the components bundled within the Forc tarball that are not part of the component's TOML executable array are pointing to the incorrect URL when we download them

I'll make 2 PRs that will address each issue.

alfiedotwtf added a commit that referenced this issue Sep 28, 2024
alfiedotwtf added a commit that referenced this issue Sep 29, 2024
alfiedotwtf added a commit that referenced this issue Sep 29, 2024
alfiedotwtf added a commit that referenced this issue Oct 4, 2024
alfiedotwtf added a commit that referenced this issue Oct 4, 2024
alfiedotwtf added a commit that referenced this issue Oct 4, 2024
JoshuaBatty pushed a commit that referenced this issue Oct 11, 2024
* Fix clippy (#654)

* Update component target tarball (#654)
alfiedotwtf added a commit that referenced this issue Oct 26, 2024
alfiedotwtf added a commit that referenced this issue Oct 26, 2024
alfiedotwtf added a commit that referenced this issue Oct 26, 2024
alfiedotwtf added a commit that referenced this issue Oct 27, 2024
* Add tests and highlight issues with should_panic (#654)

* Add documentation (#654)
alfiedotwtf added a commit that referenced this issue Oct 27, 2024
When a proxy CLI'd command downloads a missing toolchain, multiple binary files within the downloaded distribution were being symlinked to the same one target file (thus overwriting each previous target).
alfiedotwtf added a commit that referenced this issue Oct 27, 2024
…orc (#654)

When checking if a component is distributed by forc, we currently only look at forc's direct executables. This needs to be extended to resolve components, plugins, and executables.
alfiedotwtf added a commit that referenced this issue Oct 28, 2024
…orc (#654)

When checking if a component is distributed by forc, we currently only
look at forc's direct executables. This needs to be extended to resolve
components, plugins, and executables.
alfiedotwtf added a commit that referenced this issue Oct 28, 2024
When a proxy CLI'd command downloads a missing toolchain, multiple binary files within the downloaded distribution were being symlinked to the same one target file (thus overwriting each previous target).
alfiedotwtf added a commit that referenced this issue Oct 28, 2024
Fix incorrect binary link target (#654)

When a proxy CLI'd command downloads a missing toolchain, multiple binary files within the downloaded distribution were being symlinked to the same one target file (thus overwriting each previous target).
alfiedotwtf added a commit that referenced this issue Oct 28, 2024
…orc (#654)

When checking if a component is distributed by forc, we currently only
look at forc's direct executables. This needs to be extended to resolve
components, plugins, and executables.
alfiedotwtf added a commit that referenced this issue Oct 28, 2024
…orc (#666)

Extend finding components to plugins and executables distributed by forc (#654)

When checking if a component is distributed by forc, we currently only
look at forc's direct executables. This needs to be extended to resolve
components, plugins, and executables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants
@alfiedotwtf @sdankel and others