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

Vendored dependencies #15603

Merged
merged 16 commits into from
May 17, 2024
Merged

Vendored dependencies #15603

merged 16 commits into from
May 17, 2024

Conversation

joseandro
Copy link
Member

@joseandro joseandro commented May 2, 2024

We were exposed to supply chain attacks because our Rust dependencies were not pinned. This PR fixes that by pinning the kimchi stubs dependencies and also incorporating all vendored dependencies available in proof-systems.

Explain your changes:

  • Vendored all Kimchi stubs dependencies to a separate repository (i.e., kimchi-stubs-vendors).
  • Incorporated the kimchi-stubs-vendors repository as a dependency through git submodules.
  • Updated the Kimchi stubs dune script with proper instructions to use the vendored dependencies.
  • Pulled in all the vendored dependencies available in proof-systems:berkeley.

Explain how you tested your changes:

  • Verified that our build scripts no longer downloads crates from remote sources, both on CI and locally.
  • Ensured that Cargo always compiles the pinned dependencies available in our vendored submodules, both on CI and locally.
  • Checked that the version of the dependencies that Cargo builds matches exactly what we specify in Cargo.toml.

Checklist:

  • Dependency versions are unchanged
    • Notify Velocity team if dependencies must change in CI
  • Modified the current draft of release notes with details on what is completed or incomplete within this project
  • Document code purpose, how to use it
    • Mention expected invariants, implicit constraints
  • Tests were added for the new behavior
    • Document test purpose, significance of failures
    • Test names should reflect their purpose
  • All tests pass (CI will check this if you didn't)
  • Serialized types are in stable-versioned modules
  • Does this close issues? List them

@joseandro
Copy link
Member Author

!ci-build-me

@joseandro
Copy link
Member Author

!ci-build-me

@joseandro
Copy link
Member Author

!ci-build-me

@joseandro
Copy link
Member Author

!ci-build-me

@joseandro
Copy link
Member Author

!ci-build-me

@joseandro
Copy link
Member Author

!ci-build-me

@joseandro
Copy link
Member Author

!ci-build-me

@joseandro
Copy link
Member Author

!ci-build-me

@joseandro
Copy link
Member Author

!ci-build-me

@dannywillems
Copy link
Member

I have:

ile "src/lib/crypto/kimchi_bindings/stubs/dune", line 51, characters 0-615:
51 | (rule
52 |  (enabled_if
53 |   (= %{env:MARLIN_PLONK_STUBS=n} n))
....
74 |     cp
75 |     %{read:dune-build-root}/cargo_kimchi_stubs/release/libwires_15_stubs.a
76 |     .))))
error: failed to select a version for the requirement `libc = "^0.2.0"` (locked to 0.2.154)
candidate versions found which didn't match: 0.2.147
location searched: directory source `/home/soc/codes/o1-labs/mina-berkeley/_build/default/src/lib/crypto/kimchi_bindings/stubs/kimchi-stubs-vendors` (which is replacing registry `crates-io`)
required by package `wires_15_stubs v0.1.0 (/home/soc/codes/o1-labs/mina-berkeley/_build/default/src/lib/crypto/kimchi_bindings/stubs)`
perhaps a crate was updated and forgotten to be re-vendored?

while building.

Also, i have the following (unrelated) error:

Error: optcomp: cannot open imported file: /src/config.mlh: /src/config.mlh: No such file or directory
File "src/lib/genesis_constants/genesis_constants.ml", line 1, characters 3-9:
1 | [%%import "/src/config.mlh"]

Do you know where it comes from?

Commands I use to test:

git clone git@github.com:MinaProtocol/mina/ mina-berkeley
cd mina-berkeley
git checkout vendoring
gvm use go1.20
git submodule init
opam switch create ./ 4.14.0
git submodule update --recursive && eval $(opam env)
opam switch import opam.export -y
./scripts/pin-external-packages.sh
make build

Copy link
Member

@dannywillems dannywillems left a comment

Choose a reason for hiding this comment

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

I ran #15603 (comment) and it seems to work, not downloading anything. LGTM.

@joseandro
Copy link
Member Author

joseandro commented May 9, 2024

Building it one last time to make sure everything is fine using the berkeley branch in proof-systems

@joseandro joseandro changed the title Vendoring [Don't merge it] Vendored dependencies May 9, 2024
@joseandro
Copy link
Member Author

!ci-build-me

@joseandro joseandro marked this pull request as ready for review May 9, 2024 20:56
@joseandro joseandro requested a review from a team as a code owner May 9, 2024 20:56
@joseandro
Copy link
Member Author

!ci-build-me

@joseandro joseandro mentioned this pull request May 10, 2024
@joseandro
Copy link
Member Author

!ci-build-me

@joseandro
Copy link
Member Author

!ci-build-me

1 similar comment
@joseandro
Copy link
Member Author

!ci-build-me

@mrmr1993
Copy link
Member

!approved-for-mainnet

@mrmr1993 mrmr1993 merged commit 19d7afc into berkeley May 17, 2024
70 of 72 checks passed
@mrmr1993 mrmr1993 deleted the vendoring branch May 17, 2024 02:43
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.

None yet

3 participants