Nixpkgs: Get rid of composableDerivation

Created on 19 Sep 2016  路  11Comments  路  Source: NixOS/nixpkgs

A few packages use composableDerivation, which is complicated to understand. Since all other thousand packages use .override mechanism, we should convert the rest of dozen to do the same.

This is part of the effort to standardize the codebase.

Refs https://github.com/NixOS/nixpkgs/issues/18762

Scope:

$ git grep composableDerivation| wc -l
38
hygiene user experience

Most helpful comment

This is almost done:

pkgs/applications/editors/vim/configurable.nix:, composableDerivation, writeText, lib, config, glib, gtk2, gtk3, python, perl, tcl, ruby
pkgs/applications/editors/vim/configurable.nix:  inherit (args.composableDerivation) composableDerivation edf;
pkgs/applications/editors/vim/configurable.nix:composableDerivation {
pkgs/applications/editors/vim/qvim.nix:, composableDerivation, lib, config, python, perl, tcl, ruby, qt4
pkgs/applications/editors/vim/qvim.nix:let inherit (args.composableDerivation) composableDerivation edf; in
pkgs/applications/editors/vim/qvim.nix:composableDerivation {
pkgs/development/interpreters/php/default.nix:{ lib, stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison
pkgs/development/interpreters/php/default.nix:    in composableDerivation.composableDerivation {} (fixed: {
pkgs/development/libraries/fltk/default.nix:{ stdenv, composableDerivation, fetchurl, pkgconfig, xlibsWrapper, inputproto, libXi
pkgs/development/libraries/fltk/default.nix:let inherit (composableDerivation) edf; in
pkgs/development/libraries/fltk/default.nix:composableDerivation.composableDerivation {} {
pkgs/development/libraries/postgis/default.nix:args@{fetchurl, composableDerivation, stdenv, perl, libxml2, postgresql, geos, proj, flex, gdal, json_c, pkgconfig, file, ...}:
pkgs/development/libraries/postgis/default.nix:  pgDerivationBase = composableDerivation.composableDerivation {} ( fix :

All 11 comments

This is almost done:

pkgs/applications/editors/vim/configurable.nix:, composableDerivation, writeText, lib, config, glib, gtk2, gtk3, python, perl, tcl, ruby
pkgs/applications/editors/vim/configurable.nix:  inherit (args.composableDerivation) composableDerivation edf;
pkgs/applications/editors/vim/configurable.nix:composableDerivation {
pkgs/applications/editors/vim/qvim.nix:, composableDerivation, lib, config, python, perl, tcl, ruby, qt4
pkgs/applications/editors/vim/qvim.nix:let inherit (args.composableDerivation) composableDerivation edf; in
pkgs/applications/editors/vim/qvim.nix:composableDerivation {
pkgs/development/interpreters/php/default.nix:{ lib, stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison
pkgs/development/interpreters/php/default.nix:    in composableDerivation.composableDerivation {} (fixed: {
pkgs/development/libraries/fltk/default.nix:{ stdenv, composableDerivation, fetchurl, pkgconfig, xlibsWrapper, inputproto, libXi
pkgs/development/libraries/fltk/default.nix:let inherit (composableDerivation) edf; in
pkgs/development/libraries/fltk/default.nix:composableDerivation.composableDerivation {} {
pkgs/development/libraries/postgis/default.nix:args@{fetchurl, composableDerivation, stdenv, perl, libxml2, postgresql, geos, proj, flex, gdal, json_c, pkgconfig, file, ...}:
pkgs/development/libraries/postgis/default.nix:  pgDerivationBase = composableDerivation.composableDerivation {} ( fix :

Down to 4:

` pkgs/applications/editors/vim/configurable.nix:, composableDerivation, writeText, lib, config, glib, gtk2, gtk3, python, perl, tcl, ruby pkgs/applications/editors/vim/configurable.nix: inherit (args.composableDerivation) composableDerivation edf; pkgs/applications/editors/vim/configurable.nix:composableDerivation { pkgs/applications/editors/vim/qvim.nix:, composableDerivation, lib, config, python, perl, tcl, ruby, qt4 pkgs/applications/editors/vim/qvim.nix:let inherit (args.composableDerivation) composableDerivation edf; in pkgs/applications/editors/vim/qvim.nix:composableDerivation { pkgs/development/interpreters/php/default.nix:{ lib, stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison pkgs/development/interpreters/php/default.nix: in composableDerivation.composableDerivation {} (fixed: { pkgs/development/libraries/fltk/default.nix:{ stdenv, composableDerivation, fetchurl, pkgconfig, xlibsWrapper, inputproto, libXi pkgs/development/libraries/fltk/default.nix:let inherit (composableDerivation) edf; in pkgs/development/libraries/fltk/default.nix:composableDerivation.composableDerivation {} {

This currently bites me, because the ruby build fails on my Linux machine with a segmentation fault. I'd like to use vim_configurable, but can't figure out how to disable ruby support in composableDerivation.

Edit: Figured it out. It seems it's just config.vim.ruby = false; in ~/.config/nixpkgs/config.nix.
I'd still love for composableDerivation to disappear.

Last derivations to be converted

  • #43886
  • #43900

When both have been merged we can remove composableDerivation and supporting code in lib/deprecated.nix.

It might be a good idea to move lib.composableDerivation to aliases.nix. Once d68322504a53d72eae29dca959936f544f54672a is reverted, this would prevent PRs to Nixpkgs from reintroducing composableDerivation. This would be a little bit more convenient to people who rely on it outside of Nixpkgs.

It was announced here on the tracker that it would be removed almost two years ago now. If someone depends on it, too bad for them.

I don't think we should expect users to read through 2000 issues, but we can just remove it and provide an assertion and changelog, since it's a very developer thing to use it.

I guess I don鈥檛 know how extensively this is used. But in the future I鈥檇 like to have some standardized procedure for removing things from lib and elsewhere. How about a warning inserted into the to-be removed function for 1 stable release before the removal in the next one? Maybe it doesn鈥檛 have to apply here but in the future any significant change to either lib, stdenv, or similar should probably go through a deprecation cycle. I don鈥檛 think we鈥檙e quite there yet because things change quickly hut this is something that would provide a more obvious warningn.

in #44116

There appears to be no longer instances of composableDerivation apart from its definition when grepping through nixpkgs.

Is it time to remove them all?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthiasbeyer picture matthiasbeyer  路  3Comments

ob7 picture ob7  路  3Comments

grahamc picture grahamc  路  3Comments

retrry picture retrry  路  3Comments

langston-barrett picture langston-barrett  路  3Comments