Skip to content

Commit

Permalink
fix: exception for test fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
nhtyy committed Nov 20, 2024
1 parent eaa3933 commit dabb963
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
29 changes: 29 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion crates/build/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub fn execute_build_program(
/// Internal helper function to build the program with or without arguments.
///
/// Note: This function is not intended to be used by the CLI, as it looks for the sp1-sdk,
/// which is probably in the same crate lockfile as this function is only called by build scipr
/// which is probably in the same crate lockfile as this function is only called by build script.
pub(crate) fn build_program_internal(path: &str, args: Option<BuildArgs>) {
// Get the root package name and metadata.
let program_dir = std::path::Path::new(path);
Expand Down Expand Up @@ -210,6 +210,11 @@ fn verify_locked_version(program_dir: impl AsRef<Path>) -> Result<()> {
version: String,
}

// we need an exception for our test fixtures
if env!("CARGO_PKG_NAME") != "test-artifacts" {
return Ok(());
}

// This might be a workspace, so we need optionally search parent dirs for lock files
let canon = program_dir.as_ref().canonicalize()?;
let mut lock_path = canon.join("Cargo.lock");
Expand Down
2 changes: 1 addition & 1 deletion crates/test-artifacts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ categories.workspace = true
sp1-build = { workspace = true }

[build-dependencies]
sp1-build = { workspace = true }
sp1-build = { workspace = true }

0 comments on commit dabb963

Please sign in to comment.