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

libusb-compat: 0.1.5 -> 0.1.7 && change libusb source to GitHub #48434

Merged
merged 2 commits into from Mar 9, 2020

Conversation

lschuermann
Copy link
Member

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.


src = fetchurl {
url = "mirror://sourceforge/libusb/${name}.tar.bz2";
url = "https://github.com/libusb/libusb/releases/download/v${version}/${name}.tar.bz2";
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't fetchFromGitHub here be used instead? The release pages don't seem to contain anything other than just the source code.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, there seems to be some difference in the source archive and release tarball: https://gist.github.com/lschuermann/61ab11d3cc7ae3f9073f0c0e1da04981.
I think most of these files could be generated using autoreconfHook, however I'm not quite sure whether a release tarball or building from the source archive is preferred.

This is the same situation as in #48381.

Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to use the source tarballs (non-release). This way the build will also succeed if somebody overrides src with something else.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I'll change it to use fetchFromGitHub.

@lschuermann
Copy link
Member Author

I can't build using @GrahamcOfBorg yet, can you try @infinisil?

@peterhoeg
Copy link
Member

@GrahamcOfBorg build libusb-compat

@GrahamcOfBorg
Copy link

No attempt on x86_64-linux (full log)

The following builds were skipped because they don't evaluate on x86_64-linux: libusb-compat

Partial log (click to expand)

Cannot nix-instantiate `libusb-compat' because:
error: attribute 'libusb-compat' in selection path 'libusb-compat' not found

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: libusb-compat

Partial log (click to expand)

Cannot nix-instantiate `libusb-compat' because:
error: attribute 'libusb-compat' in selection path 'libusb-compat' not found

@peterhoeg
Copy link
Member

@grahamofborg build libusb libusb1

@infinisil
Copy link
Member

@GrahamcOfBorg build libusb libusb1

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: libusb, libusb1

Partial log (click to expand)

strip is /nix/store/53nysl8bqwxihwzs1pgwka20nf8mbvlp-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/6bac4zkx3arcm60b7xfk55xa6jng35w8-libusb-compat-0.1.7/lib
patching script interpreter paths in /nix/store/6bac4zkx3arcm60b7xfk55xa6jng35w8-libusb-compat-0.1.7
/nix/store/6bac4zkx3arcm60b7xfk55xa6jng35w8-libusb-compat-0.1.7/lib/libusb-0.1.4.dylib: fixing dylib
strip is /nix/store/53nysl8bqwxihwzs1pgwka20nf8mbvlp-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/mvgv734fi9h8dxm3c9xkp8ibh6wivcfx-libusb-compat-0.1.7-dev/lib  /nix/store/mvgv734fi9h8dxm3c9xkp8ibh6wivcfx-libusb-compat-0.1.7-dev/bin
patching script interpreter paths in /nix/store/mvgv734fi9h8dxm3c9xkp8ibh6wivcfx-libusb-compat-0.1.7-dev
/nix/store/mvgv734fi9h8dxm3c9xkp8ibh6wivcfx-libusb-compat-0.1.7-dev/bin/libusb-config: interpreter directive changed from "/bin/sh" to "/nix/store/frkmk9zf3vdkdbh05hlhln8j17srj8fx-bash-4.4-p23/bin/sh"
/nix/store/6bac4zkx3arcm60b7xfk55xa6jng35w8-libusb-compat-0.1.7
/nix/store/p3lih2cl4b24l40smj92wsbrah6acsck-libusb-1.0.22

@infinisil
Copy link
Member

infinisil commented Oct 15, 2018

Actually, that's a whole lotta rebuilds, this should go to staging. I doubt ofborg can build this without timeouting

Edit: Oh right, the package itself shouldn't timeout, only the stuff that depends on it

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libusb, libusb1

Partial log (click to expand)

patching script interpreter paths in /nix/store/22amby0m2s4xih3qyn2sfgwyq2k92zpn-libusb-compat-0.1.7
checking for references to /build in /nix/store/22amby0m2s4xih3qyn2sfgwyq2k92zpn-libusb-compat-0.1.7...
shrinking RPATHs of ELF executables and libraries in /nix/store/8l4ns0icf5ndqjr3zmc16b9df49zq7ii-libusb-compat-0.1.7-dev
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/8l4ns0icf5ndqjr3zmc16b9df49zq7ii-libusb-compat-0.1.7-dev/lib  /nix/store/8l4ns0icf5ndqjr3zmc16b9df49zq7ii-libusb-compat-0.1.7-dev/bin
patching script interpreter paths in /nix/store/8l4ns0icf5ndqjr3zmc16b9df49zq7ii-libusb-compat-0.1.7-dev
/nix/store/8l4ns0icf5ndqjr3zmc16b9df49zq7ii-libusb-compat-0.1.7-dev/bin/libusb-config: interpreter directive changed from "/bin/sh" to "/nix/store/dsyc1z7ck08ga7l0b1jcxx35wj69qcii-bash-4.4-p23/bin/sh"
checking for references to /build in /nix/store/8l4ns0icf5ndqjr3zmc16b9df49zq7ii-libusb-compat-0.1.7-dev...
/nix/store/22amby0m2s4xih3qyn2sfgwyq2k92zpn-libusb-compat-0.1.7
/nix/store/1s6jqxqgldwn46x3v89l2zkx6fmnrllh-libusb-1.0.22

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: libusb, libusb1

Partial log (click to expand)

patching script interpreter paths in /nix/store/3gqlnvl7gppp2xj73hd7pah8x8wljxxj-libusb-compat-0.1.7
checking for references to /build in /nix/store/3gqlnvl7gppp2xj73hd7pah8x8wljxxj-libusb-compat-0.1.7...
shrinking RPATHs of ELF executables and libraries in /nix/store/8ckxhdcm43a3rzcl4wq2rv7ddydfl83r-libusb-compat-0.1.7-dev
strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/8ckxhdcm43a3rzcl4wq2rv7ddydfl83r-libusb-compat-0.1.7-dev/lib  /nix/store/8ckxhdcm43a3rzcl4wq2rv7ddydfl83r-libusb-compat-0.1.7-dev/bin
patching script interpreter paths in /nix/store/8ckxhdcm43a3rzcl4wq2rv7ddydfl83r-libusb-compat-0.1.7-dev
/nix/store/8ckxhdcm43a3rzcl4wq2rv7ddydfl83r-libusb-compat-0.1.7-dev/bin/libusb-config: interpreter directive changed from "/bin/sh" to "/nix/store/r47p5pzx52m3n34vdgqpk5rvqgm0m24m-bash-4.4-p23/bin/sh"
checking for references to /build in /nix/store/8ckxhdcm43a3rzcl4wq2rv7ddydfl83r-libusb-compat-0.1.7-dev...
/nix/store/3gqlnvl7gppp2xj73hd7pah8x8wljxxj-libusb-compat-0.1.7
/nix/store/889agdq681fspyrih78lmyy8anlf14la-libusb-1.0.22

@lschuermann
Copy link
Member Author

Actually, that's a whole lotta rebuilds, this should go to staging. I doubt ofborg can build this without timeouting

My understanding of what @GrahamcOfBorg build libusb does might not be correct, but I always thought that it only builds all dependencies of libusb, not those depending on libusb. That shouldn't be too much, right?
I'm guessing that Hydra will have a hard time rebuilding 501+ packages.

@infinisil
Copy link
Member

Oh actually, when you switch this PR to staging, ofborg might not be able to build it because on staging stdenv got changed there.

But anyways, this looks good to me if it's on staging.

@lschuermann
Copy link
Member Author

lschuermann commented Oct 15, 2018

I noticed that the switch to staging pulled all the other commits from master over too. Should I rather rebase my commits? I've never contributed something to staging before. 😢

@infinisil
Copy link
Member

@GrahamcOfBorg eval

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libusb

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/j2zdw7nvnp6igh7nn3viilg6mjddsh3l-libusb-compat-0.1.7/lib
patching script interpreter paths in /nix/store/j2zdw7nvnp6igh7nn3viilg6mjddsh3l-libusb-compat-0.1.7
checking for references to /build in /nix/store/j2zdw7nvnp6igh7nn3viilg6mjddsh3l-libusb-compat-0.1.7...
shrinking RPATHs of ELF executables and libraries in /nix/store/pn48p4ha3j7iry0n468f50jjxjdig27h-libusb-compat-0.1.7-dev
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/pn48p4ha3j7iry0n468f50jjxjdig27h-libusb-compat-0.1.7-dev/lib  /nix/store/pn48p4ha3j7iry0n468f50jjxjdig27h-libusb-compat-0.1.7-dev/bin
patching script interpreter paths in /nix/store/pn48p4ha3j7iry0n468f50jjxjdig27h-libusb-compat-0.1.7-dev
/nix/store/pn48p4ha3j7iry0n468f50jjxjdig27h-libusb-compat-0.1.7-dev/bin/libusb-config: interpreter directive changed from "/bin/sh" to "/nix/store/dsyc1z7ck08ga7l0b1jcxx35wj69qcii-bash-4.4-p23/bin/sh"
checking for references to /build in /nix/store/pn48p4ha3j7iry0n468f50jjxjdig27h-libusb-compat-0.1.7-dev...
/nix/store/j2zdw7nvnp6igh7nn3viilg6mjddsh3l-libusb-compat-0.1.7

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: libusb

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/y2ksj9ga0yk42gq6xy7rm5ks2j8kyf1p-libusb-compat-0.1.7/lib
patching script interpreter paths in /nix/store/y2ksj9ga0yk42gq6xy7rm5ks2j8kyf1p-libusb-compat-0.1.7
checking for references to /build in /nix/store/y2ksj9ga0yk42gq6xy7rm5ks2j8kyf1p-libusb-compat-0.1.7...
shrinking RPATHs of ELF executables and libraries in /nix/store/n1glr2n5flw3fgq1h650wiq95fdk990m-libusb-compat-0.1.7-dev
strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/n1glr2n5flw3fgq1h650wiq95fdk990m-libusb-compat-0.1.7-dev/lib  /nix/store/n1glr2n5flw3fgq1h650wiq95fdk990m-libusb-compat-0.1.7-dev/bin
patching script interpreter paths in /nix/store/n1glr2n5flw3fgq1h650wiq95fdk990m-libusb-compat-0.1.7-dev
/nix/store/n1glr2n5flw3fgq1h650wiq95fdk990m-libusb-compat-0.1.7-dev/bin/libusb-config: interpreter directive changed from "/bin/sh" to "/nix/store/r47p5pzx52m3n34vdgqpk5rvqgm0m24m-bash-4.4-p23/bin/sh"
checking for references to /build in /nix/store/n1glr2n5flw3fgq1h650wiq95fdk990m-libusb-compat-0.1.7-dev...
/nix/store/y2ksj9ga0yk42gq6xy7rm5ks2j8kyf1p-libusb-compat-0.1.7

@mmahut
Copy link
Member

mmahut commented Aug 19, 2019

Are there any updates on this pull request, please?

@lschuermann
Copy link
Member Author

lschuermann commented Aug 20, 2019

v0.1.7 still seems to be the most recent release, and changing the source to GitHub is probably a good idea. It appears there have been some changes on staging already, I'll see whether this PR still makes sense for libusb1 and then rebase accordingly.


Forgot about this for a while, putting it on the top of my todo list.

@peterhoeg
Copy link
Member

Please also make the name -> pname transition while at it.

@prusnak
Copy link
Member

prusnak commented Oct 27, 2019

@lschuermann ping?

@peterhoeg
Copy link
Member

peterhoeg commented Mar 3, 2020

@lschuermann, any chance you have time to get these few changes sorted so we can get this merged?

@lschuermann
Copy link
Member Author

Yes, I was very busy these previous months, but starting today I have time for nixpkgs again. Let me sort this this very weekend. Sorry.

Leon Schuermann added 2 commits March 8, 2020 19:38
Also, change the source repository to the GitHub repository pointed to by the
official website.
@lschuermann
Copy link
Member Author

lschuermann commented Mar 8, 2020

Now both libusb and libusb-compat are up to date, build directly from source instead of a release tarball and use the official GitHub repo for fetching said sources. I rebased on the current staging again.

This should work, but I didn't manage to build it yet. My server's on it currently, but seeing how many packages I have to build from source this will take some long time.

EDIT: Successfully built both libusb and libusb1 from my nixpkgs branch.

@@ -43,8 +48,4 @@ stdenv.mkDerivation (rec {
license = licenses.lgpl21Plus;
maintainers = [ ];
};
} // stdenv.lib.optionalAttrs withStatic {
# Carefully added here to avoid a mass rebuild.
# Inline this the next time this package changes.
Copy link
Member Author

Choose a reason for hiding this comment

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

I've inlined this statement as we're changing the expression anyways.

@prusnak
Copy link
Member

prusnak commented Mar 8, 2020

Why would you want to build from git checkout instead of the release tarball? I don't think we want this.

The idea was to replace the sourceforge release tarball with the github release tarball, not to replace the tarball with the git checkout.

Drop the aa63d51 commit from the PR, but you can keep the dontDisableStatic = withStatic; refactor.

@doronbehar
Copy link
Contributor

To put my 2 cents, I think fetchgit and it's derivatives are superior to release tarballs because in the future, they'll might get updated automatically by bots such as @r-ryantm .

@mmahut
Copy link
Member

mmahut commented Mar 9, 2020

Just a side note, fetchFromGitHub uses the tarball, as per:

https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/fetchgithub/default.nix#L31

@Mic92 Mic92 merged commit 9f55c5e into NixOS:staging Mar 9, 2020
@Mic92
Copy link
Member

Mic92 commented Mar 9, 2020

I also agree that fetchFromGitHub makes the expression more flexible. Also autoreconfHook will make sure that the build system is regenerated with the latest autoconf source.

@lschuermann
Copy link
Member Author

Also autoreconfHook will make sure that the build system is regenerated with the latest autoconf source.

I think that was the entire idea. Not building from the release tarball removes unnecessary dependencies, and allows to override the src attribute for building and developing on non-releases.

@lschuermann
Copy link
Member Author

Just a side note, fetchFromGitHub uses the tarball, as per:

You have to distinguish release tarballs (uploaded by the author of the project) and archive tarballs, which are generated by GitHub as a checkout of the commit.

We are now using archive tarballs, which is a checkout of the tag and doesn't have the possibility of the author making malicious changes which aren't in the Git repo, like with release tarballs.

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

8 participants