Skip to content

Comments

chore: source a Cargo.lock in ffi crate to help Nix build it#54

Closed
beltram wants to merge 3 commits intomainfrom
lock-ffi
Closed

chore: source a Cargo.lock in ffi crate to help Nix build it#54
beltram wants to merge 3 commits intomainfrom
lock-ffi

Conversation

@beltram
Copy link
Contributor

@beltram beltram commented Mar 15, 2023


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

In order for Nix to deterministically build the ffi crate, it requires a Cargo.lock. We create it through a build script because we do not want it in the main workspace since this is primarily a lib


References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@beltram beltram mentioned this pull request Mar 15, 2023
8 tasks
@beltram beltram requested a review from flokli March 15, 2023 10:10
@flokli
Copy link
Contributor

flokli commented Mar 15, 2023

Thanks! This almost works, but the Cargo.lock is still missing some checksums:

No hash was found while vendoring the git dependency biscuit-0.6.0-beta1

I'd assume it's the crates mentioned in #53, and might be fixed by switching from

 [patch.crates-io.biscuit]                                                              
   6  git = "https://github.com/beltram/biscuit"                                             
   7  tag = "v0.6.0-pre.core-crypto-0.6.0"

To an explicit

[dependencies.biscuit]
git = https://github.com/beltram/biscuit.git
rev = 36b6f30964142f0ca5bc17c908e8b2ad78febaf6

section (and similarly for the other deps where we currently use the patches mechanism).

The Cargo.lock file(s) should then contain a checksum field for these crates.

@beltram
Copy link
Contributor Author

beltram commented Mar 15, 2023

I pinned revisions instead of tags. Does it work better ?

@flokli
Copy link
Contributor

flokli commented Mar 15, 2023

No, Cargo.lock is still missing the checksums.

@flokli
Copy link
Contributor

flokli commented Mar 15, 2023

So apparently in both cases the checksums don't end up getting added to Cargo.lock, which is why tools like crate2nix do populate a crate-hashes.json in addition to the Cargo.lock.

I'll see if I can get it to work on the wire-server side, and will update you here once I got it working 👍

@beltram
Copy link
Contributor Author

beltram commented Mar 30, 2023

Fixed by getting rid of ring 39d56d5 and build (manually) Cargo.lock in ffi crate

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