Skip to content

Conversation

@snadrus
Copy link
Contributor

@snadrus snadrus commented Oct 30, 2025

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
Copy link

Copilot AI left a comment

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.

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ⌨️ In Progress

Development

Successfully merging this pull request may close these issues.

2 participants