Skip to content

Commit

Permalink
Bump ghc-ghcide (digital-asset#2936)
Browse files Browse the repository at this point in the history
  • Loading branch information
cocreature authored Sep 18, 2019
1 parent b97ef28 commit afde28f
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 16 deletions.
15 changes: 11 additions & 4 deletions 3rdparty/haskell/BUILD.ghcide
Original file line number Diff line number Diff line change
Expand Up @@ -73,30 +73,35 @@ common_flags = [
"-XTupleSections",
"-XTypeApplications",
"-XViewPatterns",
# This is a bit of a hack but it should become unnecessary with the switch to stack_snapshot
# so there is no point trying to clean it up now.
"-Iexternal/haskell_ghcide/include",
]

haskell_library(
name = "lib",
srcs = glob(["src/**/*.hs"]),
srcs = glob(["src/**/*.hs", "include/*.h"]),
deps = depends + [
hazel_library("ghc-lib"),
hazel_library("ghc-lib-parser"),
] + ([] if is_windows else [":getmodtime"]),
compiler_flags = common_flags,
compiler_flags = common_flags + ["-DGHC_LIB"],
hidden_modules = hidden,
src_strip_prefix = "src",
visibility = ["//visibility:public"],
# We need a version to make sure that the version macros get defined
version = "0.1.0",
)

haskell_library(
name = "lib-ghc",
srcs = glob(["src/**/*.hs"]),
srcs = glob(["src/**/*.hs", "include/*.h"]),
deps = depends + [
hazel_library("ghc"),
hazel_library("ghc-boot"),
hazel_library("ghc-boot-th"),
] + ([] if is_windows else [":getmodtime"]),
compiler_flags = common_flags + ["-DGHC_STABLE"],
compiler_flags = common_flags,
hidden_modules = hidden,
# Override the -hide-package flags defined in WORKSPACE
# -hide-package=ghc-boot-th -hide-package=ghc-boot
Expand All @@ -106,6 +111,8 @@ haskell_library(
],
src_strip_prefix = "src",
visibility = ["//visibility:public"],
# We need a version to make sure that the version macros get defined
version = "0.1.0",
)

haskell_library(
Expand Down
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,8 @@ hazel_repositories(
) + hazel_github_external(
"mpickering",
"hie-bios",
"7a75f520b2e7a482440edd023be8e267a0fa153f",
"782469b30bb06cf26873e1c84bd58c8427020ff5777f4ef9d84c75cd26e3ea23",
"68c662ea1d0e7095ccf2a4e3d393fc524e769bfe",
"065e54a01103c79c20a7e9ac3967cda9bdc027579bf1d0ca9a9d8023ff46dfb9",
patch_args = ["-p1"],
patches = ["@com_github_digital_asset_daml//bazel_tools:haskell-hie-bios.patch"],
) +
Expand Down Expand Up @@ -677,7 +677,7 @@ hazel_custom_package_github(
strip_prefix = "wai-app-static",
)

GHCIDE_REV = "44b11667d8593ae84c48ca88e96f4f227deec096"
GHCIDE_REV = "a162e81aa306c8efe2be3ce0d591f46abd5f88e4"

# We need a custom build file to depend on ghc-lib and ghc-lib-parser
hazel_custom_package_github(
Expand Down
35 changes: 35 additions & 0 deletions bazel_tools/haskel-hie-bios.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/src/HIE/Bios/Cradle.hs b/src/HIE/Bios/Cradle.hs
index 8ca8251..672255e 100644
--- a/src/HIE/Bios/Cradle.hs
+++ b/src/HIE/Bios/Cradle.hs
@@ -146,10 +146,10 @@ cabalCradle wdir mc =
}

cabalWrapper :: String
-cabalWrapper = $(embedStringFile "wrappers/cabal")
+cabalWrapper = $(embedStringFile "external/haskell_hie__bios/wrappers/cabal")

cabalWrapperHs :: String
-cabalWrapperHs = $(embedStringFile "wrappers/cabal.hs")
+cabalWrapperHs = $(embedStringFile "external/haskell_hie__bios/wrappers/cabal.hs")

processCabalWrapperArgs :: String -> Maybe [String]
processCabalWrapperArgs args =
@@ -221,7 +221,7 @@ stackCradle wdir =

-- Same wrapper works as with cabal
stackWrapper :: String
-stackWrapper = $(embedStringFile "wrappers/cabal")
+stackWrapper = $(embedStringFile "external/haskell_hie__bios/wrappers/cabal")

stackAction :: FilePath -> FilePath -> IO (ExitCode, String, [String])
stackAction work_dir fp = do
@@ -272,7 +272,7 @@ rulesHaskellCradle wdir =


bazelCommand :: String
-bazelCommand = $(embedStringFile "wrappers/bazel")
+bazelCommand = $(embedStringFile "external/haskell_hie__bios/wrappers/bazel")

rulesHaskellAction :: FilePath -> FilePath -> IO (ExitCode, String, [String])
rulesHaskellAction work_dir fp = do
18 changes: 9 additions & 9 deletions bazel_tools/haskell-hie-bios.patch
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
diff --git a/src/HIE/Bios/Cradle.hs b/src/HIE/Bios/Cradle.hs
index 291a706..7a37977 100644
index 8ca8251..672255e 100644
--- a/src/HIE/Bios/Cradle.hs
+++ b/src/HIE/Bios/Cradle.hs
@@ -125,10 +125,10 @@ cabalCradle wdir mc = do
@@ -146,10 +146,10 @@ cabalCradle wdir mc =
}

cabalWrapper :: String
-cabalWrapper = $(embedStringFile "wrappers/cabal")
+cabalWrapper = $(embedStringFile "external/haskell_hie__bios/wrappers/cabal")

cabalWrapperBat :: String
-cabalWrapperBat = $(embedStringFile "wrappers/cabal.bat")
+cabalWrapperBat = $(embedStringFile "external/haskell_hie__bios/wrappers/cabal.bat")
cabalWrapperHs :: String
-cabalWrapperHs = $(embedStringFile "wrappers/cabal.hs")
+cabalWrapperHs = $(embedStringFile "external/haskell_hie__bios/wrappers/cabal.hs")

cabalAction :: FilePath -> Maybe String -> FilePath -> IO (ExitCode, String, [String])
cabalAction work_dir mc _fp = do
@@ -179,7 +179,7 @@ stackCradle wdir =
processCabalWrapperArgs :: String -> Maybe [String]
processCabalWrapperArgs args =
@@ -221,7 +221,7 @@ stackCradle wdir =

-- Same wrapper works as with cabal
stackWrapper :: String
Expand All @@ -24,7 +24,7 @@ index 291a706..7a37977 100644

stackAction :: FilePath -> FilePath -> IO (ExitCode, String, [String])
stackAction work_dir fp = do
@@ -228,7 +228,7 @@ rulesHaskellCradle wdir = do
@@ -272,7 +272,7 @@ rulesHaskellCradle wdir =


bazelCommand :: String
Expand Down
1 change: 1 addition & 0 deletions compiler/damlc/daml-opts/daml-opts/DA/Daml/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ toCompileOpts options@Options{..} reportProgress =
, optReportProgress = reportProgress
, optLanguageSyntax = "daml"
, optNewColonConvention = True
, optDefer = Ghcide.IdeDefer False
}
where
toRenaming aliases = ModRenaming False [(GHC.mkModuleName mod, GHC.mkModuleName alias) | (mod, alias) <- aliases]
Expand Down

0 comments on commit afde28f

Please sign in to comment.