mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
Run exception handlers on SIGTERM in daml assistant (#2069)
This commit is contained in:
parent
13253d82d1
commit
75ea177e87
@ -83,7 +83,7 @@
|
||||
- DA.Sdk.Cli.System
|
||||
- DA.Sdk.Cli.Version
|
||||
- DAML.Assistant.Install.Path
|
||||
- DamlHelper.Signals
|
||||
- DA.Signals
|
||||
- Development.IDE.Core.Compile
|
||||
- Development.IDE.GHC.Compat
|
||||
- {name: ImplicitParams, within: []}
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
load("//bazel_tools:haskell.bzl", "da_haskell_binary", "da_haskell_library", "da_haskell_test")
|
||||
load("//bazel_tools/packaging:packaging.bzl", "package_app")
|
||||
load("@os_info//:os_info.bzl", "is_windows")
|
||||
|
||||
da_haskell_library(
|
||||
name = "daml-helper-lib",
|
||||
@ -29,7 +28,7 @@ da_haskell_library(
|
||||
"safe-exceptions",
|
||||
"text",
|
||||
"yaml",
|
||||
] + ([] if is_windows else ["unix"]),
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//daml-assistant:daml-project-config",
|
||||
|
@ -9,8 +9,8 @@ import System.Environment
|
||||
import System.Exit
|
||||
import System.IO
|
||||
|
||||
import DA.Signals
|
||||
import DamlHelper.Run
|
||||
import DamlHelper.Signals
|
||||
|
||||
main :: IO ()
|
||||
main =
|
||||
|
@ -7,6 +7,7 @@ module DAML.Assistant
|
||||
( main
|
||||
) where
|
||||
|
||||
import DA.Signals
|
||||
import DAML.Project.Config
|
||||
import DAML.Assistant.Types
|
||||
import DAML.Assistant.Env
|
||||
@ -30,6 +31,7 @@ import Safe
|
||||
-- | Run the assistant and exit.
|
||||
main :: IO ()
|
||||
main = displayErrors $ do
|
||||
installSignalHandlers
|
||||
builtinCommandM <- tryBuiltinCommand
|
||||
case builtinCommandM of
|
||||
Just builtinCommand -> do
|
||||
|
@ -88,7 +88,7 @@ fi
|
||||
|
||||
cat > $DAML_HOME/bin/daml-head << EOF
|
||||
#!/bin/bash
|
||||
DAML_SDK_VERSION=0.0.0 $DAML_HEAD_SDK/daml/daml "\$@"
|
||||
exec env DAML_SDK_VERSION=0.0.0 $DAML_HEAD_SDK/daml/daml "\$@"
|
||||
EOF
|
||||
chmod +x $DAML_HOME/bin/daml-head
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
load("//bazel_tools:haskell.bzl", "da_haskell_library", "da_haskell_test")
|
||||
load("@os_info//:os_info.bzl", "is_windows")
|
||||
|
||||
da_haskell_library(
|
||||
name = "da-hs-base",
|
||||
@ -50,7 +51,7 @@ da_haskell_library(
|
||||
"utf8-string",
|
||||
"uuid",
|
||||
"vector",
|
||||
],
|
||||
] + ([] if is_windows else ["unix"]),
|
||||
src_strip_prefix = "src",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
|
@ -4,7 +4,7 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
|
||||
-- | Module that turns SIGTERM into a UserInterrupt exception in Unix.
|
||||
module DamlHelper.Signals
|
||||
module DA.Signals
|
||||
( installSignalHandlers
|
||||
) where
|
||||
|
||||
@ -25,4 +25,3 @@ installSignalHandlers = do
|
||||
mainThread <- myThreadId
|
||||
void $ installHandler sigTERM (Catch $ throwTo mainThread UserInterrupt) Nothing
|
||||
#endif
|
||||
|
@ -11,3 +11,5 @@ HEAD — ongoing
|
||||
|
||||
- [daml assistant] Fix VSCode path for use if not already in PATH on mac
|
||||
- [DAML-LF] Fixed regression that produced an invalid daml-lf-archive artefact. See `#2058 <https://github.com/digital-asset/daml/issues/2058>`__.
|
||||
- [daml assistant] Kill child processes on ``SIGTERM``. This means that killing
|
||||
``daml sandbox`` will also kill the sandbox process.
|
||||
|
Loading…
Reference in New Issue
Block a user