Skip to content
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

static binary on lts-17 #1

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build repl test release help
.PHONY: build repl test release static help

.DEFAULT_GOAL = help

Expand Down
15 changes: 7 additions & 8 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,26 @@
}:
let
cabalPackageName = "pid1";
compiler = "ghc844"; # matching stack.yaml
compiler = "ghc8104"; # matching stack.yaml

# Pin static-haskell-nix version.
static-haskell-nix =
if builtins.pathExists ../.in-static-haskell-nix
then toString ../. # for the case that we're in static-haskell-nix itself, so that CI always builds the latest version.
# Update this hash to use a different `static-haskell-nix` version:
else fetchTarball https://github.com/nh2/static-haskell-nix/archive/95fa110091dff2bf6dace3921c18a26c264d776e.tar.gz;
else fetchTarball https://github.com/nh2/static-haskell-nix/archive/57147ba740363712f589d24dfa005c8c7f6d1056.tar.gz;

# Pin nixpkgs version
# By default to the one `static-haskell-nix` provides, but you may also give
# your own as long as it has the necessary patches, using e.g.
pkgs = import (fetchTarball https://github.com/nixos/nixpkgs/archive/ca3531850844e185d483fb878fcd00c6b44069e5.tar.gz) {};
# pkgs = import "${static-haskell-nix}/nixpkgs.nix";
# pkgs = import (import ./nix/sources.nix).nixpkgs {};

# pkgs = import (fetchTarball https://github.com/nh2/nixpkgs/archive/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa123.tar.gz) {};
pkgs = import "${static-haskell-nix}/nixpkgs.nix";

stack2nix-script = import "${static-haskell-nix}/static-stack2nix-builder/stack2nix-script.nix" {
inherit pkgs;
inherit compiler;
stack-project-dir = toString ./.; # where stack.yaml is
hackageSnapshot = "2020-02-24T00:00:00Z"; # pins e.g. extra-deps without hashes or revisions
hackageSnapshot = "2021-07-11T00:00:00Z"; # pins e.g. extra-deps without hashes or revisions
};

static-stack2nix-builder = import "${static-haskell-nix}/static-stack2nix-builder/default.nix" {
Expand Down Expand Up @@ -64,7 +63,7 @@ let

in
{
inherit static_package;
static_package = static-stack2nix-builder.static_package;
inherit fullBuildScript;
# For debugging:
inherit stack2nix-script;
Expand Down
1 change: 1 addition & 0 deletions src/System/Process/PID1.hs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ runAsPID1 cmd args env' timeout = do
case p_ of
ClosedHandle e -> assert False (exitWith e)
OpenHandle pid -> return pid
OpenExtHandle{} -> error "OpenExtHandle is a Windows concept, and pid1 is not designed to run on that"

_ <- forkIO $ do
takeMVar killChildrenVar
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# resolver:
# name: custom-snapshot
# location: "./custom-snapshot.yaml"
resolver: lts-12.26
resolver: lts-17.15

# User packages to be built.
# Various formats can be used as shown in the example below.
Expand Down