In legacy/trac#30490 (moved) we added cbindgen to our projects which resulted in a large extra archive with all the vendored stuff that is specified. However, we probably don't need a lot of that stuff (like all the big Windows .a files). We should figure out a smarter way of handling that than just shipping everything.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
If Mozilla is vendoring most of the rust dependencies we need, I think we could generate a tarball from tor-browser.git/third_party/rust, and include it in the cbindgen project, and in other rust projects that we build. That way we don't need to manually update a tarball of vendored projects.
If we want to avoid generating a new tarball (which will probably involve generating a tarball containing all the firefox tree, extracting it, and generating a new tarball from the third_party/rust directory only), we can re-use the src-firefox-$version.tar.xz tarball which we already generate.
If Mozilla is vendoring most of the rust dependencies we need, I think we could generate a tarball from tor-browser.git/third_party/rust, and include it in the cbindgen project, and in other rust projects that we build. That way we don't need to manually update a tarball of vendored projects.
If we want to avoid generating a new tarball (which will probably involve generating a tarball containing all the firefox tree, extracting it, and generating a new tarball from the third_party/rust directory only), we can re-use the src-firefox-$version.tar.xz tarball which we already generate.
Yeah, I've thought about that. The problem here is, though, those the projects in question are external ones which are not needed to build Mozilla's Rust code. Thus, Mozilla has not vendored them in but has them rather as a build dependency. For cbindgen we could think about using Debian packages at least once we move don't have versions anymore where cbindgen is not shipped for in a sufficiently recent version. For lucetc this option is not available.
If Mozilla is vendoring most of the rust dependencies we need, I think we could generate a tarball from tor-browser.git/third_party/rust, and include it in the cbindgen project, and in other rust projects that we build. That way we don't need to manually update a tarball of vendored projects.
If we want to avoid generating a new tarball (which will probably involve generating a tarball containing all the firefox tree, extracting it, and generating a new tarball from the third_party/rust directory only), we can re-use the src-firefox-$version.tar.xz tarball which we already generate.
Yeah, I've thought about that. The problem here is, though, those the projects in question are external ones which are not needed to build Mozilla's Rust code. Thus, Mozilla has not vendored them in but has them rather as a build dependency. For cbindgen we could think about using Debian packages at least once we move don't have versions anymore where cbindgen is not shipped for in a sufficiently recent version. For lucetc this option is not available.
Hmm, I don't understand what you mean here. When I look at the content of cbindgen-vendor.tar.bz2, all the directories included in it are also present in tor-browser.git/third_party/rust. Or are you talking about other projects than cbindgen?
If Mozilla is vendoring most of the rust dependencies we need, I think we could generate a tarball from tor-browser.git/third_party/rust, and include it in the cbindgen project, and in other rust projects that we build. That way we don't need to manually update a tarball of vendored projects.
If we want to avoid generating a new tarball (which will probably involve generating a tarball containing all the firefox tree, extracting it, and generating a new tarball from the third_party/rust directory only), we can re-use the src-firefox-$version.tar.xz tarball which we already generate.
Yeah, I've thought about that. The problem here is, though, those the projects in question are external ones which are not needed to build Mozilla's Rust code. Thus, Mozilla has not vendored them in but has them rather as a build dependency. For cbindgen we could think about using Debian packages at least once we move don't have versions anymore where cbindgen is not shipped for in a sufficiently recent version. For lucetc this option is not available.
Hmm, I don't understand what you mean here. When I look at the content of cbindgen-vendor.tar.bz2, all the directories included in it are also present in tor-browser.git/third_party/rust. Or are you talking about other projects than cbindgen?
I am talking right now about cbindgen and lucetc. But the specific third_party/rust part I had in mind is only applying to the former.
Yes, the packages are there but not all the versions are the same as cargo vendor gives us. This, the risk is high that either compilation fails or some other weird behavior would happen. If the packages available and the versions they are in matched, I agree, using the code from third_party/rust would work. But, alas, that's not the case.
If we trust that cargo vendor will provide reproducible output, and is correctly checking downloaded files, then maybe we could add some step in the build where we allow network access in the container, in order to run cargo vendor and generate a vendor tarball.
If we trust that cargo vendor will provide reproducible output, and is correctly checking downloaded files, then maybe we could add some step in the build where we allow network access in the container, in order to run cargo vendor and generate a vendor tarball.
Moving this to February. If we make the above assumptions (and they need to be confirmed), then after legacy/trac#28325 (moved) is solved this ticket should (hopefully) follow soon after.
I'm wondering if we could make cargo vendor log the URLs from files it is downloading, to be able generate something similar to gradle-dependencies-list.txt.
At the reproducible build summit I have been suggested to have a look at the Cargo.lock file and cargo fetch command that can use it.
But we did not try to hack on, so I am not sure it will solve our problem.
We had a quick look at the format of the Cargo.lock and it references the crates registry, so using cargo fetch might just be the easiest solution.
If needed, we could create a dependency tarball on our machines first, then version the resulting hash, in case we want to be more sure about the integrity.
In !762 (merged) I moved application-services and cbindgen to the new pkg_type: cargo_vendor that creates itself automatically with cargo vendor --locked vendor.
So far it worked everywhere, even though I created the hashes a while ago (e.g., tb-build-06 built the vendor packages today for the first time, and it succeeded).
uniffi-rs still uses an old archive hosted in people.tpo.
However, we build an old version (0.7.0), and application services include a more recent one (0.23.0) in their Rust dependencies.
So, I will try to build application services without uniffi-rs, and if it succeeds I will open an issue to drop the project and close this one as solved.