-
Notifications
You must be signed in to change notification settings - Fork 31
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
to_toml test in auditable-serde writes outside the build directory #82
Comments
Hello Alexander, I'm very great to hear that there is interest from Debian! Yes, that's a use case I am keen to support. FYI Void Linux already uses I assume Debian is building packages The important part is not whether the to_toml test can run (I can see some additional issues around that) but whether Is there a way I can reproduce the issue? It's probably going to be easiest for me to debug it myself than to suggest various changes to you. FWIW I used to be a Debian maintainer years ago, but I've never packaged Rust code, so Rust packaging guides might come in handy. |
#83 may be relevant here but I'm not sure if it is a blocker. I'm looking forward to the reproduction steps so that I could investigate in more detail. |
"interest from Debian" is maybe a bit of a stretch, I package some stuff for debian but isn't a core contributor, and since I work with security I think this would both make a good research topic for my 10% time at work, and improve the debian packaging of rust. Current state is that I will try to build a poc and propose that to the rest of the debian-rust team and see what they think about the whole concept. I can push a WIP-branch as soon as I have it a bit cleaned-up. Regarding on how debian works: Debian packages each crate as debian package that drops some source code into Thanks for the pointer to void-linux, will look through that, and I agree that the unit test failing is in itself a non-issue, I was mostly concerned with if it represented a larger issue that was hard to solve :) |
Yeah, it very well might. I think you're hitting rust-lang/cargo#10096. Passing |
I'm not fully done, but I'm running out of time for today, and I have something that be workable enough to reproduce/test with, the packaging work is pushed to this branch: https://salsa.debian.org/rust-team/debcargo-conf/-/tree/package-cargo-auditable Setting up a packaging environment for rust on Debian might be a bit complex, I would recommend to run debian sid in a virtual machine, and this guide that i wrote a long time ago might provide some hints: https://blog.hackeriet.no/packaging-a-rust-project-for-debian/ together with the readme in https://salsa.debian.org/rust-team/debcargo-conf/ Since that branch contains work on multiple packages you need to pack/build them in order so that they can be built in order. I think the below list of commands run inside the debcargo-conf/ checkout on that branch will yield a
This is maybe a bit too complex, feel free to contact me on OFTC where I go by the nick capitol, or drop me an email if there is any questions that are too off topic to take here. |
Thanks for the links! That looks helpful. Is there a way for me to take an unrelated package, smuggle I need to experiment with actual builds under |
Also, I've released |
TL;DR: disable the Okay, so I've installed Debian Sid and poked around a bit. I've found that yes, indeed, we're hitting rust-lang/cargo#10096. I don't really see how to make it work given the error it throws - this is a long-standing issue in The good news is that I think this should not be a blocker for building other packages with |
Thanks a lot of all the time you spent, I'll make sure to report back the result of my attempt on using it :) |
Just curious - are there any blockers for this work? Anything I can help with? |
@Shnatsel no, only blocker is that I'm doing this as a 10% project at work, so I haven't had that much time to look at it sadly |
Alright. No worries! |
NixOS is also rolling out builds with This might help your case for enabling this in Debian. |
I finished the initial packaging effort to get the One thing I needed to do was to upgrade the object dependency to version 0.30, as Debian try to not package multiple versions of crates. It would be interesting to know if you have any input on this patch: https://salsa.debian.org/rust-team/debcargo-conf/-/blob/master/src/cargo-auditable/debian/patches/tweak-deps.patch The thing that I'm most unsure about is hard coding |
Hmmm. Wikipedia says that if the OS ABI is set to 3 aka Really we want to be doing whatever |
These seem to be the two PRs adding the extra parameters: |
Most Linux executables use ELFOSABI_NONE, not ELFOSABI_LINUX. This is also what rustc itself uses in it's usage of the object crate. Only hermit, freebsd and solaris use a different OS ABI: https://github.com/rust-lang/rust/blob/dcca6a375bd4eddb3deea7038ebf29d02af53b48/compiler/rustc_codegen_ssa/src/back/metadata.rs#L196-L204 |
Oh, thanks a lot for the pointer! I'll just sync our local version of this file with the upstream, then. @alexanderkjall do you want me to make a new release, or carrying a patch that we also have in git master sounds preferable? |
I just synced to the latest code from rustc. Here's the diff: #104 Do you want me to cut a stable release with that? |
Thanks a lot for the review and quick work. I really appreciate not having my own guesses around these things distributed in Debian, as I'm not that experienced with it. I didn't manage to get this work done before the Debian freeze for the next release happened, and my guess is that we will have 1-2 more months of that. So there really isn't any need to do a release before the freeze ends. |
@alexanderkjall your work to add cargo-auditable to Debian sounds interesting. Is your plan to integrate it into dh-cargo or perhaps the Debian cargo wrapper so that Debian rust binary packages contain this audit info? |
@nickbroon That is my long term plan, I haven't actually done any of that work yet, so I'm not sure how it will work out. I guess that I need to have it behind a feature toggle in debcargo.toml, so that we can avoid having a package dependency loop. Without that cargo-auditable would need cargo-auditable to build itself, and that wouldn't work. |
Hi
I'm investigating if this could simplify the tracking of relationship between rust binaries and vulnerable versions of rust libraries in Debian, and as part of that investigation I started by seeing how easy it would be to package this with the Debian tooling.
I noticed that the to_toml test in auditable-serde fails due to that it tries to write a lock file into Debians crate registry directory and became a bit afraid that the project might be dead in the water due to that it needs to write those lock files during normal operations also, and not just for that unit test.
I realize that you don't control the cargo_metadata crate, but I thought that it might be worth asking here if this is a use case for auditable that you are interested in supporting?
Complete test output below for context:
The text was updated successfully, but these errors were encountered: