Skip to content

Commit

Permalink
Fix build instructions in hacking.md and justfile
Browse files Browse the repository at this point in the history
The stdenv phases don’t actually do anything (at least not anymore),
and our justfile doesn’t behave the same as our docs.

This patch removes the stdenv phases from the docs, documents our
usage of just, and makes `just setup` heed `$mesonFlags`.

Fixes NixOS#413.
Fixes NixOS#414.

Change-Id: Ieb0b2a8ae420526238b5f9a73d7849ec6919995d
  • Loading branch information
delan committed Jun 24, 2024
1 parent 21865cc commit 5d33e4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions doc/manual/src/contributing/hacking.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,19 @@ $ nix-shell -A native-clangStdenvPackages

### Building from the development shell

As always you may run [stdenv's phases by name](https://nixos.org/manual/nixpkgs/unstable/#sec-building-stdenv-package-in-nix-shell), e.g.:
You can build and test Lix with just:

```bash
$ configurePhase
$ buildPhase
$ checkPhase
$ installPhase
$ installCheckPhase
$ just setup
$ just build
$ just test --suite=check
$ just install
$ just test --suite=installcheck
```

To build manually, however, use the following:
(Check and installcheck may both be done after install, allowing you to omit the --suite argument entirely, but this is the order package.nix runs them in.)

You can also build Lix manually:

```bash
$ meson setup ./build "--prefix=$out" $mesonFlags
Expand All @@ -64,9 +66,7 @@ $ meson install -C build
$ meson test -C build --suite=installcheck
```

(Check and installcheck may both be done after install, allowing you to omit the --suite argument entirely, but this is the order package.nix runs them in.)

This will install Lix to `$PWD/outputs`, the `/bin` of which is prepended to PATH in the development shells.
In both cases, Lix will be installed to `$PWD/outputs`, the `/bin` of which is prepended to PATH in the development shells.

If the tests fail and Meson helpfully has no output for why, use the `--print-error-logs` option to `meson test`.

Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ clean:

# Prepare meson for building
setup:
meson setup build --prefix="$PWD/outputs/out"
meson setup build --prefix="$PWD/outputs/out" $mesonFlags

# Build lix
build *OPTIONS:
Expand Down

0 comments on commit 5d33e4c

Please sign in to comment.