Skip to content

Commit

Permalink
Problem: compiler-lib won't install if it's already installed
Browse files Browse the repository at this point in the history
Solution: Remove compiler-lib from the dependencies of
fractalide-tests-pkg.

Result: Now we have two problems.

When running inside a nix derivation (`fractalide-tests`):

```
[ . . . ]

raco test: /nix/store/zh26nxh5mkjydipardvpjgzlmn10gij4-fractalide-env/share/racket/pkgs/fractalide/modules/rkt/rkt-fbp/agents/test/to-remove.rkt
make-directory: cannot make directory
  path: /homeless-shelter/
  system error: Permission denied; errno=13
  context...:
   (submod /nix/store/sgkv74rr7zw5idw2i7803fjy9z6vq1s6-fractalide-env/share/racket/pkgs/compiler-lib/compiler/commands/test.rkt process): [running body]
to-remove.rkt: racket test: non-zero exit: 1
raco test: /nix/store/zh26nxh5mkjydipardvpjgzlmn10gij4-fractalide-env/share/racket/pkgs/fractalide/modules/rkt/rkt-fbp/agents/test.rkt
make-directory: cannot make directory
  path: /homeless-shelter/
  system error: Permission denied; errno=13
  context...:
   (submod /nix/store/sgkv74rr7zw5idw2i7803fjy9z6vq1s6-fractalide-env/share/racket/pkgs/compiler-lib/compiler/commands/test.rkt process): [running body]
test.rkt: racket test: non-zero exit: 1
94/94 test failures
builder for '/nix/store/0rkwp6nfdh82cqhvdqj2amy67xm1mx1b-fractalide-tests.drv' failed with exit code 1
```

When running in userspace using the compiled derivations:

```
pkgs$ $(nix-build -A fractalide-tests-pkg.env)/bin/racket -l- raco test \
  $(nix-build -A fractalide.env)/share/racket/pkgs/*/modules/rkt/rkt-fbp/agents

[ . . . ]
raco test: "/nix/store/g7wnkwf0971q271m8zw9024w0pknm32r-fractalide-env/share/racket/pkgs/fractalide/modules/rkt/rkt-fbp/agents/gui/button.rkt"
standard-module-name-resolver: collection not found
  for module path: fractalide/modules/rkt/rkt-fbp/agent
  collection: "fractalide/modules/rkt/rkt-fbp"
  in collection directories:
   /nix/store/8b2ycliakg6zsisbqcihfs9wlzgpdgsg-racket-minimal-6.12/share/racket/collects
   /nix/store/sgkv74rr7zw5idw2i7803fjy9z6vq1s6-fractalide-env/share/racket/collects
   /nix/store/awln7h928ksjic6ppygl9mkr3dp8ccgb-base-env/share/racket/collects
[ . . . ]
   ... [129 additional linked and package directories]
  context...:
   show-collection-err
   standard-module-name-resolver
   /nix/store/g7wnkwf0971q271m8zw9024w0pknm32r-fractalide-env/share/racket/pkgs/fractalide/modules/rkt/rkt-fbp/agents/gui/button.rkt: [traversing imports]
   (submod /nix/store/sgkv74rr7zw5idw2i7803fjy9z6vq1s6-fractalide-env/share/racket/pkgs/compiler-lib/compiler/commands/test.rkt process): [running body]
button.rkt: racket test: non-zero exit: 1
```

Fractalide needs to be in the racket context too, for the dependencies
of the tests. The fractalide collection is required. We need to create
a derivation with both fractalide and compiler-lib on top.
  • Loading branch information
clacke committed Aug 15, 2018
1 parent 17c9b4f commit 14bef8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,17 @@ pkgs {
) ./..;
};

# fractalide/racket2nix#78 workaround
# This simple switcheroo only works because fractalide happens to depend on all of
# compiler-lib's dependencies.
fractalide-tests-pkg = fractalide.racketDerivation.override { src = fetchurl {
url = "https://download.racket-lang.org/releases/6.12/pkgs/compiler-lib.zip";
sha1 = "8921c26c498e920aca398df7afb0ab486636430f";
}; };
# compiler-lib's dependencies (because it happens to depend on compiler-lib).
fractalide-tests-pkg = fractalide.overrideRacketDerivation (oldAttrs: {
src = fetchurl {
url = "https://download.racket-lang.org/releases/6.12/pkgs/compiler-lib.zip";
sha1 = "8921c26c498e920aca398df7afb0ab486636430f";
};
# Remove compiler-lib from its own dependencies.
racketBuildInputs = builtins.filter (input: input.name != "compiler-lib") oldAttrs.racketBuildInputs;
});

fractalide-tests = self.runCommand "fractalide-tests" {
buildInputs = [ fractalide-tests-pkg.env ];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/racket2nix/bump-racket2nix.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash findutils gawk git
#! nix-shell -i bash -p bash findutils gawk git nix-prefetch-git

set -e
set -u
Expand Down

0 comments on commit 14bef8b

Please sign in to comment.