Building quick-lint-js from source using Nix
Building quick-lint-js from source using Nix is for advanced users only. You need to install the Nix package manager if you have not already done so.
Nix uses derivation
files that contain instructions for automation on how to build and
package software. The dist/
folder contains such
derivations for quick-lint-js and can be used to download dependencies
and build it.
0. Prepare environment
The derivations in dist/
contain the necessary dependencies
to build quick-lint-js using cmake and ninja. We can use
nix-shell
to download those dependencies and make them
available for development.
nix-shell dist/nix/shell.nix
While it seems this does not do anything, you will be dropped in a shell that has the build tools available necessary to build quick-lint-js. Once you exit this shell, the downloaded dependencies will not be available anymore. You can use the above command again to re-create a shell with the build tools available at any time.
1. Configure
After running above command, we configure the build environment:
cmakeConfigurePhase
This will create a build/
folder in the project folder and
changes the current directory to it.
2. Build
To build quick-lint-js, make sure you are in the
build/
folder; the previous command should have already put
you there. To start the build using ninja, you use:
ninjaBuildPhase
3. Run
After building, the binary is available as quick-lint-js
in
the build folder:
./quick-lint-js --help
To run the tests, execute the test binary in the build directory:
./test/quick-lint-js-test