Skip to content

Commit

Permalink
Merge remote-tracking branch 'obsidiansystems/develop' into dependent…
Browse files Browse the repository at this point in the history
…-encoder
  • Loading branch information
alexfmpe committed Jan 4, 2023
2 parents 78aea86 + 0d63982 commit 46ba319
Show file tree
Hide file tree
Showing 20 changed files with 167 additions and 126 deletions.
8 changes: 7 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ This project's release branch is `master`. This log is written from the perspect

## Unreleased

* Update reflex-platform to yet unreleased version with GHC 8.10.
* Update reflex-platform to yet unreleased version with GHC 8.10 and nixpkgs 21.05
\[Update note once release is cut.\]

* Documentation
* [#913](https://github.com/obsidiansystems/obelisk/pull/913): Add haddocks to `Obelisk.Command.Deploy`
* [#919](https://github.com/obsidiansystems/obelisk/pull/919): Document useful command for testing Obelisk branches to CONTRIBUTING.md
* [#931](https://github.com/obsidiansystems/obelisk/pull/931): For `ob deploy init`, command-line option `--check-known-host` corrected in readme, caveat added for multiple matching host-keypairs.
* building
* [#1004](https://github.com/obsidiansystems/obelisk/pull/1004): Fix closure compiler sometimes crashing. Similar to #956, but for when it tries to report errors. (see: [closure-compiler#3720](https://github.com/google/closure-compiler/issues/3720))
* [#956](https://github.com/obsidiansystems/obelisk/pull/956): Squelch closure-compiler warnings. They are not very helpful and can cause issues (see: [closure-compiler#3720](https://github.com/google/closure-compiler/issues/3720))
* nix
* [#889](https://github.com/obsidiansystems/obelisk/pull/889): Remove override of `acme` module that pinned it to the version in `nixpkgs-20.03`. This is used for automatic https certificate provisioning.
Expand Down Expand Up @@ -39,6 +40,11 @@ This project's release branch is `master`. This log is written from the perspect
* [#930](https://github.com/obsidiansystems/obelisk/pull/930): Add an error to `ob run` when `static` is called with a path to a file that doesn't exist
* [#940](https://github.com/obsidiansystems/obelisk/pull/940): Automatically restart the server when configuration is updated via `ob deploy push`.
* [#959](https://github.com/obsidiansystems/obelisk/pull/959): Add an error to `ob run` when `staticFilePath` is called with a path to a file that doesn't exist
* [#1011](https://github.com/obsidiansystems/obelisk/pull/1011): Update default iOS SDK to 15.0
* [#835](https://github.com/obsidiansystems/obelisk/pull/835): Rebuild static assets in fewer circumstances:
* Watch `frontend`, `backend`, `common`, and `static` instead of the project root to avoid spurious rebuilds when other files change
* Don't call `nix show-derivation` to decide whether to rebuild since it seems to do about as much work as a no-op nix-build
* Add a debug message indicating which file changes triggered the static file rebuild

## v1.0.0.0 - 2022-01-04

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,11 @@ If the `useGHC810` argument is set to false, or not given, then GHC 8.6 will be
In this section we will demonstrate how to deploy your Obelisk app to an Amazon EC2 instance. Obelisk deployments are configured for EC2 by default (see [Custom Non-EC2 Deployment](#custom-non-ec2-deployment)).
Note: Most NixOS EC2 instances should just *work* regardless of obelisk version
First create a new EC2 instance:
1. Launch a NixOS 19.09 EC2 instance (we recommend [this AMI](https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LaunchInstanceWizard:ami=ami-00a8eeaf232a74f84))
1. Launch a NixOS 22.05 EC2 instance (we recommend [this AMI](https://us-east-1.console.aws.amazon.com/ec2/home?region=us-east-1#LaunchInstances:ami=ami-0223db08811f6fb2d))
1. In the instance configuration wizard ensure that your instance has at least 1GB RAM and 10GB disk space.
1. When prompted save your AWS private key (`~/myaws.pem`) somewhere safe. We'll need it later during deployment.
1. Go to "Security Groups", select your instance's security group and under "Inbound" tab add a new rule for HTTP port 80 and HTTPS port 443.
Expand Down
1 change: 0 additions & 1 deletion all-builds.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ let
rawSkeleton = import ./skeleton { inherit obelisk; };
skeleton = withSkeletonOptions rawSkeleton {
withHoogle = true; # cache the Hoogle database for the skeleton
__withGhcide = true; # cache the ghcide build for the skeleton
};

serverSkeletonExe = rawSkeleton.exe;
Expand Down
10 changes: 4 additions & 6 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ system ? builtins.currentSystem
, profiling ? false
, iosSdkVersion ? "13.2"
, iosSdkVersion ? "15.0"
, config ? {}
, terms ? { # Accepted terms, conditions, and licenses
security.acme.acceptTerms = false;
Expand Down Expand Up @@ -90,7 +90,8 @@ in rec {
${if optimizationLevel == null then ''
ln -s "$dir/all.unminified.js" "$dir/all.js"
'' else ''
'${pkgs.closurecompiler}/bin/closure-compiler' ${if externs == null then "" else "--externs '${externs}'"} --externs '${reflex-platform.ghcjsExternsJs}' -O '${optimizationLevel}' --jscomp_warning=checkVars --warning_level=QUIET --create_source_map="$dir/all.js.map" --source_map_format=V3 --js_output_file="$dir/all.js" "$dir/all.unminified.js"
# NOTE: "--error_format JSON" avoids closurecompiler crashes when trying to report errors.
'${pkgs.closurecompiler}/bin/closure-compiler' --error_format JSON ${if externs == null then "" else "--externs '${externs}'"} --externs '${reflex-platform.ghcjsExternsJs}' -O '${optimizationLevel}' --jscomp_warning=checkVars --warning_level=QUIET --create_source_map="$dir/all.js.map" --source_map_format=V3 --js_output_file="$dir/all.js" "$dir/all.unminified.js"
echo '//# sourceMappingURL=all.js.map' >> "$dir/all.js"
''}
done
Expand Down Expand Up @@ -332,10 +333,7 @@ in rec {

shellToolOverrides = lib.composeExtensions
self.userSettings.shellToolOverrides
(if self.userSettings.__withGhcide
then (import ./haskell-overlays/ghcide.nix)
else (_: _: {})
);
(_: _: {});

project = reflexPlatformProject ({...}: self.projectConfig);
projectConfig = {
Expand Down
7 changes: 1 addition & 6 deletions dep/hnix/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
# DO NOT HAND-EDIT THIS FILE
import ((import <nixpkgs> {}).fetchFromGitHub (
let json = builtins.fromJSON (builtins.readFile ./github.json);
in { inherit (json) owner repo rev sha256;
private = json.private or false;
}
))
import (import ./thunk.nix)
8 changes: 5 additions & 3 deletions dep/hnix/github.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"owner": "haskell-nix",
"repo": "hnix",
"branch": "master",
"rev": "6c9c7c310c54372b3db0fdf5a0137b395cde1bdb",
"sha256": "1i5903b7lxqn2s3jarb14h6wdq8bxiik1hp0xy43w5w1hgvvq0g5"
"branch": "hackage-0.12.0.1",
"private": false,
"rev": "0f23778ffe64fe24c2119866437cc53735262856",
"sha256": "sha256-yAR3cIVI/DwuBSlvAt1nKG5a0QcsJlGpsr9ndpZBc0U=",
"fetchSubmodules": true
}
12 changes: 12 additions & 0 deletions dep/hnix/thunk.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DO NOT HAND-EDIT THIS FILE
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
if !fetchSubmodules && !private then builtins.fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
} else (import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz";
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr";
}) {}).fetchFromGitHub {
inherit owner repo rev sha256 fetchSubmodules private;
};
json = builtins.fromJSON (builtins.readFile ./github.json);
in fetch json
4 changes: 2 additions & 2 deletions dep/reflex-platform/github.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"repo": "reflex-platform",
"branch": "develop",
"private": false,
"rev": "9ebc4aa483e94ea52a20ce3641e72b43328d40ae",
"sha256": "1fynvarxlcbcszawcipc1137rz1r9nv96jjb8vgpdkjg9rwk0pas"
"rev": "6c8830e059a6d2859cb1b65acefed3c2f1d216d3",
"sha256": "sha256:06kv45yq8qan0p22wzj5c9mx11ns1wddyqjr1xasjjkf6gaf0080"
}
40 changes: 0 additions & 40 deletions haskell-overlays/ghcide.nix

This file was deleted.

48 changes: 23 additions & 25 deletions haskell-overlays/misc-deps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,32 @@ let
in

rec {
# Actually broken in current nixpkgs master due to MonadFail changes
# git = haskellLib.markUnbroken super.git;
resolv = haskellLib.dontCheck (self.callHackage "resolv" "0.1.2.0" {});
cabal-install = haskellLib.doJailbreak ((self.callHackage "cabal-install" "3.4.1.0" {}).overrideScope (self: super: { Cabal = self.Cabal_3_4_0_0; }));

# hpack requires cabal >= 3.0 but the ghc865 package set builds it with 2.4 by default
hpack = super.hpack.overrideScope (self: super: { Cabal = self.Cabal_3_2_0_0; });
hpack = super.hpack.overrideScope (self: super: { Cabal = self.Cabal_3_2_1_0; });

# These versions work with both the ghc865 and ghc8107 package sets
git = self.callCabal2nix "git" (hackGet ../dep/hs-git) { };
# hdevtools = haskellLib.markUnbroken super.hdevtools;
# reflex-ghci = haskellLib.markUnbroken super.reflex-ghci;
# reflex-process = haskellLib.markUnbroken super.reflex-process;
# reflex-vty = haskellLib.markUnbroken super.reflex-vty;
# reflex-fsnotify = haskellLib.markUnbroken super.reflex-fsnotify;
universe-base-810 = haskellLib.doJailbreak (self.callHackage "universe-base" "1.1.3" {});
http-link-header = haskellLib.doJailbreak super.http-link-header;
universe-base-810 = haskellLib.doJailbreak (self.callHackage "universe-base" "1.1" {});
universe-dependent-sum-810 = self.callHackage "universe-dependent-sum" "1.3" {};
universe-some-810 = haskellLib.dontHaddock (haskellLib.appendBuildFlags (haskellLib.doJailbreak (self.callHackage "universe-some" "1.2.1" { })) [ "--ghc-option=-Wno-inferred-safe-imports" "--ghc-option=-Wno-missing-safe-haskell-mode" ]);
universe-some-810 = haskellLib.dontHaddock (haskellLib.appendBuildFlags (haskellLib.doJailbreak (self.callHackage "universe-some" "1.2" { })) [ "--ghc-option=-Wno-inferred-safe-imports" "--ghc-option=-Wno-missing-safe-haskell-mode" ]);

stylish-haskell = null; # FIXME
beam-migrate = self.callHackageDirect {
pkg = "beam-migrate";
ver = "0.5.1.2";
sha256 = "sha256-vEv/6DCvuEq6cmxoPKxZNIm5g6YUgrdvAK4YAoZQr/E=";
} {};

universe-810 = self.callHackage "universe" "1.2.2" {};
universe-instances-extended-810 = self.callHackage "universe-instances-extended" "1.1.3" {};
universe-reverse-instances-810 = self.callHackage "universe-reverse-instances" "1.1.1" {};
universe-810 = self.callHackage "universe" "1.2" {};
universe-instances-extended-810 = self.callHackage "universe-instances-extended" "1.1.1" {};
universe-reverse-instances-810 = self.callHackage "universe-reverse-instances" "1.1" {};

hnix = haskellLib.overrideCabal super.hnix (drv: {
jailbreak = true;
preBuild = ''
substituteInPlace src/Nix/Expr/Types.hs --replace "instance Hashable1 NonEmpty" ""
'';});
# We use our fork of hnix which has some compatibility patches on top of 0.12 from hackage
hnix = haskellLib.dontHaddock (haskellLib.dontCheck (self.callCabal2nix "hnix" (hackGet ../dep/hnix) {}));

universe-86 = haskellLib.dontCheck (self.callHackage "universe" "1.2" {});
universe-instances-extended-86 = self.callHackage "universe-instances-extended" "1.1.1" {};
Expand All @@ -45,17 +44,11 @@ rec {
universe = mkVersionset __useNewerCompiler universe-86 universe-810;
universe-instances-extended = mkVersionset __useNewerCompiler universe-instances-extended-86 universe-instances-extended-810;
universe-reverse-instances = mkVersionset __useNewerCompiler super.universe-reverse-instances universe-reverse-instances-810;
#hnix = mkVersionset version hnix-86 hnix-810;
universe-base = haskellLib.dontCheck (mkVersionset __useNewerCompiler super.universe-base universe-base-810);
universe-dependent-sum = mkVersionset __useNewerCompiler super.universe-dependent-sum universe-dependent-sum-810;
universe-some-86 = self.callHackage "universe-some" "1.2" {};
universe-some = mkVersionset __useNewerCompiler universe-some-86 universe-some-810;

#th-abstraction-86 = self.callHackage "th-abstraction" "0.3.0.0" {};
#th-abstraction-810 = self.callHackage "th-abstraction" "0.4.3.0" {};
#th-abstraction = mkVersionset version th-abstraction-86 th-abstraction-810;
#bifunctors = self.callHackage "bifunctors" "5.5.11" { th-abstraction = th-abstraction-new; };
#template-haskell = self.callHackage "template-haskell" "2.14.0.0" {};
regex-base = self.callHackage "regex-base" "0.94.0.0" { };
regex-posix = self.callHackage "regex-posix" "0.96.0.0" { };
regex-tdfa = self.callHackage "regex-tdfa" "1.3.1.0" { };
Expand All @@ -69,7 +62,6 @@ rec {
heist = haskellLib.dontCheck (haskellLib.doJailbreak super.heist); # aeson 1.5 bump
aeson-gadt-th = haskellLib.doJailbreak super.aeson-gadt-th; # requires aeson 1.5 for ghc8.10 support?
deriving-compat = self.callHackage "deriving-compat" "0.6" { };
#deriving-compat = mkVersionset version super.deriving-compat deriving-compat-810;
http-api-data = haskellLib.doJailbreak super.http-api-data;
nix-derivation = haskellLib.doJailbreak super.nix-derivation;
algebraic-graphs = haskellLib.doJailbreak super.algebraic-graphs;
Expand All @@ -82,7 +74,11 @@ rec {
resourcet = self.callHackage "resourcet" "1.2.4.2" { };
unliftio-core = self.callHackage "unliftio-core" "0.2.0.1" { };
shelly = self.callHackage "shelly" "1.9.0" { };
# version >= 0.2.5.2 has a Cabal version of 3.0, which nix doesn't like
vector-binary-instances = self.callHackage "vector-binary-instances" "0.2.5.1" {};
modern-uri = haskellLib.doJailbreak super.modern-uri;
monad-logger = self.callHackage "monad-logger" "0.3.36" { };
neat-interpolation = haskellLib.doJailbreak super.neat-interpolation;
nix-thunk = (import ../dep/nix-thunk { }).makeRunnableNixThunk (self.callCabal2nix "nix-thunk" (hackGet ../dep/nix-thunk) { });
cli-extras = self.callCabal2nix "cli-extras" (hackGet ../dep/cli-extras) { };
cli-git = haskellLib.overrideCabal (self.callCabal2nix "cli-git" (hackGet ../dep/cli-git) { }) {
Expand All @@ -97,4 +93,6 @@ rec {
nix-prefetch-git
];
};

haddock-library = haskellLib.doJailbreak (self.callHackage "haddock-library" "1.10.0" {});
}
5 changes: 4 additions & 1 deletion lib/asset/manifest/obelisk-asset-manifest.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ Maintainer: [email protected]
Stability: Experimental
Category: Web
Build-type: Simple
Cabal-version: >= 1.8
Cabal-version: >= 1.10

library
default-language: Haskell2010
hs-source-dirs: src

build-depends:
Expand Down Expand Up @@ -39,6 +40,7 @@ library
-fno-warn-unused-do-bind -funbox-strict-fields -fprof-auto-calls

executable obelisk-asset-manifest-generate
default-language: Haskell2010
hs-source-dirs: src-bin
main-is: generate.hs
build-depends:
Expand All @@ -47,6 +49,7 @@ executable obelisk-asset-manifest-generate
, text

executable obelisk-asset-th-generate
default-language: Haskell2010
hs-source-dirs: src-bin
main-is: static-th.hs
build-depends:
Expand Down
6 changes: 4 additions & 2 deletions lib/asset/manifest/src/Obelisk/Asset/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ staticAssetFilePathRaw
staticAssetFilePathRaw root = staticAssetWorker root staticOutPath

staticAssetFilePath :: FilePath -> FilePath -> Q Exp
staticAssetFilePath root fp = do
LitE . StringL . (root </>) <$> hashedAssetFilePath root fp
staticAssetFilePath root relativePath = do
let fullPath = root </> relativePath
qAddDependentFile fullPath
pure $ LitE $ StringL fullPath

-- | @'staticAssetWorker' root staticOut fp@.
--
Expand Down
3 changes: 2 additions & 1 deletion lib/asset/serve-snap/obelisk-asset-serve-snap.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ author: Obsidian Systems LLC
maintainer: [email protected]
category: Web
build-type: Simple
cabal-version: >=1.2
cabal-version: >=1.10

library
default-language: Haskell2010
hs-source-dirs: src

build-depends:
Expand Down
Loading

0 comments on commit 46ba319

Please sign in to comment.