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

khal: standardize derivation #85993

Closed
wants to merge 7 commits into from
Closed

Conversation

doronbehar
Copy link
Contributor

@doronbehar doronbehar commented Apr 25, 2020

Motivation for this change

A few days ago, when updating all of my packages, I encountered build errors for khal / vdirsyncer mostly due to failing tests. When quickly patching an overlay to fix that, I noticed a few bad things in khal's default.nix:

  1. pkgs is an argument to the derivation. This is not good because:
    • It's harder to change an input used inside khal such as pkgs.vdirsyncer. You have to use:
khal = super.khal.override {
  pkgs = pkgs // {
    vdirsyncer = vdirsyncer.override { ... };
  };
}
  • I think that If you override another derivation via another overlay, that doesn't apply to what passed to that pkgs argument.
  1. There's a with python3.pkgs; at the top - which makes it hard to derive python deps and non python deps (readability).
  2. pkgs.vdirsyncer was used in propagatedBuildInputs. This is bad because:
    • it is required only for tests and although used frequently together along with khal, it isn't strictly required by it to run.
    • It increases closure size if somebody uses vdirsyncerStable.

Now, on master (without this PR) the tests don't fail but I strongly think this change is beneficial, for general maintainability and conformism with other unwritten conventions in Nixpkgs.

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.

@doronbehar
Copy link
Contributor Author

@GrahamcOfBorg build

@veprbl
Copy link
Member

veprbl commented Apr 25, 2020

There's a with python3.pkgs; at the top - which makes it hard to derive python deps and non python deps (readability)

How this improves the situation?

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

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

If they need to be used as libraries, add them there. If they're also used as applications, use toPythonApplication in all-packages.nix.

@doronbehar doronbehar force-pushed the improve-khal branch 2 times, most recently from e7c9538 to 4ea8d2a Compare April 26, 2020 08:16
pkgs/top-level/python-packages.nix Outdated Show resolved Hide resolved
@doronbehar
Copy link
Contributor Author

doronbehar commented Apr 26, 2020

BTW @FRidh I encountered that overrideAttrs issue while encountering an issue where the tests failed for vdirsyncer. This PR might fix it so please if you could take 1 more look here.

@doronbehar doronbehar mentioned this pull request May 1, 2020
10 tasks
Use toPythonApplication and use callPackage from python-packages.nix.
Make vdirsyncerStable somewhat functional again, but mark it as broken
for Python 3.6 or higher.
Don't know why they were there in the first place :/.
@doronbehar
Copy link
Contributor Author

@FRidh I know it's been a long time but this is still bothering me. Also, today I noticed todoman references glibLocales which is ~210Mb in size. Commit 2260aed in this PR fixes this.

@doronbehar
Copy link
Contributor Author

I'm closing in favor of smaller PRs which hopefully will be easier to review.

@doronbehar doronbehar closed this May 15, 2020
@doronbehar doronbehar deleted the improve-khal branch May 15, 2020 05:26
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

3 participants