Optional fvm for curio - #550
Merged
Merged
Conversation
There was a problem hiding this comment.
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
fvmfeature flag - Made all FVM-related Rust dependencies optional
- Added
fvmbuild 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
cudafeature unconditionally referencesfvm2/cuda,fvm3/cuda, andfvm4/cuda, but these dependencies are now optional (only available when thefvmfeature is enabled). This will cause build failures when using--no-default-features --features cuda. The FVM sub-features should be made conditional on thefvmfeature, for example:dep:fvm2?/cudaor the feature should depend onfvm.
cuda = [
"filecoin-proofs-api/cuda",
"rust-gpu-tools/cuda",
"fvm2/cuda",
"fvm3/cuda",
"fvm4/cuda",
]
rust/Cargo.toml:82
- The
cuda-suprasealfeature unconditionally referencesfvm3/cuda-suprasealandfvm4/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 thefvmfeature.
cuda-supraseal = [
"filecoin-proofs-api/cuda-supraseal",
"rust-gpu-tools/cuda",
"fvm3/cuda-supraseal",
"fvm4/cuda-supraseal",
]
rust/Cargo.toml:89
- The
openclfeature unconditionally referencesfvm2/opencl,fvm3/opencl, andfvm4/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 thefvmfeature.
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.
rvagg
reviewed
Nov 4, 2025
rvagg
reviewed
Nov 4, 2025
rvagg
reviewed
Nov 4, 2025
Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: Rod Vagg <rod@vagg.org>
snadrus
marked this pull request as ready for review
November 11, 2025 20:40
rvagg
reviewed
Nov 25, 2025
rvagg
approved these changes
Nov 25, 2025
rvagg
left a comment
Member
There was a problem hiding this comment.
Aside from the disable logic flip this lgtm, 🤞 and we'll find out pretty quick when we try to use it!
Contributor
Author
|
Please merge @rvagg as I don't have permission |
Co-authored-by: Rod Vagg <rod@vagg.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This simple change reduces Curio build time & saves 24mb off Curio's final filesize.
fvm becomes optional=true instead of required.