Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: docker build fixes #1258

Merged
merged 5 commits into from
Aug 6, 2024
Merged

feat: docker build fixes #1258

merged 5 commits into from
Aug 6, 2024

Conversation

ratankaliani
Copy link
Member

@ratankaliani ratankaliani commented Aug 6, 2024

Issue Overview

Previously, Docker builds were failing for 2 issues.

  1. Because setting CARGO_TARGET_DIR in the local environment did not carry into Docker, the build location of the program did not match the expected build directory in copy_elf_to_output_dir.

    Error: No such file or directory (os error 2)
  2. The program directory was not canonicalized in create_docker_command, resulting in StripPrefixError if the specified program path in build_program_with_args was a relative path and Docker mode was on.

Ex.

 --- stderr
   thread 'main' panicked at /Users/ratankaliani/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sp1-build-1.1.0/src/docker.rs:42:50:
   called `Result::unwrap()` on an `Err` value: StripPrefixError(())

Resolution

  • Set CARGO_TARGET_DIR explicitly with -e in the Docker command.
    • Explicitly write the Docker ELF's to a new subdirectory to ensure that the built ELFs are from Docker compilation.
  • Canonicalize the program directory in the Docker command.

@ratankaliani ratankaliani enabled auto-merge (squash) August 6, 2024 06:53
@ratankaliani ratankaliani merged commit 42fdcbc into dev Aug 6, 2024
@ratankaliani ratankaliani deleted the ratan/docker-build-fixes branch August 6, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants