Skip to content

External git dependencies without pinned versions causes non-deterministic builds #272

Description

@anshul23102

Description

The workspace dependencies include external crates fetched from git without specifying branch, tag, or rev constraints: mohu-compute and mohu-linalg. This means each build may fetch different commits from the default branch, causing non-deterministic builds and dependency conflicts. Without version pinning, the project cannot guarantee reproducible builds or consistent behavior across different build environments.

Steps to Reproduce

  1. Run 'cargo build' on main branch
  2. Observe that mohu-compute and mohu-linalg are fetched from git
  3. Wait for commits to be merged in those repositories
  4. Run 'cargo build' again
  5. Different commits may be fetched, causing non-deterministic builds

Environment Information

  • mohu (Rust library)
  • Affected file: Cargo.toml, lines 73-74
  • External dependencies: mohu-compute, mohu-linalg from GitHub
  • No version pinning specified

Expected Behavior

Git dependencies should specify explicit commits (rev=) or tags to ensure reproducible builds. Alternatively, crates should be published to crates.io and version-pinned via version constraints.

Actual Behavior

Lines 73-74 specify git repositories without branch, tag, or rev constraints. Cargo will fetch the default branch (main/master) which changes over time.

Code Reference

File: Cargo.toml
Lines: 73-74
Problematic code: mohu-compute = { git = 'https://github.com/mohu-org/mohu-compute' }
mohu-linalg = { git = 'https://github.com/mohu-org/mohu-linalg' }

Additional Context

Severity: Medium. Non-deterministic builds can hide bugs, cause CI/CD failures, and make debugging difficult. Suggested fix: Pin to specific commits or tags: { git = 'https://...', rev = 'abc123...' } or publish to crates.io.

Suggested Labels

build, dependency-management, reproducibility


Program Template

  • GSSoC

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions