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

fetchNextcloudApp: rewrite with fetchzip & applyPatches #193075

Merged
merged 2 commits into from
Oct 16, 2022

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Sep 26, 2022

Description of changes

There are the following issues with the current implementation:

  • fetchurl with a tarball from GitHub appears to break occasionally because the tarballs are not necessarily reproducible. Because of that, fetchFromGitHub unpacks the tarball already because the contents are actually reproducible in contrast to the tarball. To have the same behavior here, we use fetchzip now (and applyPatches on top to apply additional patches if needed).

  • Fixes the way how patches are applied. Previously, when having patches for a git checkout of the app, these wouldn't apply because the appname-version prefix is missing.

  • Because all old hashes are broken with this, I added an evaluation check that breaks evaluation when using the old API (i.e. with name/version which are not needed anymore).

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

There are the following issues with the current implementation:

* `fetchurl` with a tarball from GitHub appears to break occasionally
  because the tarballs are not necessarily reproducible. Because of
  that, `fetchFromGitHub` unpacks the tarball already because the
  contents are actually reproducible in contrast to the tarball. To have
  the same behavior here, we use `fetchzip` now (and `applyPatches` on
  top to apply additional patches if needed).

* Fixes the way how patches are applied. Previously, when having patches
  for a git checkout of the app, these wouldn't apply because the
  `appname-version` prefix is missing.

* Because all old hashes are broken with this, I added an evaluation
  check that breaks evaluation when using the old API (i.e. with
  `name`/`version` which are not needed anymore).
@Ma27 Ma27 requested a review from beardhatcode September 26, 2022 18:42
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Sep 26, 2022
@ajs124
Copy link
Member

ajs124 commented Sep 26, 2022

I think this will break nc4nix.

Which isn't really a reason not to merge this, just a note that there is external tooling out there which this PR might break.
I'll just fix nc4nix ahead of switching to 22.11.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation This PR adds or changes documentation labels Oct 1, 2022
@Ma27
Copy link
Member Author

Ma27 commented Oct 1, 2022

I'm pretty sure that it will. Added an entry to the release-notes.

Anything else tbd to get this merged? %)

@ofborg ofborg bot added 10.rebuild-linux: 1-10 and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Oct 1, 2022
Copy link
Contributor

@beardhatcode beardhatcode left a comment

Choose a reason for hiding this comment

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

This is indeed a much cleaner implementation than mine 👍

@bobby285271 bobby285271 added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Oct 11, 2022
@Ma27 Ma27 merged commit a914b94 into NixOS:master Oct 16, 2022
@Ma27 Ma27 deleted the nextcloud-pkg-fix branch October 16, 2022 18:08
{ name
, url
, version
{ stdenv, fetchzip, applyPatches, ... }:
Copy link
Member

Choose a reason for hiding this comment

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

stdenv does not seem to be used anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: fetch 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants