-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nix: pin nixpkgs, pin clang 4.0, run test suite
- Loading branch information
Showing
5 changed files
with
74 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/6a0155d2b7cb10aef1c63b654a2b172d78fd89b4.tar.gz) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# default.nix - define the build environment for RaptorJIT | ||
# | ||
# This file can be used by 'nix-build' or 'nix-shell' to create a | ||
# pristine build environment with precisely the expected software in | ||
# $PATH. This makes it possible to build raptorjit in the same way on | ||
# any machine. | ||
# | ||
# See README.md for usage instructions. | ||
|
||
{ pkgs ? (import ./pkgs.nix) {} | ||
, source ? ./. | ||
, version ? "dev" }: | ||
|
||
with pkgs; | ||
with llvmPackages_4.stdenv; # Use clang 4.0 | ||
|
||
mkDerivation rec { | ||
name = "raptorjit-${version}"; | ||
inherit version; | ||
src = source; | ||
buildInputs = [ luajit ]; # LuaJIT to bootstrap DynASM | ||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp src/luajit $out/bin/raptorjit | ||
''; | ||
|
||
enableParallelBuilding = true; # Do 'make -j' | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ pkgs, raptorjit, source, name, args }: | ||
|
||
pkgs.stdenv.mkDerivation { | ||
name = "test-${name}"; | ||
src = source; | ||
buildInputs = [ raptorjit ]; | ||
phases = "unpackPhase buildPhase"; | ||
buildPhase = '' | ||
mkdir $out | ||
cd testsuite/test | ||
echo "Running testsuite with ${args} and output to $out/log.txt" | ||
raptorjit ${args} test.lua 2>&1 > $out/log.txt | ||
result=$? | ||
echo -n "*** TEST RESULTS (${args}): " | ||
tail -1 $out/log.txt | ||
exit $result | ||
''; | ||
} | ||
|