Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Use git URL for normal cargo build, and vendored file path for Nix build #155

Merged
merged 5 commits into from
May 2, 2024

Conversation

soareschen
Copy link
Collaborator

@soareschen soareschen commented May 2, 2024

Summary

  • Removes the use of git submodule.
  • Use normal Git URL to fetch the private sovereign-sdk repository when building with cargo build.
  • Use vendored file path when building in Nix.
  • Use separate toml entries for each Sovereign SDK dependency
    • Each entry would have uncommented git URL, and commented path value
    • The Nix build would uncomment the path value, and comment out the git URLs.

Motivation

The use of git submodule turns out to not work well with Cargo. When one tries to run cargo build with git dependencies with git submodules, Cargo will almost always try to also fetch the git submodule, whether it is required in the Cargo dependency or not.

Because of this, we need to use back git dependency for Sovereign SDK modules. On the other hand, in Nix we would patch the git dependencies, and replace them with path dependencies in order to work in Nix. This is because the Nix Rust build still does not support private repository, and we still need to use local vendored file path dependency inside the Nix build.

@soareschen soareschen requested review from ljoss17 and rnbguy May 2, 2024 13:31
nix/sov-celestia-cw.nix Outdated Show resolved Hide resolved
Copy link
Member

@rnbguy rnbguy left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thanks Soares 🙏

@soareschen soareschen merged commit 00e8d18 into main May 2, 2024
11 checks passed
@soareschen soareschen deleted the soares/cargo-git-nix-vendor branch May 2, 2024 19:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants