Not able to compile my old codebase. forc migrate didn't help

Topic discussion checklist

  • fuelup show
active toolchain
----------------
latest-x86_64-unknown-linux-gnu (default)
  forc : 0.67.0
    - forc-client
      - forc-deploy : 0.67.0
      - forc-run : 0.67.0
      - forc-submit : 0.67.0
    - forc-crypto : 0.67.0
    - forc-debug : 0.67.0
    - forc-doc : 0.67.0
    - forc-fmt : 0.67.0
    - forc-lsp : 0.67.0
    - forc-migrate : 0.67.0
    - forc-tx : 0.67.0
    - forc-wallet : 0.12.0
  fuel-core : 0.41.9
  fuel-core-keygen : 0.41.9

fuels versions
--------------
forc : 0.70
forc-wallet : 0.70

My old code which was compiling fine now started to throw errors:

forc build
    Building /home/tit4n/lync/fuel/fuelup/fuelup-fun-smart-contracts
    Creating a new `Forc.lock` file. (Cause: lock file did not match manifest)
    Removing core
    Removing standards git+https://github.com/FuelLabs/sway-standards?default-branch#a50375e03c746d3a8f75ea069a5cad1b55831209
    Removing std git+https://github.com/fuellabs/sway?tag=v0.66.5#94a066652468b4afa3bd396dacef482ed590976b
    Removing sway_libs git+https://github.com/FuelLabs/sway-libs?default-branch#205e0e617cea37649c31b93563393ded79c76493
      Adding standards git+https://github.com/FuelLabs/sway-standards?default-branch#90951da15fa97fc40e3b6ad6967f369e81df6095
      Adding std git+https://github.com/fuellabs/sway?tag=v0.67.0#d821dcb0c7edb1d6e2a772f5a1ccefe38902eaec
      Adding sway_libs git+https://github.com/FuelLabs/sway-libs?default-branch#c151254d423a8b8262c8b0d1187ef6f24dbdefc3
   Compiling library std (git+https://github.com/fuellabs/sway?tag=v0.67.0#d821dcb0c7edb1d6e2a772f5a1ccefe38902eaec)
   Compiling library standards (git+https://github.com/FuelLabs/sway-standards?tag=v0.6.0#65e09f95ea8b9476b171a66c8a47108f352fa32c)
error
  --> /home/tit4n/.forc/git/checkouts/standards-a75010d5ab7a85a4/65e09f95ea8b9476b171a66c8a47108f352fa32c/standards/src/src5.sw:13:6
   |
11 | }
12 |
13 | impl core::ops::Eq for State {
   |      ^^^^ Could not find symbol "core" in this scope.
14 |     fn eq(self, other: Self) -> bool {
15 |         match (self, other) {
   |
____

error
  --> /home/tit4n/.forc/git/checkouts/standards-a75010d5ab7a85a4/65e09f95ea8b9476b171a66c8a47108f352fa32c/standards/src/src5.sw:13:6
   |
11 | }
12 |
13 | impl core::ops::Eq for State {
   |      ^^^^^^^^^^^^^ Trait "Eq" cannot be found in the current scope.
14 |     fn eq(self, other: Self) -> bool {
15 |         match (self, other) {
   |
____

error
  --> /home/tit4n/.forc/git/checkouts/standards-a75010d5ab7a85a4/65e09f95ea8b9476b171a66c8a47108f352fa32c/standards/src/src7.sw:58:6
   |
56 | }
57 |
58 | impl core::ops::Eq for Metadata {
   |      ^^^^ Could not find symbol "core" in this scope.
59 |     fn eq(self, other: Self) -> bool {
60 |         match (self, other) {
   |
____

error
  --> /home/tit4n/.forc/git/checkouts/standards-a75010d5ab7a85a4/65e09f95ea8b9476b171a66c8a47108f352fa32c/standards/src/src7.sw:58:6
   |
56 | }
57 |
58 | impl core::ops::Eq for Metadata {
   |      ^^^^^^^^^^^^^ Trait "Eq" cannot be found in the current scope.
59 |     fn eq(self, other: Self) -> bool {
60 |         match (self, other) {
   |
____

  Aborting due to 4 errors.
error: Failed to compile standards

I tried the forc migrate check it did not help:

There are currently no migration steps defined for the upcoming breaking change version of Sway.

There seems to be some issue with the standards library. How can I resolve this?

1 Like

Hey @lokesh-lync, sway_libs are not yet compatible with the latest version of sway. We will be releasing the new version of sway_libs soon that will be compatible with the latest sway version

1 Like

so i need to compile it using the older version?

1 Like

yes, we will be releasing the newer version of the sway_libs soon. until then use the older version to compile

there is one more issue. This is my fuel-toolchain.toml:

[toolchain]
channel = "nightly-2024-10-04-x86_64-unknown-linux-gnu"

[components]
forc = "0.64.0+nightly.20241004.d39958053d"
fuel-core = "0.35.0+nightly.20241004.b5d5ff8d13"

Even though I have specified nightly 0.64 here when I do fuelup show I get:

active toolchain
----------------
nightly-x86_64-unknown-linux-gnu (override), path: /home/tit4n/lync/fuel/fuelup/fuelup-fun-smart-contracts/fuel-toolchain.toml
  forc : 0.67.0+nightly.20250318.f46a2dc453
    - forc-client
      - forc-deploy : 0.67.0+nightly.20250318.f46a2dc453
      - forc-run : 0.67.0+nightly.20250318.f46a2dc453
      - forc-submit : 0.67.0+nightly.20250318.f46a2dc453
    - forc-crypto : 0.67.0+nightly.20250318.f46a2dc453
    - forc-debug : 0.67.0+nightly.20250318.f46a2dc453
    - forc-doc : 0.67.0+nightly.20250318.f46a2dc453
    - forc-fmt : 0.67.0+nightly.20250318.f46a2dc453
    - forc-lsp : 0.67.0+nightly.20250318.f46a2dc453
    - forc-migrate : 0.67.0+nightly.20250318.f46a2dc453
    - forc-tx : 0.67.0+nightly.20250318.f46a2dc453
    - forc-wallet : 0.12.0+nightly.20250318.8d59dbc462
  fuel-core : 0.41.7+nightly.20250303.3cf86ab5b8
  fuel-core-keygen : not found

It still uses 0.67 for some reason.

Can you help me with some doc where I can find a list of these specific versions.

I am trying different versions to make it compile. Earlier it was:

[toolchain]
channel = "latest-x86_64-unknown-linux-gnu"

[components]
forc = "0.66.5"
fuel-core = "0.40.0"

but this does not compile and when I do fuelup show I get:

latest-x86_64-unknown-linux-gnu (override), path: /home/tit4n/lync/fuel/fuelup/fuelup-fun-smart-contracts/fuel-toolchain.toml
  forc : 0.67.0
    - forc-client
      - forc-deploy : 0.67.0
      - forc-run : 0.67.0
      - forc-submit : 0.67.0
    - forc-crypto : 0.67.0
    - forc-debug : 0.67.0
    - forc-doc : 0.67.0
    - forc-fmt : 0.67.0
    - forc-lsp : 0.67.0
    - forc-migrate : 0.67.0
    - forc-tx : 0.67.0
    - forc-wallet : 0.12.0
  fuel-core : 0.41.9
  fuel-core-keygen : 0.41.9

fuels versions
--------------
forc : 0.70
forc-wallet : 0.70

Which won’t work because of sway libs. What Can I do to fix this?

for now, i would recommend using the older version of forc. both our testnet and mainnet arent using forc v0.67.0 yet. hence, it will be an issue until we upgrade the networks with newer versions.
and regarding the toolchain, you can try setting up custom toolchain with custom components if that helps

1 Like