-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace ocamlyacc with cpspg #165
base: master
Are you sure you want to change the base?
Changes from all commits
e84d30a
48fa1b9
f8cef78
838baaf
624e1b8
3566295
3012c5b
f89a6e3
c623eba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
inputs = { | ||
opam-nix.url = "github:tweag/opam-nix"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
nixpkgs.follows = "opam-nix/nixpkgs"; | ||
cpspg.url = "github:adampsz/cpspg"; | ||
cpspg.inputs.opam-nix.follows = "opam-nix"; | ||
}; | ||
outputs = { self, flake-utils, opam-nix, nixpkgs, cpspg }@inputs: | ||
let package = "dbl"; | ||
in flake-utils.lib.eachSystem ["x86_64-linux"] (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
on = opam-nix.lib.${system}; | ||
scope = | ||
on.buildDuneProject { } package ./. { ocaml-system = "*"; }; | ||
overlay = final: prev: | ||
{ | ||
${package} = prev.${package}.overrideAttrs | ||
(oa: { nativeBuildInputs = oa.nativeBuildInputs ++ [ cpspg.packages.${system}.default ]; }); | ||
}; | ||
in rec { | ||
legacyPackages = scope.overrideScope overlay; | ||
|
||
packages.default = self.legacyPackages.${system}.${package}; | ||
devShells.default = with pkgs; pkgs.mkShell { | ||
buildInputs = [ | ||
cpspg.packages.${system}.default | ||
# Source file formatting | ||
nixpkgs-fmt | ||
ocamlformat | ||
# For `dune build --watch ...` | ||
fswatch | ||
# For `dune build @doc` | ||
ocamlPackages.odoc | ||
# OCaml editor support | ||
ocamlPackages.ocaml-lsp | ||
# Nicely formatted types on hover | ||
ocamlPackages.ocamlformat-rpc-lib | ||
# Fancy REPL thing | ||
ocamlPackages.utop | ||
]; | ||
}; | ||
}); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
#!/usr/bin/env bash | ||
if ! [ -n "$1" ] || ! [ -n "$2" ]; then | ||
echo "USAGE: ./test.sh PROGRAM TEST_SUITE" | ||
echo "USAGE: ./test.sh BINARY TEST_SUITE" | ||
exit 1 | ||
fi | ||
|
||
if ! dune build; then | ||
exit 1 | ||
fi | ||
# if ! dune build; then | ||
# exit 1 | ||
# fi | ||
|
||
export DBL_LIB="lib/" | ||
|
||
TIMEOUT=1.0 | ||
|
||
binary="_build/default/src/$1.exe" | ||
binary=$1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see a minor problem with this change. When I run tests locally, I would like to use a version of dbl compiled from source on the active branch, not the one that is installed on my system. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A bit of an oversight on my part - in my dev environment, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I restored most of the original behaviour of |
||
flags="" | ||
|
||
RED='\033[0;31m' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove this line instead of commenting it out? As discussed on the last meeting, we are going to use nice features of cpspg (which are not implemented yet), so I think in the near future, we will be incompatible with ocamlyacc.