diff --git a/beacon_chain/winservice.nim b/beacon_chain/winservice.nim index acfcf042a..e5a131f9e 100644 --- a/beacon_chain/winservice.nim +++ b/beacon_chain/winservice.nim @@ -47,6 +47,7 @@ when defined(windows): SERVICE_CONTROL_INTERROGATE = 4 SERVICE_ACCEPT_STOP = 1 ERROR_INVALID_PARAMETER = 87 + ERROR_INVALID_ACCESS = 12 ERROR_BAD_CONFIGURATION = 1610 NO_ERROR = 0 @@ -155,11 +156,15 @@ when defined(windows): reportServiceStatus(SERVICE_STOPPED, ERROR_BAD_CONFIGURATION, 0) quit QuitFailure - argEntryPoint(config) - - info "Service thread stopped" - reportServiceStatus(SERVICE_STOPPED, NO_ERROR, 0) + try: + argEntryPoint(config) + info "Service thread stopped" # we have to report back when we stopped! + reportServiceStatus(SERVICE_STOPPED, NO_ERROR, 0) + except CatchableError: + info "Service thread crashed" + # we have to report back when we stopped! + reportServiceStatus(SERVICE_STOPPED, ERROR_INVALID_ACCESS, 0) let serviceName = newWideCString(argServiceName) diff --git a/nix/checksums.nix b/nix/checksums.nix index 2c8f2c54c..d79345d24 100644 --- a/nix/checksums.nix +++ b/nix/checksums.nix @@ -8,5 +8,5 @@ in pkgs.fetchFromGitHub { repo = "checksums"; rev = tools.findKeyValue "^ +ChecksumsStableCommit = \"([a-f0-9]+)\"$" sourceFile; # WARNING: Requires manual updates when Nim compiler version changes. - hash = "sha256-RB2IXs2xcfYHhV9d7l1mtHW51mtsrqrYRapSoTikvHw="; + hash = "sha256-Bm5iJoT2kAvcTexiLMFBa9oU5gf7d4rWjo3OiN7obWQ="; } diff --git a/nix/default.nix b/nix/default.nix index a444329eb..a84a538e2 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -59,10 +59,13 @@ in stdenv.mkDerivation rec { pushd vendor/nimbus-build-system/vendor/Nim mkdir dist cp -r ${callPackage ./nimble.nix {}} dist/nimble - cp -r ${callPackage ./checksums.nix {}} dist/checksums + chmod 777 -R dist/nimble + mkdir -p dist/nimble/dist + cp -r ${callPackage ./sat.nix {}} dist/nimble/dist/sat + cp -r ${callPackage ./checksums.nix {}} dist/checksums # need both + cp -r ${callPackage ./checksums.nix {}} dist/nimble/dist/checksums cp -r ${callPackage ./csources.nix {}} csources_v2 chmod 777 -R dist/nimble csources_v2 - sed -i 's/isGitRepo(destDir)/false/' tools/deps.nim popd ''; diff --git a/nix/nimble.nix b/nix/nimble.nix index 8eec4b414..5343aaa81 100644 --- a/nix/nimble.nix +++ b/nix/nimble.nix @@ -8,5 +8,5 @@ in pkgs.fetchFromGitHub { repo = "nimble"; rev = tools.findKeyValue "^ +NimbleStableCommit = \"([a-f0-9]+)\".+" sourceFile; # WARNING: Requires manual updates when Nim compiler version changes. - hash = "sha256-qJcDKnc+9iUvYrZCMUbBbws+Qqa9vmWyCRsvOUEmq8U="; + hash = "sha256-sa0irAZjQRZLduEMBPf7sHlY1FigBJTR/vIH4ihii/w="; } diff --git a/nix/sat.nix b/nix/sat.nix new file mode 100644 index 000000000..ca6403f68 --- /dev/null +++ b/nix/sat.nix @@ -0,0 +1,12 @@ +{ pkgs ? import { } }: + +let + tools = pkgs.callPackage ./tools.nix {}; + sourceFile = ../vendor/nimbus-build-system/vendor/Nim/koch.nim; +in pkgs.fetchFromGitHub { + owner = "nim-lang"; + repo = "sat"; + rev = tools.findKeyValue "^ +SatStableCommit = \"([a-f0-9]+)\"$" sourceFile; + # WARNING: Requires manual updates when Nim compiler version changes. + hash = "sha256-JFrrSV+mehG0gP7NiQ8hYthL0cjh44HNbXfuxQNhq7c="; +} diff --git a/nix/shell.nix b/nix/shell.nix index 5cacda064..8b5fe3c51 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -22,6 +22,7 @@ in pkgs.mkShell { lsof # for killing processes by port killall # for killing processes manually curl # for working with the node APIs + jq # for parsing beacon API for LC start openjdk # for running web3signer mkdocs-python diff --git a/vendor/nimbus-build-system b/vendor/nimbus-build-system index 741274439..c3241765e 160000 --- a/vendor/nimbus-build-system +++ b/vendor/nimbus-build-system @@ -1 +1 @@ -Subproject commit 741274439ce72162ab3c740e7c0ef624d32725f9 +Subproject commit c3241765e3896a06ed372dddc9dd6e3c36fae8f6