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

treewide: use new cargo fetcher #357257

Open
Bot-wxt1221 opened this issue Nov 19, 2024 · 7 comments
Open

treewide: use new cargo fetcher #357257

Bot-wxt1221 opened this issue Nov 19, 2024 · 7 comments
Labels
3.skill: sprintable A larger issue which is split into distinct actionable tasks 5. scope: tracking Long-lived issue tracking long-term fixes or multiple sub-problems 6.topic: rust

Comments

@Bot-wxt1221
Copy link
Member

Bot-wxt1221 commented Nov 19, 2024

TODO: @emilazy suggest my script should be reviewd independently and all output should be reduced.

She has mentioned that FOD hash attack is possible.

This is a tracking issue to replace #356862.

These are from old PR:

Already done. We should run nixpkgs-review to check if some package have different Cargo.lock when building and in nixpkgs, like veloren.

I have writen a script to update it automatically.

Now It can solve:

cargoLock = {
  lockFile = xxx;
  outputhahes = {xxx};
};
cargoLock.lockFile = xxx;
cargoLock.outputHashes = {xxx};

Script: https://github.com/Bot-wxt1221/cargo-rename

Usage:

Compile with gcc. Make sure fetch-cargo can be exec. Exec with a xx/pkgs/by-name/xx/xx/package.nix

cc #327063

#349360

Step to reduce:

  1. Generate a file list with cargoLock:
rg "cargoLock" --files-with-matches > filewithcargoLock

cat filewithcargoLock | rev | cut -d / -f 2|rev > packagename
  1. run update-all

useFetchCargoVendor

@Bot-wxt1221
Copy link
Member Author

Now All PR have split nixfmt into one.

@Aleksanaa
Copy link
Member

@emilazy do you agree with the step of changing to fetchCargoVendor first, before we investigate one lockfile mechanism?

@tomodachi94 tomodachi94 added the 3.skill: sprintable A larger issue which is split into distinct actionable tasks label Dec 13, 2024
@Atemu
Copy link
Member

Atemu commented Dec 26, 2024

Sorry, when was this resolved?

@emilazy
Copy link
Member

emilazy commented Dec 27, 2024

@emilazy do you agree with the step of changing to fetchCargoVendor first, before we investigate one lockfile mechanism?

Yes, I’m fine with that if others decide it’s a good idea (opinions on a treewide migration seemed mixed in #356862, but I have no objection myself) – my reviews were only to ensure that the PRs were not prematurely merged without someone reviewing the migration program’s logic and reproducing its results, as a mass change of FOD hashes across the tree is a worst‐case scenario for Nixpkgs supply‐chain attacks.

@Bot-wxt1221
Copy link
Member Author

Bot-wxt1221 commented Dec 27, 2024

I'm sorry that I can't promise to have enough time for a long term to keep active in nix community. So I close it. The script is still here that anyone run it and review it.

@Bot-wxt1221 Bot-wxt1221 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2024
@Atemu
Copy link
Member

Atemu commented Dec 27, 2024

I think the one large lockfile approach would be desirable whether we have the cargo fetcher or not.

I'm sorry that I can't promise to have enough time for a long term to keep active in nix community. So I close it.

You're in the same place as many of us; everyone understands. It's totally fine to keep issues open or work unfinished for years. No worries.

Get back to it when/if you have time and motivation. If you know you won't personally do it any time soon, it's good to be explicit about that (as you've just done) so others know they're free to pick up where you left off.

@Atemu Atemu reopened this Dec 27, 2024
@emilazy
Copy link
Member

emilazy commented Dec 27, 2024

I think the one large lockfile approach would be desirable whether we have the cargo fetcher or not.

Agreed, of course, but I’m biased, and I don’t want to block incremental improvements on my moonshot :) (Though these days I refer to it as separate crate packaging rather than one big lock file since we wouldn’t actually have or want one gigantic Cargo.lock file.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.skill: sprintable A larger issue which is split into distinct actionable tasks 5. scope: tracking Long-lived issue tracking long-term fixes or multiple sub-problems 6.topic: rust
Projects
None yet
Development

No branches or pull requests

6 participants