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

busybox: Fix 404 error by using git instead #97894

Merged
merged 2 commits into from Sep 13, 2020

Conversation

TethysSvensson
Copy link
Contributor

Motivation for this change

Same motivation as for #97286: The current master is broken, as debian has yanked an upstream tarball, which we need to get default.script.

This PR solves the issue by getting the file from git instead.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@TethysSvensson
Copy link
Contributor Author

CC: @worldofpeace

Comment on lines 39 to 43
debianSource = fetchgit {
url = "https://salsa.debian.org/installer-team/busybox.git";
rev = "debian/1%${debianVersion}";
Copy link
Member

Choose a reason for hiding this comment

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

Using fetchFromGitLab is preferred. (I did not touch the hash, it probably needs to be updated too).

Suggested change
debianSource = fetchgit {
url = "https://salsa.debian.org/installer-team/busybox.git";
rev = "debian/1%${debianVersion}";
debianSource = fetchFromGitLab {
domain = "salsa.debian.org";
owner = "installer-team";
repo = pname;
rev = "debian/1%${debianVersion}";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fetchFromGitlab does not currently work when the revision contains a slash, as the line renamed="$TMPDIR/${baseNameOf url}" does not work as expected.

@@ -1,4 +1,4 @@
{ stdenv, lib, buildPackages, fetchurl, fetchzip
{ stdenv, lib, buildPackages, fetchurl, fetchgit
Copy link
Member

@prusnak prusnak Sep 13, 2020

Choose a reason for hiding this comment

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

Suggested change
{ stdenv, lib, buildPackages, fetchurl, fetchgit
{ stdenv, lib, buildPackages, fetchurl, fetchFromGitLab

see the other suggested change

Debian has yanked the upstream tarball we use to get default.script. We
could simply bump the version number to get the new tarball, but to
avoid the problem in the future, we should instead fetch it from git.
@TethysSvensson
Copy link
Contributor Author

@prusnak Please take another look. I had to update fetchgitlab/default.nix as to support downloading from tags with % or / in them.

@pbogdan
Copy link
Member

pbogdan commented Sep 13, 2020

Why not fetch just the individual file instead of downloading the whole repo?

@TethysSvensson
Copy link
Contributor Author

@pbogdan I have no idea if the individual file download links are stable in gitlab.

It seems like I could potentially use https://salsa.debian.org/installer-team/busybox/-/raw/debian/1%251.30.1-6/debian/tree/busybox-udeb/etc/udhcpc/default.script

What do you think? Should I try to use that instead?

@TethysSvensson
Copy link
Contributor Author

@pbogdan If you are okay with this, I would prefer to get it merged as-is.

I am getting a bit tired of bikeshedding how to get this file, since I have already tried four different methods for based on reiews (inlining the file in the nixpkgs repo, downloading from a debian tarball, downloading using fetchgit and now downloading via fetchFromGitLab).

@worldofpeace
Copy link
Contributor

Yeah, I'm not going to ask anyone to change anything again to get one file. Though I will say that if you're using github or gitlab, it will always be better to use the raw file download with a "immutable" tag or a rev https://salsa.debian.org/installer-team/busybox/-/raw/5b00be6c94dd25618c0b59f152c89ff5e8b05551/debian/tree/udhcpc/etc/udhcpc/default.script.

@worldofpeace worldofpeace merged commit f5fdc6b into NixOS:master Sep 13, 2020
@worldofpeace
Copy link
Contributor

I think a backport for this is needed to 20.09?

@TethysSvensson
Copy link
Contributor Author

I think a backport for this is needed to 20.09?

Done in #97929

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants