-
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 all 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: github-action | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ghc: ['8.6', '8.8', '8.10', '9.0', '9.2', '9.4', '9.6', '9.8', '9.10'] | ||
os: ['ubuntu-latest', 'macos-13'] # https://github.com/haskell-actions/setup/issues/77 | ||
runs-on: ${{ matrix.os }} | ||
|
||
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: haskell-actions/setup@v2 | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
- name: Cache | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-cabal | ||
with: | ||
path: ~/.cabal | ||
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-${{ matrix.ghc }}-build- | ||
${{ runner.os }}-${{ matrix.ghc }}- | ||
${{ runner.os }} | ||
|
||
- name: Install system packages (linux) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt install libsodium-dev | ||
|
||
- name: Install system packages (macos) | ||
if: matrix.os == 'macos-13' | ||
run: | | ||
brew update | ||
brew install libsodium | ||
|
||
- name: Set up cabal project file for CI | ||
run: cd lib && cp cabal.project.ci cabal.project | ||
|
||
- name: Install dependencies | ||
run: | | ||
cabal update | ||
cd lib && cabal build --only-dependencies --enable-tests --enable-benchmarks all | ||
- name: Build obelisk libraries | ||
run: cd lib && cabal build --enable-tests --enable-benchmarks all | ||
- name: Run tests | ||
run: cd lib && cabal test all |
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,16 @@ | ||
index-state: 2025-02-01T00:00:00Z | ||
allow-newer: hnix:*, hnix-store-core:algebraic-graphs, lens-family-th:template-haskell | ||
|
||
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 | ||
|
||
-- 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,18 @@ | ||
packages: | ||
./executable-config/inject | ||
./executable-config/lookup | ||
./frontend | ||
./route | ||
./tabulation | ||
|
||
if !arch(javascript) | ||
packages: | ||
./asset/manifest | ||
./asset/serve-snap | ||
./backend | ||
./command | ||
./run | ||
./selftest | ||
./snap-extras | ||
|
||
import: cabal.dependencies.project |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
packages: | ||
./executable-config/inject | ||
./executable-config/lookup | ||
./frontend | ||
./route | ||
./tabulation | ||
|
||
if !arch(javascript) | ||
packages: | ||
./asset/manifest | ||
./asset/serve-snap | ||
./backend | ||
-- ./command | ||
./run | ||
-- ./selftest | ||
./snap-extras | ||
|
||
import: cabal.dependencies.project |
This file was deleted.
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 | ||
|
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.