feat: migrate forc-crypto from sway to forc monorepo#808
Conversation
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
forc-crypto from sway to forc monorepo
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
778ba42 to
1830a34
Compare
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]
1830a34 to
1535007
Compare
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
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
…#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
PR SummaryRoutes
Written by Cursor Bugbot for commit afc4816. This will update automatically on new commits. Configure here. |
| .targets | ||
| .first() | ||
| .map(|t| t.contains('_')) | ||
| .unwrap_or(false); |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
fuelup/ci/build-channel/src/main.rs
Lines 194 to 195 in afc4816
Summary
This PR enables fuelup to source
forc-cryptofrom theFuelLabs/forcmonorepo starting with version 0.71.0, following the ongoing migration of Fuel tooling as outlined in the RFC.Changes
legacy_tarball_prefixfield toComponentstruct for components that changed their packaging formattarball_prefix_for_version()method for version-aware tarball prefix resolutiontag_for_version()to handleforc-cryptotags in forc monorepocomponents.tomlwith forc-crypto migration configTargetTriple::from_componentto derive target format from the component'stargetsfield incomponents.toml, rather than usingis_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
targetsfield incomponents.toml:darwin_arm64,linux_amd64aarch64-apple-darwin,x86_64-unknown-linux-gnuVersion Routing
forc-binaries-{target}.tar.gzv{version}forc-crypto-{version}-{target}.tar.gzforc-crypto-{version}Related PRs
This is part of the broader effort to migrate Fuel tooling from the sway monorepo to the forc monorepo:
forc-tracing&forc-cryptoover from theswayrepo. forc#119forc-walletmigration from standalone repo toforcmonorepo #807 (forc-wallet migration)Test Plan
cargo test -p component- all migration tests passcargo test --lib- all 65 tests passcargo clippy- no warningsfuelup component add forc-crypto@0.71.0(pending nightly release)fuelup component add forc-crypto@0.70.1(legacy version)