Skip to content

Commit

Permalink
Revert "sbcl: move to /pkgs/by-name"
Browse files Browse the repository at this point in the history
This reverts commit 0a3dab4

After doing some improvements to the `pkgs/by-name` check I discovered
that sbcl shouldn't have been allowed in `pkgs/by-name` after all as is.

Specifically, the requirement is that if `pkgs/by-name/sb/sbcl` exists,
the definition of the `sbcl` attribute must look like

    sbcl = callPackage ../by-name/sb/sbcl/package.nix { ... };

However it currently is an alias like

    sbcl = sbcl_2_4_1;

This wasn't detected before because `sbcl_2_4_1` was semantically
defined using `callPackage`:

    sbcl_2_4_1 = wrapLisp {
      pkg = callPackage ../development/compilers/sbcl { version = "2.4.1"; };
      faslExt = "fasl";
      flags = [ "--dynamic-space-size" "3000" ];
    };

However this doesn't syntactically match what is required.

In NixOS#285089 I introduced syntactic
checks for exactly this, but they were only used for packages not
already in `pkgs/by-name`.

Only now that I'm doing the refactoring to also use this check for
`pkgs/by-name` packages this problem is noticed.

While introducing this new check is technically an increase in
strictness, and therefore would justify adding a new ratchet, I consider
this case to be rare enough that we don't need to do that.

This commit also introduces a test to prevent such regressions in the
future
  • Loading branch information
infinisil committed Feb 7, 2024
1 parent ebbe863 commit aa7b27c
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
self: super: {

bar = (x: x) self.callPackage ./pkgs/by-name/fo/foo/package.nix { someFlag = true; };
foo = self.bar;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import <test-nixpkgs> { root = ./.; }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ someDrv, someFlag }: someDrv
4 changes: 2 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25939,12 +25939,12 @@ with pkgs;

# Steel Bank Common Lisp
sbcl_2_4_0 = wrapLisp {
pkg = callPackage ../by-name/sb/sbcl/package.nix { version = "2.4.0"; };
pkg = callPackage ../development/compilers/sbcl { version = "2.4.0"; };
faslExt = "fasl";
flags = [ "--dynamic-space-size" "3000" ];
};
sbcl_2_4_1 = wrapLisp {
pkg = callPackage ../by-name/sb/sbcl/package.nix { version = "2.4.1"; };
pkg = callPackage ../development/compilers/sbcl { version = "2.4.1"; };
faslExt = "fasl";
flags = [ "--dynamic-space-size" "3000" ];
};
Expand Down

0 comments on commit aa7b27c

Please sign in to comment.