Skip to content

Conversation

@swaroop-osec
Copy link
Collaborator

This PR adds support for offline builds by implementing a vendored dependencies workflow. When the --offline flag is passed to the build command, the tool will:

  1. Run cargo vendor to create a vendor directory with all dependencies
  2. Create a .cargo/config.toml file with vendored sources configuration
  3. Configure the build to use local dependencies instead of fetching from the internet

Usage:

solana-verify build -- --offline

The implementation:

  • Adds a new setup_offline_build function to handle the offline build setup
  • Modifies the existing build function to check for the --offline flag and trigger the offline build flow.
  • Maintains compatibility with existing build workflows
  • Preserves all existing functionality when offline mode is not used

Testing:

  • Verified that the offline build works correctly with vendored dependencies
  • Tested with Drift Vaults program.
solana-verify verify-from-repo https://github.com/drift-labs/drift-vaults/ --library-name drift_vaults --commit-hash 969abfe150873b315a160fa42b001ec9fcda9152 -b ellipsislabs/solana:1.16.6 --program-id vAuLTsyrvSfZRuRB3XgvkPwNGgYSs9YRYymVebLKoxR -- --offline

@swaroop-osec swaroop-osec requested a review from ngundotra May 22, 2025 07:09
@swaroop-osec swaroop-osec self-assigned this May 22, 2025
@swaroop-osec swaroop-osec added the enhancement New feature or request label May 22, 2025
Copy link
Collaborator

@ngundotra ngundotra left a comment

Choose a reason for hiding this comment

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

LGTM. Only consideration - is there ever a scenario where users might need to delete the vendored config?

@swaroop-osec
Copy link
Collaborator Author

swaroop-osec commented May 22, 2025

LGTM. Only consideration - is there ever a scenario where users might need to delete the vendored config?

I don't think so. If they don't want to have vendored dependencies they can omit --offline flag.

@ngundotra ngundotra merged commit 54f3967 into Ellipsis-Labs:master May 22, 2025
8 checks passed
@swaroop-osec swaroop-osec deleted the feat/cargo-vendor branch June 16, 2025 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants