-
Notifications
You must be signed in to change notification settings - Fork 108
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
Build with ghc(js) 9.8.2 + 9.10.1 #1093
base: develop
Are you sure you want to change the base?
Changes from 16 commits
42228f9
61853b4
df0cdc2
3381a03
730fc64
9f23d8b
961f157
b3fbfdd
e852cb2
2d46489
01308c0
9e410cb
d799ab9
bfc3126
fcf3a0a
4fb1b41
e7668b0
7de05e4
e27dcca
be031e3
508ebb8
769dd6f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,9 @@ library | |
-Wall -Werror -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O2 | ||
-fno-warn-unused-do-bind -funbox-strict-fields -fprof-auto-calls | ||
|
||
if arch(javascript) | ||
buildable: False | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems right, but I'm confused on why we didn't need a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure... |
||
|
||
executable obelisk-asset-manifest-generate | ||
default-language: Haskell2010 | ||
hs-source-dirs: src-bin | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
index-state: 2025-02-01T00:00:00Z | ||
allow-newer: all | ||
|
||
constraints: | ||
hnix-store-core < 0.7 | ||
, hnix-store-remote < 0.7 | ||
|
||
source-repository-package | ||
type: git | ||
location: https://github.com/ymeister/splitmix.git | ||
tag: fe4d9e4ec01ba7caf8053d6888ec2e7f89fad874 | ||
--sha256: 19fbwcmdmb9w34cp19r2j4qywhnjmxxdv4rwci29pzbvgbnnjdia | ||
|
||
if !arch(javascript) | ||
source-repository-package | ||
type: git | ||
location: https://github.com/mpickering/haskell-filesystem.git | ||
tag: 2eb26717e986442796d703a80869e6826a10191e | ||
subdir: system-fileio system-filepath | ||
--sha256: sha256-VDShV+gkVUooMy1OtxrFfZrTAVVhWN/Ffjd6Qq0kHNM= | ||
|
||
-- https://github.com/haskell-cryptography/HsOpenSSL/issues/93#issuecomment-2311816896 | ||
package HsOpenSSL | ||
ghc-options: -optc=-Wno-incompatible-pointer-types" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
if arch(javascript) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we pull the common ones out of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes. Wasn't aware that there could be multiple
I assume so. Didn't want to touch that as I was not 100% of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Me neither, I didn't even know we could use cabal conditionals in .project
I don't see it doing anything your cabal.project doesn't do and better. |
||
packages: | ||
./executable-config/inject | ||
./executable-config/lookup | ||
./frontend | ||
./route | ||
./tabulation | ||
else | ||
packages: | ||
./asset/manifest | ||
./asset/serve-snap | ||
./backend | ||
./command | ||
./executable-config/inject | ||
./executable-config/lookup | ||
./frontend | ||
./route | ||
./run | ||
./selftest | ||
./snap-extras | ||
./tabulation | ||
|
||
import: cabal.dependencies.project |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,10 +21,9 @@ library | |
, extra | ||
, filepath | ||
, fsnotify | ||
, git | ||
, github | ||
, here | ||
, hnix | ||
, hnix >=0.5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't see anything else in the |
||
, hpack | ||
, io-streams | ||
, lens | ||
|
@@ -39,6 +38,7 @@ library | |
, optparse-applicative | ||
, placeholders | ||
, prettyprinter | ||
, prettyprinter-compat-ansi-wl-pprint | ||
, process | ||
, reflex | ||
, reflex-fsnotify | ||
|
@@ -48,14 +48,15 @@ library | |
, text | ||
, time | ||
, transformers | ||
, unix | ||
, unix-compat | ||
, unordered-containers | ||
, utf8-string | ||
, which | ||
, yaml | ||
, nix-thunk | ||
, cli-extras | ||
|
||
exposed-modules: | ||
Obelisk.App | ||
Obelisk.Command | ||
|
@@ -68,6 +69,9 @@ library | |
Obelisk.Command.Preprocessor | ||
ghc-options: -Wall | ||
|
||
if arch(javascript) | ||
buildable: False | ||
|
||
executable ob | ||
main-is: src-bin/ob.hs | ||
build-depends: base, obelisk-command | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{-# LANGUAGE ConstraintKinds #-} | ||
{-# LANGUAGE CPP #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE FlexibleInstances #-} | ||
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | ||
|
@@ -9,11 +10,11 @@ | |
{-# LANGUAGE TemplateHaskell #-} | ||
{-# LANGUAGE TupleSections #-} | ||
{-# LANGUAGE PackageImports #-} | ||
|
||
module Obelisk.App where | ||
|
||
import Control.Lens | ||
import Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow) | ||
import Control.Monad.Fail (MonadFail) | ||
import Control.Monad.Reader (MonadIO, ReaderT (..), ask, runReaderT) | ||
import Control.Monad.Writer (WriterT) | ||
import Control.Monad.State (StateT) | ||
|
@@ -25,16 +26,14 @@ import Control.Monad.Log (MonadLog) | |
import Cli.Extras.Types | ||
import "nix-thunk" Nix.Thunk (NixThunkError) | ||
|
||
#if !MIN_VERSION_base(4,18,0) | ||
import Control.Monad.Fail (MonadFail) | ||
#endif | ||
|
||
import Cli.Extras | ||
( CliConfig | ||
, CliLog | ||
, CliThrow | ||
, CliT (..) | ||
, ProcessFailure | ||
Comment on lines
-29
to
-33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Huh, were these all just unused? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess? |
||
( ProcessFailure | ||
, AsProcessFailure (..) | ||
, AsUnstructuredError (..) | ||
, HasCliConfig | ||
, Output | ||
, runCli | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
{-# LANGUAGE CPP #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE LambdaCase #-} | ||
{-# LANGUAGE MultiParamTypeClasses #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
{-# LANGUAGE ScopedTypeVariables #-} | ||
{-# LANGUAGE TupleSections #-} | ||
{-# LANGUAGE PackageImports #-} | ||
|
||
module Obelisk.Command where | ||
|
||
import Control.Monad.IO.Class (MonadIO, liftIO) | ||
|
@@ -16,17 +18,22 @@ import qualified Data.List.NonEmpty as NonEmpty | |
import qualified Data.Map as Map | ||
import qualified Data.Text as T | ||
import Data.Traversable (for) | ||
import GHC.IO.Encoding.Types (textEncodingName) | ||
import Network.Socket (PortNumber) | ||
import Options.Applicative | ||
import Options.Applicative.Help.Pretty (text, (<$$>)) | ||
import System.Directory | ||
import System.Environment | ||
import System.FilePath | ||
import System.Exit | ||
import qualified System.Info | ||
import System.IO (hIsTerminalDevice, Handle, stdout, stderr, hGetEncoding, hSetEncoding, mkTextEncoding) | ||
import GHC.IO.Encoding.Types (textEncodingName) | ||
import System.Process (rawSystem) | ||
import Network.Socket (PortNumber) | ||
|
||
#if MIN_VERSION_optparse_applicative(0,18,0) | ||
import Text.PrettyPrint.ANSI.Leijen (text, (<$$>)) | ||
#else | ||
import Options.Applicative.Help.Pretty (text, (<$$>)) | ||
#endif | ||
|
||
import Obelisk.App | ||
import Obelisk.Command.Deploy | ||
|
@@ -229,6 +236,9 @@ thunkConfig = ThunkConfig | |
thunkUpdateConfig :: Parser ThunkUpdateConfig | ||
thunkUpdateConfig = ThunkUpdateConfig | ||
<$> optional (strOption (long "branch" <> metavar "BRANCH" <> help "Use the given branch when looking for the latest revision")) | ||
#if MIN_VERSION_nix_thunk(0,7,1) | ||
<*> optional (strOption (short 'r' <> long "rev" <> metavar "REVISION" <> help "Update to this specific revision")) | ||
#endif | ||
Comment on lines
+239
to
+241
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I backported for now, but shouldn't we simply be importing all these parsers from nix-thunk? |
||
<*> thunkConfig | ||
|
||
thunkPackConfig :: Parser ThunkPackConfig | ||
|
@@ -288,17 +298,11 @@ interpretOpts :: Parser [(FilePath, Interpret)] | |
interpretOpts = many | ||
( (, Interpret_Interpret) <$> | ||
strOption (common <> long "interpret" <> help | ||
"Don't pre-build packages found in DIR when constructing the package database. The default behavior is \ | ||
\'--interpret <project-root>', which will load everything which is unpacked into GHCi. \ | ||
\ Use --interpret and --no-interpret multiple times to add or remove multiple trees \ | ||
\ from the environment. Settings for right-most directories will \ | ||
\ override settings for any identical directories given earlier." | ||
"Don't pre-build packages found in DIR when constructing the package database. The default behavior is '--interpret <project-root>', which will load everything which is unpacked into GHCi. Use --interpret and --no-interpret multiple times to add or remove multiple trees from the environment. Settings for right-most directories will override settings for any identical directories given earlier." | ||
) | ||
<|> (, Interpret_NoInterpret) <$> | ||
strOption (common <> long "no-interpret" <> help | ||
"Make packages found in DIR available in the package database (but only when they are used dependencies). \ | ||
\ This will build the packages in DIR before loading GHCi. \ | ||
\See help for --interpret for how the two options are related." | ||
"Make packages found in DIR available in the package database (but only when they are used dependencies). This will build the packages in DIR before loading GHCi. See help for --interpret for how the two options are related." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we know why these lines were split that way before? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think multi-line string thing broke or changed is some way in newer ghc versions. Couldn't compile without this change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aaah it's some interaction of multiline strings with |
||
) | ||
) | ||
where | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{-# LANGUAGE CPP #-} | ||
{-# LANGUAGE DeriveGeneric #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE LambdaCase #-} | ||
|
@@ -7,6 +8,7 @@ | |
{-# LANGUAGE ScopedTypeVariables #-} | ||
{-# LANGUAGE PackageImports #-} | ||
{-# LANGUAGE ViewPatterns #-} | ||
|
||
{-| | ||
Description: | ||
Implementation of the CLI deploy commands. Deployment is done by intializing | ||
|
@@ -16,7 +18,6 @@ | |
-} | ||
module Obelisk.Command.Deploy where | ||
|
||
import Control.Applicative (liftA2) | ||
import Control.Lens | ||
import Control.Monad | ||
import Control.Monad.Catch (Exception (displayException), MonadThrow, bracket, throwM, try) | ||
|
@@ -47,12 +48,17 @@ import qualified Nix.Expr.Shorthands as Nix | |
import Prettyprinter (layoutCompact) | ||
import Prettyprinter.Render.String (renderString) | ||
|
||
#if !MIN_VERSION_base(4,18,0) | ||
import Control.Applicative (liftA2) | ||
#endif | ||
|
||
import Obelisk.App (MonadObelisk, wrapNixThunkError) | ||
import Obelisk.Command.Nix | ||
import Obelisk.Command.Project | ||
import Obelisk.Command.Utils | ||
|
||
import "nix-thunk" Nix.Thunk | ||
import "nix-thunk" Nix.Thunk.Internal (prettyReadThunkError) | ||
import Cli.Extras | ||
|
||
-- | Options passed to the `init` verb | ||
|
@@ -88,8 +94,14 @@ deployInit deployOpts root = do | |
failWith [i|Deploy directory ${deployDir} should not be the same as project root.|] | ||
thunkPtr <- wrapNixThunkError (readThunk root) >>= \case | ||
Right (ThunkData_Packed _ ptr) -> return ptr | ||
_ -> wrapNixThunkError (getThunkPtr CheckClean_NotIgnored root Nothing) | ||
_ -> wrapNixThunkError $ compat $ getThunkPtr CheckClean_NotIgnored root Nothing | ||
deployInit' thunkPtr deployOpts | ||
where | ||
#if MIN_VERSION_nix_thunk(0,7,1) | ||
compat = fmap $ \(ptr, _isWorktree) -> ptr | ||
#else | ||
compat = id | ||
#endif | ||
Comment on lines
96
to
+104
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we should treat a worktree dir the same as a standalone unpacked dir? |
||
|
||
-- | The preamble in 'deployInit' provides deployInit' with a 'ThunkPtr' that it can install in | ||
-- the staging directory. | ||
|
@@ -178,7 +190,7 @@ deployPush deployPath builders = do | |
checkGitCleanStatus srcPath True >>= \case | ||
True -> wrapNixThunkError $ packThunk (ThunkPackConfig False (ThunkConfig Nothing)) srcPath | ||
False -> failWith $ T.pack $ "ob deploy push: ensure " <> srcPath <> " has no pending changes and latest is pushed upstream." | ||
Left err -> failWith $ "ob deploy push: couldn't read src thunk: " <> T.pack (show err) | ||
Left err -> failWith $ "ob deploy push: couldn't read src thunk: " <> prettyReadThunkError err | ||
let version = show . _thunkRev_commit $ _thunkPtr_rev thunkPtr | ||
let moduleFile = deployPath </> "module.nix" | ||
moduleFileExists <- liftIO $ doesFileExist moduleFile | ||
|
@@ -270,8 +282,14 @@ fi | |
|
||
-- | Update the source thunk in the staging directory to the HEAD of the branch. | ||
deployUpdate :: MonadObelisk m => FilePath -> m () | ||
deployUpdate deployPath = wrapNixThunkError $ | ||
updateThunkToLatest (ThunkUpdateConfig Nothing (ThunkConfig Nothing)) (deployPath </> "src") | ||
deployUpdate deployPath = wrapNixThunkError $ updateThunkToLatest cfg (deployPath </> "src") | ||
where | ||
cfg = ThunkUpdateConfig | ||
Nothing | ||
#if MIN_VERSION_nix_thunk(0,7,1) | ||
Nothing | ||
#endif | ||
(ThunkConfig Nothing) | ||
|
||
-- | Platforms that we deploy obelisk artefacts to. | ||
data PlatformDeployment = Android | IOS | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that git wouldn't ignore
lib/cabal.project
forcabal
/haskell.nix
builds.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not remove then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well somebody put it there for a reason I assume, if it causes problems in the future people would at least see a possible solution there.