Skip to content

Conversation

@JoshuaBatty
Copy link
Member

@JoshuaBatty JoshuaBatty commented Dec 5, 2025

Summary

Migrates forc-tracing and forc-crypto from the sway repository into the forc monorepo, continuing the toolchain consolidation effort from sway-rfcs#49.

Changes

New Workspace Members

  • forc-tracing - Tracing utility crate (library-only, no binary)
  • forc-crypto - Cryptographic utilities CLI tool
    • Uses path dependency for forc-tracing (within monorepo)
    • Uses crates.io forc-util for cli_examples! macro

CI Updates

  • Added binary detection to skip build/strip/upload steps for library-only crates
  • Library crates still publish to crates.io but don't produce release binaries

Test Fixes

  • Added serial_test to prevent race conditions in forc-tracing tests
  • Tests share global JSON_MODE_ACTIVE state requiring serial execution

Post-merge Tasks

  • Cut releases: forc-tracing-0.71.0, forc-crypto-0.71.0
  • Update fuelup to fetch forc-crypto from this repo
  • Update fuel.nix with version routing for forc-crypto
  • Update sway-nightly-binaries to build forc-crypto from here
  • Remove forc-tracing and forc-crypto from sway repo

Related

@cursor
Copy link

cursor bot commented Dec 5, 2025

PR Summary

Adds forc-crypto (CLI) and forc-tracing (library) to the workspace, updates docs/deps, and makes the release CI skip building binaries for library-only crates.

  • Workspace:
    • Add new members: forc-crypto (CLI) and forc-tracing (lib).
    • Centralize shared deps/lints in Cargo.toml; update forc-wallet deps to workspace versions.
  • forc-crypto (new CLI):
    • Commands: sha256, keccak256, address, new-key, parse-secret, get-public-key, and vanity (regex/hex matching, timeout, optional mnemonic, file/stdin input, save-to-path).
    • Benchmarks for vanity address generation.
  • forc-tracing (new lib):
    • Console/JSON logging utilities with colored/action labels; configurable subscriber (env filter, writer modes, regex filter).
    • Tests use serial_test to guard global JSON mode.
  • CI/Release:
    • build-release now detects if a crate has a binary and conditionally installs toolchain, builds, strips, and uploads assets accordingly.
    • RELEASING.md updated to document tag-based releases, binary detection, and current workspace members.
  • Lockfile: Update to include new crates and dependencies.

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

@JoshuaBatty JoshuaBatty self-assigned this Dec 5, 2025
@JoshuaBatty JoshuaBatty marked this pull request as draft December 5, 2025 09:35
@JoshuaBatty JoshuaBatty force-pushed the josh/crypto-tracing-migration branch from 3cda65d to fbdab0b Compare December 8, 2025 02:56
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

LCOV of commit 828642f during CI #27

Summary coverage rate:
  lines......: 45.4% (818 of 1800 lines)
  functions..: 46.4% (121 of 261 functions)
  branches...: 49.1% (54 of 110 branches)

Files changed coverage rate: n/a

@JoshuaBatty JoshuaBatty changed the title wip: Migrate forc-tracing & forc-crypto over from the sway repo. Migrate forc-tracing & forc-crypto over from the sway repo. Dec 8, 2025
@JoshuaBatty JoshuaBatty marked this pull request as ready for review December 8, 2025 03:54
Comment on lines +19 to +20
forc-tracing = "0.70.2"
fuels = "0.75"
Copy link
Contributor

Choose a reason for hiding this comment

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

qq: is there a reason not to use workspace for all deps?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this was based off our discussion that we had last week. Ideally, we'll move towards having workspace deps for fuel crates, but for the initial migration, we'll keep them separate.

@JoshuaBatty JoshuaBatty merged commit 7f36702 into main Dec 8, 2025
15 checks passed
@JoshuaBatty JoshuaBatty deleted the josh/crypto-tracing-migration branch December 8, 2025 04:46
JoshuaBatty added a commit to FuelLabs/fuel.nix that referenced this pull request Dec 8, 2025
## Summary

- forc-crypto migrated from `FuelLabs/sway` to `FuelLabs/forc` monorepo
at v0.71.0
- Add version-based repository routing using the same
`legacy_repo`/`legacy_before` pattern established for forc-wallet in
#204
- Add `buildAndTestSubdir` patch for forc-crypto when built from forc
monorepo

## Changes

**refresh-manifests.sh:**
- Versions < 0.71.0: fetch from sway repo with `v{version}` tags
- Versions >= 0.71.0: fetch from forc monorepo with
`forc-crypto-{version}` tags

**patches.nix:**
- Add patch setting `buildAndTestSubdir = "forc-crypto"` when built from
forc monorepo

**packages.md:**
- Update forc-crypto documentation to reference forc repo

## Context

- forc-crypto migration PR: FuelLabs/forc#119
- forc-crypto v0.71.0 release:
https://github.com/FuelLabs/forc/releases/tag/forc-crypto-0.71.0
- sway-nightly-binaries update:
FuelLabs/sway-nightly-binaries#79

---------

Co-authored-by: GitHub Action <action@github.com>
JoshuaBatty added a commit to FuelLabs/sway that referenced this pull request Dec 9, 2025
## Summary

This PR completes the sway-side of migrating `forc-tracing` and
`forc-crypto` to the new [forc
monorepo](https://github.com/FuelLabs/forc), as outlined in [RFC
#49](FuelLabs/sway-rfcs#49).

The corresponding forc repo PR:
FuelLabs/forc#119

### Changes

- Remove `forc-tracing` crate from workspace (now uses crates.io
`0.71.1`)
- Remove `forc-crypto` crate from workspace
- Update CI to no longer build/package `forc-crypto` binary (it's now
built from forc repo)
- Update gh-pages workflow to install `forc-crypto` from forc repo for
documentation generation

### Distribution

Going forward, `forc-crypto` will be built and distributed from the forc
repo by:
- sway-nightly-binaries
- fuelup  
- fuel.nix

### Documentation

For now, documentation for all tooling will continue to live in this
repo. The `gh-pages` workflow now pulls `forc-crypto` from the forc repo
rather than building it locally, so docs generation continues to work as
before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants