Skip to content

Commit

Permalink
Merge pull request #4154 from commercialhaskell/callen/4086-deprecate…
Browse files Browse the repository at this point in the history
…-warning-ghcjs

Warning about GHCJS use when constructing a build plan
  • Loading branch information
bitemyapp authored Jul 16, 2018
2 parents 839dbd5 + ddef05c commit 7843a30
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Release notes:

Major changes:

* `GHCJS` support is being deprecated after the next major Stack release. At time of writing the upcoming release is 1.8. A warning notifying the user of the deprecation will be incorporated into 1.8.

Behavior changes:

* `ghc-options` from `stack.yaml` are now appended to `ghc-options` from
Expand Down
1 change: 0 additions & 1 deletion src/Stack/Init.hs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ renderStackYaml p ignoredPackages dupPackages =
, "resolver: lts-3.5"
, "resolver: nightly-2015-09-21"
, "resolver: ghc-7.10.2"
, "resolver: ghcjs-0.1.0_ghc-7.10.2"
, ""
, "The location of a snapshot can be provided as a file or url. Stack assumes"
, "a snapshot provided as a file might change, whereas a url resource does not."
Expand Down
12 changes: 12 additions & 0 deletions src/Stack/Setup/Installed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ listInstalled programsPath = do
x <- T.stripSuffix ".installed" $ T.pack $ toFilePath $ filename fp
parseToolText x

-- | See https://github.com/commercialhaskell/stack/issues/4086.
warnAboutGHCJS :: HasLogFunc env => RIO env ()
warnAboutGHCJS =
logWarn $ "Building a GHCJS project. " <> fromString ghcjsWarning

ghcjsWarning :: String
ghcjsWarning = unwords
[ "Note that GHCJS support in Stack is DEPRECATED and it will be removed "
, "in a future release of Stack."
]

getCompilerVersion
:: (HasProcessContext env, HasLogFunc env)
=> WhichCompiler
Expand All @@ -102,6 +113,7 @@ getCompilerVersion wc =
logDebug $ "GHC version is: " <> display x
return x
Ghcjs -> do
warnAboutGHCJS
logDebug "Asking GHCJS for its version"
-- Output looks like
--
Expand Down
4 changes: 2 additions & 2 deletions src/main/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,8 @@ execCmd ExecOpts {..} go@GlobalOpts{..} =
(ExecCmd cmd, args) -> return (cmd, args)
(ExecRun, args) -> getRunCmd args
(ExecGhc, args) -> getGhcCmd "" eoPackages args
-- NOTE: this won't currently work for GHCJS, because it doesn't have
-- a runghcjs binary. It probably will someday, though.
-- NOTE: This doesn't work for GHCJS, because it doesn't have
-- a runghcjs binary.
(ExecRunGhc, args) ->
getGhcCmd "run" eoPackages args
munlockFile lk -- Unlock before transferring control away.
Expand Down

0 comments on commit 7843a30

Please sign in to comment.