Skip to content

Conversation

@JoshuaBatty
Copy link
Member

@JoshuaBatty JoshuaBatty commented Dec 8, 2025

Summary

This PR enables fuelup to source forc-crypto from the FuelLabs/forc monorepo starting with version 0.71.0, following the ongoing migration of Fuel tooling as outlined in the RFC.

Changes

  • Add legacy_tarball_prefix field to Component struct for components that changed their packaging format
  • Add tarball_prefix_for_version() method for version-aware tarball prefix resolution
  • Update tag_for_version() to handle forc-crypto tags in forc monorepo
  • Update download logic to use version-aware tarball prefix
  • Update components.toml with forc-crypto migration config
  • Update forc-wallet targets to use simplified naming convention (matching new forc repo releases)
  • Refactor TargetTriple::from_component to derive target format from the component's targets field in components.toml, rather than using is_distributed_by_forc(). This is more flexible as components migrate to the forc monorepo with simplified target names.

Target Triple Format

The target naming format is now determined by the component's targets field in components.toml:

Format Example Components
Simplified darwin_arm64, linux_amd64 forc, forc-wallet, forc-crypto
Rust triple aarch64-apple-darwin, x86_64-unknown-linux-gnu fuel-core, fuel-core-keygen

Version Routing

Version Repository Tarball Tag Format
< 0.71.0 sway forc-binaries-{target}.tar.gz v{version}
≥ 0.71.0 forc forc-crypto-{version}-{target}.tar.gz forc-crypto-{version}

Related PRs

This is part of the broader effort to migrate Fuel tooling from the sway monorepo to the forc monorepo:

Test Plan

  • cargo test -p component - all migration tests pass
  • cargo test --lib - all 65 tests pass
  • cargo clippy - no warnings
  • Manual test: fuelup component add forc-crypto@0.71.0 (pending nightly release)
  • Manual test: fuelup component add forc-crypto@0.70.1 (legacy version)

Starting with version 0.71.0, forc-crypto is now sourced from the
FuelLabs/forc monorepo instead of FuelLabs/sway.

Changes:
- Add legacy_tarball_prefix field to Component struct for components
  that changed their packaging format (forc-crypto was bundled in
  forc-binaries, now has its own tarball)
- Add tarball_prefix_for_version() method for version-aware tarball
  prefix resolution
- Update tag_for_version() to handle forc-crypto tags in forc monorepo
- Update download.rs to use version-aware tarball prefix
- Update components.toml with forc-crypto migration config
- Update forc-wallet targets to use simplified naming convention

For forc-crypto:
- Versions < 0.71.0: fetched from sway repo, bundled in forc-binaries
- Versions >= 0.71.0: fetched from forc repo as standalone forc-crypto tarball
@JoshuaBatty JoshuaBatty changed the title feat: migrate forc-crypto from sway to forc monorepo feat: migrate forc-crypto from sway to forc monorepo Dec 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

LCOV of commit afc4816 during CI #2289

Summary coverage rate:
  lines......: 87.3% (2674 of 3064 lines)
  functions..: 62.0% (409 of 660 functions)
  branches...: 65.2% (283 of 434 branches)

Files changed coverage rate: n/a

@JoshuaBatty JoshuaBatty self-assigned this Dec 8, 2025
JoshuaBatty added a commit that referenced this pull request Dec 9, 2025
Update all channel TOML files to use the new simplified target naming
convention for forc-wallet:

- aarch64-unknown-linux-gnu → linux_arm64
- x86_64-unknown-linux-gnu → linux_amd64
- aarch64-apple-darwin → darwin_arm64
- x86_64-apple-darwin → darwin_amd64

This aligns with the forc-wallet release asset renaming and the
simplified naming convention adopted by the forc monorepo.

Note: fuel-core and fuel-core-keygen entries are intentionally
unchanged as their release assets have not been renamed.

Closes #809
Related: #808
RFC: FuelLabs/sway-rfcs#49
Instead of using is_distributed_by_forc() to determine the target
naming format, now we look at the component's targets field in
components.toml directly. This is more flexible and future-proof
as more components migrate to the forc monorepo with simplified
target names (e.g., forc-wallet, forc-crypto).

- Simplified format: [darwin|linux]_[arm64|amd64]
- Rust triple format: [arch]-[vendor]-[os]
JoshuaBatty added a commit that referenced this pull request Dec 10, 2025
Update all channel TOML files to use the new simplified target naming
convention for forc-wallet:

- aarch64-unknown-linux-gnu → linux_arm64
- x86_64-unknown-linux-gnu → linux_amd64
- aarch64-apple-darwin → darwin_arm64
- x86_64-apple-darwin → darwin_amd64

This aligns with the forc-wallet release asset renaming and the
simplified naming convention adopted by the forc monorepo.

Note: fuel-core and fuel-core-keygen entries are intentionally
unchanged as their release assets have not been renamed.

Closes #809
Related: #808
RFC: FuelLabs/sway-rfcs#49
JoshuaBatty added a commit that referenced this pull request Dec 11, 2025
Update all channel TOML files to use the new simplified target naming
convention for forc-wallet:

- aarch64-unknown-linux-gnu → linux_arm64
- x86_64-unknown-linux-gnu → linux_amd64
- aarch64-apple-darwin → darwin_arm64
- x86_64-apple-darwin → darwin_amd64

This aligns with the forc-wallet release asset renaming and the
simplified naming convention adopted by the forc monorepo.

Note: fuel-core and fuel-core-keygen entries are intentionally
unchanged as their release assets have not been renamed.

Closes #809
Related: #808
RFC: FuelLabs/sway-rfcs#49
JoshuaBatty added a commit that referenced this pull request Dec 11, 2025
…#811)

Update all channel TOML files to use the new simplified target naming
convention for forc-wallet:

- aarch64-unknown-linux-gnu → linux_arm64
- x86_64-unknown-linux-gnu → linux_amd64
- aarch64-apple-darwin → darwin_arm64
- x86_64-apple-darwin → darwin_amd64

This aligns with the forc-wallet release asset renaming and the
simplified naming convention adopted by the forc monorepo.

Note: fuel-core and fuel-core-keygen entries are intentionally
unchanged as their release assets have not been renamed.

Closes #809
Related: #808
RFC: FuelLabs/sway-rfcs#49
@kayagokalp kayagokalp marked this pull request as ready for review December 11, 2025 11:58
@cursor
Copy link

cursor bot commented Dec 11, 2025

PR Summary

Routes forc-crypto to the forc monorepo ≥0.71.0 with correct tags/tarballs, updates target triple resolution from component config, and adjusts override/install and configs accordingly.

  • Component model:
    • Add legacy_tarball_prefix and tarball_prefix_for_version(); extend tag_for_version() to handle forc-crypto tags in forc.
  • Channel/Download:
    • Use tarball_prefix_for_version() in ci/build-channel and download.rs for URL/tarball generation.
  • Config (components.toml):
    • Migrate forc-crypto to repository_name = "forc" with legacy_repository_name = "sway", legacy_before = "0.71.0", tarball_prefix = "forc-crypto", and legacy_tarball_prefix = "forc-binaries"; mark publishable.
    • Rename forc-wallet targets to simplified linux_amd64|linux_arm64|darwin_amd64|darwin_arm64.
  • CLI (override handling):
    • proxy_cli: for versioned overrides, install/link via Toolchain::add_component(...) instead of direct store path usage.
  • Target triples:
    • TargetTriple::from_component now derives format from a component’s targets (simplified vs Rust triple); update tests accordingly.
  • Tests:
    • Add migration tests for forc-crypto; make yesterday() dynamic; adjust override version defaults.

Written by Cursor Bugbot for commit afc4816. This will update automatically on new commits. Configure here.

@kayagokalp kayagokalp requested a review from a team December 11, 2025 11:58
@kayagokalp kayagokalp enabled auto-merge (squash) December 11, 2025 12:01
@kayagokalp kayagokalp merged commit e1419cc into master Dec 11, 2025
24 checks passed
@kayagokalp kayagokalp deleted the josh/forc-crypto branch December 11, 2025 12:04
.targets
.first()
.map(|t| t.contains('_'))
.unwrap_or(false);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Target format not version-aware for migrated components

The TargetTriple::from_component function determines target format from the current components.toml configuration, but isn't version-aware. For forc-wallet, the targets changed from Rust triples (aarch64-apple-darwin) to simplified format (darwin_arm64). When downloading legacy versions (< 0.16.0), the code will use simplified targets, but those releases were published with Rust triple target names. This causes URL mismatches and download failures. Unlike repository_for_version and tarball_prefix_for_version, target format lacks version-specific handling.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Nightly build ignores legacy tarball prefix for migrated components

The write_nightly_document function uses component.tarball_prefix directly to match asset names from sway-nightly-binaries. After the forc-crypto migration, its tarball_prefix is now "forc-crypto", but nightly builds in sway-nightly-binaries still use the "forc-binaries" prefix. The code needs to also check legacy_tarball_prefix when matching nightly assets, otherwise forc-crypto won't be found in nightly channel builds.

ci/build-channel/src/main.rs#L194-L195

// we want to store the download information in a channel.
if let Some(stripped) = asset.name.strip_prefix(&component.tarball_prefix) {

Fix in Cursor Fix in Web


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants