Skip to content

Optional fvm for curio - #550

Merged
rvagg merged 11 commits into
filecoin-project:masterfrom
curiostorage:fvm-optional
Dec 1, 2025
Merged

Optional fvm for curio#550
rvagg merged 11 commits into
filecoin-project:masterfrom
curiostorage:fvm-optional

Conversation

@snadrus

@snadrus snadrus commented Oct 30, 2025

Copy link
Copy Markdown
Contributor

This simple change reduces Curio build time & saves 24mb off Curio's final filesize.
fvm becomes optional=true instead of required.

Copilot AI review requested due to automatic review settings October 30, 2025 20:30
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FilOz Oct 30, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR makes FVM (Filecoin Virtual Machine) dependencies optional by introducing a feature flag system. The changes allow building the project without FVM support, reducing dependencies for users who don't require FVM functionality.

  • Moved FVM module in Rust behind a fvm feature flag
  • Made all FVM-related Rust dependencies optional
  • Added fvm build tag to Go files to conditionally compile FVM code
  • Provided C header fallback definitions for FVM error constants when FVM is disabled

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
rust/src/lib.rs Wrapped FVM module declaration with cfg(feature = "fvm") conditional compilation
rust/Cargo.toml Made FVM dependencies optional and created an fvm feature that includes them; added fvm to default features
fvm.go Added fvm build tag to conditionally compile FVM functionality
cgo/types.go Removed FVM type definitions and helpers, replaced with comments referencing types_fvm.go
cgo/fvm.go Added fvm build tag to conditionally compile FVM CGO bindings
cgo/errors.go Added fallback C macro definitions for FVM error constants when FVM is not compiled
Comments suppressed due to low confidence (3)

rust/Cargo.toml:76

  • The cuda feature unconditionally references fvm2/cuda, fvm3/cuda, and fvm4/cuda, but these dependencies are now optional (only available when the fvm feature is enabled). This will cause build failures when using --no-default-features --features cuda. The FVM sub-features should be made conditional on the fvm feature, for example: dep:fvm2?/cuda or the feature should depend on fvm.
cuda = [
  "filecoin-proofs-api/cuda",
  "rust-gpu-tools/cuda",
  "fvm2/cuda",
  "fvm3/cuda",
  "fvm4/cuda",
]

rust/Cargo.toml:82

  • The cuda-supraseal feature unconditionally references fvm3/cuda-supraseal and fvm4/cuda-supraseal, but these dependencies are now optional. This will cause build failures when using --no-default-features --features cuda-supraseal. The FVM sub-features should be made conditional on the fvm feature.
cuda-supraseal = [
  "filecoin-proofs-api/cuda-supraseal",
  "rust-gpu-tools/cuda",
  "fvm3/cuda-supraseal",
  "fvm4/cuda-supraseal",
]

rust/Cargo.toml:89

  • The opencl feature unconditionally references fvm2/opencl, fvm3/opencl, and fvm4/opencl, but these dependencies are now optional. This will cause build failures when using --no-default-features --features opencl. The FVM sub-features should be made conditional on the fvm feature.
opencl = [
  "filecoin-proofs-api/opencl",
  "rust-gpu-tools/opencl",
  "fvm2/opencl",
  "fvm3/opencl",
  "fvm4/opencl",
]

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cgo/types.go
Comment thread install-filcrypto Outdated
Comment thread install-filcrypto Outdated
Comment thread install-filcrypto Outdated
@BigLep BigLep moved this from 📌 Triage to ⌨️ In Progress in FilOz Nov 4, 2025
@snadrus
snadrus marked this pull request as draft November 10, 2025 21:13
@snadrus
snadrus marked this pull request as ready for review November 11, 2025 20:40
@snadrus
snadrus requested a review from rvagg November 11, 2025 20:40
Comment thread install-filcrypto Outdated

@rvagg rvagg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Aside from the disable logic flip this lgtm, 🤞 and we'll find out pretty quick when we try to use it!

@github-project-automation github-project-automation Bot moved this from ⌨️ In Progress to ✔️ Approved by reviewer in FilOz Nov 25, 2025
@snadrus

snadrus commented Nov 25, 2025

Copy link
Copy Markdown
Contributor Author

Please merge @rvagg as I don't have permission

Co-authored-by: Rod Vagg <rod@vagg.org>
@rvagg
rvagg merged commit a7d5488 into filecoin-project:master Dec 1, 2025
5 checks passed
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FilOz Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

4 participants