diff --git a/.travis.yml b/.travis.yml index 8b66a9657e..41cab9bd88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,9 @@ -# TODO Only do release builds on the `pull` branch? - jobs: include: - os: linux language: nix nix: 2.1.3 + env: STACK_YAML=pkg/hs/stack.yaml before_install: - git lfs pull - sh/travis-install-stack @@ -16,13 +15,15 @@ jobs: script: - cachix use urbit2 - ./sh/cachix - - make build-fast + - make build - make release + - sh/release-king-linux64-dynamic - sh/ci-tests - os: osx language: generic sudo: required + env: STACK_YAML=pkg/hs/stack.yaml before_install: - sh/travis-install-stack @@ -31,13 +32,7 @@ jobs: - stack --no-terminal --install-ghc build king --only-dependencies script: - - ver="$(git rev-parse HEAD)" - - if [ -n "${TRAVIS_COMMIT-}" ]; then ver="$TRAVIS_COMMIT"; fi - - if [ -n "${TRAVIS_TAG-}" ]; then ver="$TRAVIS_TAG"; fi - - stack clean - - stack install king --local-bin-path ./release - - mv release/king release/king-darwin-$ver - - otool -L release/king-darwin-$ver + - sh/release-king-darwin-dynamic cache: directories: diff --git a/Makefile b/Makefile index 5f8c3059cb..4347069709 100644 --- a/Makefile +++ b/Makefile @@ -2,11 +2,6 @@ build: nix-build -A urbit -A herb --no-out-link - stack build king - -build-fast: - nix-build -A urbit -A herb --no-out-link - stack build king --fast build-all: nix-build --no-out-link diff --git a/pkg/hs/default.nix b/pkg/hs/default.nix new file mode 100644 index 0000000000..a77ce12748 --- /dev/null +++ b/pkg/hs/default.nix @@ -0,0 +1,52 @@ +# Run using: +# +# $(nix-build --no-link -A fullBuildScript) +{ + stack2nix-output-path ? "custom-stack2nix-output.nix", +}: +let + cabalPackageName = "king"; + compiler = "ghc865"; # matching stack.yaml + + # Pin static-haskell-nix version. + static-haskell-nix = + if builtins.pathExists ../.in-static-haskell-nix + then toString ../. # for the case that we're in static-haskell-nix itself, so that CI always builds the latest version. + # Update this hash to use a different `static-haskell-nix` version: + else fetchTarball https://github.com/nh2/static-haskell-nix/archive/b402b38c3af2300e71caeebe51b5e4e1ae2e924c.tar.gz; + + # Pin nixpkgs version + # By default to the one `static-haskell-nix` provides, but you may also give + # your own as long as it has the necessary patches, using e.g. + # pkgs = import (fetchTarball https://github.com/nh2/nixpkgs/archive/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa123.tar.gz) {}; + pkgs = import "${static-haskell-nix}/nixpkgs.nix"; + + stack2nix-script = import "${static-haskell-nix}/static-stack2nix-builder/stack2nix-script.nix" { + inherit pkgs; + stack-project-dir = toString ./.; # where stack.yaml is + hackageSnapshot = "2019-12-19T00:00:00Z"; # pins e.g. extra-deps without hashes or revisions + }; + + static-stack2nix-builder = import "${static-haskell-nix}/static-stack2nix-builder/default.nix" { + normalPkgs = pkgs; + inherit cabalPackageName compiler stack2nix-output-path; + # disableOptimization = true; # for compile speed + }; + + # Full invocation, including pinning `nix` version itself. + fullBuildScript = pkgs.writeScript "stack2nix-and-build-script.sh" '' + #!/usr/bin/env bash + set -eu -o pipefail + STACK2NIX_OUTPUT_PATH=$(${stack2nix-script}) + export NIX_PATH=nixpkgs=${pkgs.path} + ${pkgs.nix}/bin/nix-build --no-link -A static_package --argstr stack2nix-output-path "$STACK2NIX_OUTPUT_PATH" "$@" + ''; + +in + { + static_package = static-stack2nix-builder.static_package; + inherit fullBuildScript; + # For debugging: + inherit stack2nix-script; + inherit static-stack2nix-builder; + } diff --git a/pkg/king/.gitignore b/pkg/hs/king/.gitignore similarity index 100% rename from pkg/king/.gitignore rename to pkg/hs/king/.gitignore diff --git a/pkg/king/LICENSE b/pkg/hs/king/LICENSE similarity index 100% rename from pkg/king/LICENSE rename to pkg/hs/king/LICENSE diff --git a/pkg/king/app/CLI.hs b/pkg/hs/king/app/CLI.hs similarity index 100% rename from pkg/king/app/CLI.hs rename to pkg/hs/king/app/CLI.hs diff --git a/pkg/king/app/Main.hs b/pkg/hs/king/app/Main.hs similarity index 100% rename from pkg/king/app/Main.hs rename to pkg/hs/king/app/Main.hs diff --git a/pkg/king/app/TryJamPill.hs b/pkg/hs/king/app/TryJamPill.hs similarity index 100% rename from pkg/king/app/TryJamPill.hs rename to pkg/hs/king/app/TryJamPill.hs diff --git a/pkg/king/app/TryTimers.hs b/pkg/hs/king/app/TryTimers.hs similarity index 100% rename from pkg/king/app/TryTimers.hs rename to pkg/hs/king/app/TryTimers.hs diff --git a/pkg/king/dhall-sketch/config.dhall b/pkg/hs/king/dhall-sketch/config.dhall similarity index 100% rename from pkg/king/dhall-sketch/config.dhall rename to pkg/hs/king/dhall-sketch/config.dhall diff --git a/pkg/king/lib/Arvo.hs b/pkg/hs/king/lib/Arvo.hs similarity index 100% rename from pkg/king/lib/Arvo.hs rename to pkg/hs/king/lib/Arvo.hs diff --git a/pkg/king/lib/Arvo/Common.hs b/pkg/hs/king/lib/Arvo/Common.hs similarity index 100% rename from pkg/king/lib/Arvo/Common.hs rename to pkg/hs/king/lib/Arvo/Common.hs diff --git a/pkg/king/lib/Arvo/Effect.hs b/pkg/hs/king/lib/Arvo/Effect.hs similarity index 100% rename from pkg/king/lib/Arvo/Effect.hs rename to pkg/hs/king/lib/Arvo/Effect.hs diff --git a/pkg/king/lib/Arvo/Event.hs b/pkg/hs/king/lib/Arvo/Event.hs similarity index 100% rename from pkg/king/lib/Arvo/Event.hs rename to pkg/hs/king/lib/Arvo/Event.hs diff --git a/pkg/king/lib/Azimuth/Azimuth.hs b/pkg/hs/king/lib/Azimuth/Azimuth.hs similarity index 100% rename from pkg/king/lib/Azimuth/Azimuth.hs rename to pkg/hs/king/lib/Azimuth/Azimuth.hs diff --git a/pkg/king/lib/Azimuth/azimuth.json b/pkg/hs/king/lib/Azimuth/azimuth.json similarity index 100% rename from pkg/king/lib/Azimuth/azimuth.json rename to pkg/hs/king/lib/Azimuth/azimuth.json diff --git a/pkg/king/lib/Config.hs b/pkg/hs/king/lib/Config.hs similarity index 100% rename from pkg/king/lib/Config.hs rename to pkg/hs/king/lib/Config.hs diff --git a/pkg/king/lib/Data/RAcquire.hs b/pkg/hs/king/lib/Data/RAcquire.hs similarity index 100% rename from pkg/king/lib/Data/RAcquire.hs rename to pkg/hs/king/lib/Data/RAcquire.hs diff --git a/pkg/king/lib/EventBrowser.hs b/pkg/hs/king/lib/EventBrowser.hs similarity index 100% rename from pkg/king/lib/EventBrowser.hs rename to pkg/hs/king/lib/EventBrowser.hs diff --git a/pkg/king/lib/King/API.hs b/pkg/hs/king/lib/King/API.hs similarity index 100% rename from pkg/king/lib/King/API.hs rename to pkg/hs/king/lib/King/API.hs diff --git a/pkg/king/lib/King/App.hs b/pkg/hs/king/lib/King/App.hs similarity index 100% rename from pkg/king/lib/King/App.hs rename to pkg/hs/king/lib/King/App.hs diff --git a/pkg/king/lib/KingApp.hs b/pkg/hs/king/lib/KingApp.hs similarity index 100% rename from pkg/king/lib/KingApp.hs rename to pkg/hs/king/lib/KingApp.hs diff --git a/pkg/king/lib/Noun.hs b/pkg/hs/king/lib/Noun.hs similarity index 100% rename from pkg/king/lib/Noun.hs rename to pkg/hs/king/lib/Noun.hs diff --git a/pkg/king/lib/Noun/Atom.hs b/pkg/hs/king/lib/Noun/Atom.hs similarity index 100% rename from pkg/king/lib/Noun/Atom.hs rename to pkg/hs/king/lib/Noun/Atom.hs diff --git a/pkg/king/lib/Noun/Conversions.hs b/pkg/hs/king/lib/Noun/Conversions.hs similarity index 100% rename from pkg/king/lib/Noun/Conversions.hs rename to pkg/hs/king/lib/Noun/Conversions.hs diff --git a/pkg/king/lib/Noun/Convert.hs b/pkg/hs/king/lib/Noun/Convert.hs similarity index 100% rename from pkg/king/lib/Noun/Convert.hs rename to pkg/hs/king/lib/Noun/Convert.hs diff --git a/pkg/king/lib/Noun/Core.hs b/pkg/hs/king/lib/Noun/Core.hs similarity index 100% rename from pkg/king/lib/Noun/Core.hs rename to pkg/hs/king/lib/Noun/Core.hs diff --git a/pkg/king/lib/Noun/Cue.hs b/pkg/hs/king/lib/Noun/Cue.hs similarity index 100% rename from pkg/king/lib/Noun/Cue.hs rename to pkg/hs/king/lib/Noun/Cue.hs diff --git a/pkg/king/lib/Noun/Jam.hs b/pkg/hs/king/lib/Noun/Jam.hs similarity index 100% rename from pkg/king/lib/Noun/Jam.hs rename to pkg/hs/king/lib/Noun/Jam.hs diff --git a/pkg/king/lib/Noun/Lens.hs b/pkg/hs/king/lib/Noun/Lens.hs similarity index 100% rename from pkg/king/lib/Noun/Lens.hs rename to pkg/hs/king/lib/Noun/Lens.hs diff --git a/pkg/king/lib/Noun/Rip.hs b/pkg/hs/king/lib/Noun/Rip.hs similarity index 100% rename from pkg/king/lib/Noun/Rip.hs rename to pkg/hs/king/lib/Noun/Rip.hs diff --git a/pkg/king/lib/Noun/TH.hs b/pkg/hs/king/lib/Noun/TH.hs similarity index 100% rename from pkg/king/lib/Noun/TH.hs rename to pkg/hs/king/lib/Noun/TH.hs diff --git a/pkg/king/lib/Noun/Tank.hs b/pkg/hs/king/lib/Noun/Tank.hs similarity index 100% rename from pkg/king/lib/Noun/Tank.hs rename to pkg/hs/king/lib/Noun/Tank.hs diff --git a/pkg/king/lib/Noun/Tree.hs b/pkg/hs/king/lib/Noun/Tree.hs similarity index 100% rename from pkg/king/lib/Noun/Tree.hs rename to pkg/hs/king/lib/Noun/Tree.hs diff --git a/pkg/king/lib/Urbit/CTTP.hs b/pkg/hs/king/lib/Urbit/CTTP.hs similarity index 100% rename from pkg/king/lib/Urbit/CTTP.hs rename to pkg/hs/king/lib/Urbit/CTTP.hs diff --git a/pkg/king/lib/Urbit/Time.hs b/pkg/hs/king/lib/Urbit/Time.hs similarity index 100% rename from pkg/king/lib/Urbit/Time.hs rename to pkg/hs/king/lib/Urbit/Time.hs diff --git a/pkg/king/lib/Urbit/Timer.hs b/pkg/hs/king/lib/Urbit/Timer.hs similarity index 100% rename from pkg/king/lib/Urbit/Timer.hs rename to pkg/hs/king/lib/Urbit/Timer.hs diff --git a/pkg/king/lib/UrbitPrelude.hs b/pkg/hs/king/lib/UrbitPrelude.hs similarity index 100% rename from pkg/king/lib/UrbitPrelude.hs rename to pkg/hs/king/lib/UrbitPrelude.hs diff --git a/pkg/king/lib/Vere/Ames.hs b/pkg/hs/king/lib/Vere/Ames.hs similarity index 100% rename from pkg/king/lib/Vere/Ames.hs rename to pkg/hs/king/lib/Vere/Ames.hs diff --git a/pkg/king/lib/Vere/Behn.hs b/pkg/hs/king/lib/Vere/Behn.hs similarity index 100% rename from pkg/king/lib/Vere/Behn.hs rename to pkg/hs/king/lib/Vere/Behn.hs diff --git a/pkg/king/lib/Vere/Clay.hs b/pkg/hs/king/lib/Vere/Clay.hs similarity index 100% rename from pkg/king/lib/Vere/Clay.hs rename to pkg/hs/king/lib/Vere/Clay.hs diff --git a/pkg/king/lib/Vere/Dawn.hs b/pkg/hs/king/lib/Vere/Dawn.hs similarity index 100% rename from pkg/king/lib/Vere/Dawn.hs rename to pkg/hs/king/lib/Vere/Dawn.hs diff --git a/pkg/king/lib/Vere/Http.hs b/pkg/hs/king/lib/Vere/Http.hs similarity index 100% rename from pkg/king/lib/Vere/Http.hs rename to pkg/hs/king/lib/Vere/Http.hs diff --git a/pkg/king/lib/Vere/Http/Client.hs b/pkg/hs/king/lib/Vere/Http/Client.hs similarity index 100% rename from pkg/king/lib/Vere/Http/Client.hs rename to pkg/hs/king/lib/Vere/Http/Client.hs diff --git a/pkg/king/lib/Vere/Http/Server.hs b/pkg/hs/king/lib/Vere/Http/Server.hs similarity index 100% rename from pkg/king/lib/Vere/Http/Server.hs rename to pkg/hs/king/lib/Vere/Http/Server.hs diff --git a/pkg/king/lib/Vere/LMDB.hs b/pkg/hs/king/lib/Vere/LMDB.hs similarity index 100% rename from pkg/king/lib/Vere/LMDB.hs rename to pkg/hs/king/lib/Vere/LMDB.hs diff --git a/pkg/king/lib/Vere/LockFile.hs b/pkg/hs/king/lib/Vere/LockFile.hs similarity index 100% rename from pkg/king/lib/Vere/LockFile.hs rename to pkg/hs/king/lib/Vere/LockFile.hs diff --git a/pkg/king/lib/Vere/Log.hs b/pkg/hs/king/lib/Vere/Log.hs similarity index 100% rename from pkg/king/lib/Vere/Log.hs rename to pkg/hs/king/lib/Vere/Log.hs diff --git a/pkg/king/lib/Vere/NounServ.hs b/pkg/hs/king/lib/Vere/NounServ.hs similarity index 100% rename from pkg/king/lib/Vere/NounServ.hs rename to pkg/hs/king/lib/Vere/NounServ.hs diff --git a/pkg/king/lib/Vere/Pier.hs b/pkg/hs/king/lib/Vere/Pier.hs similarity index 100% rename from pkg/king/lib/Vere/Pier.hs rename to pkg/hs/king/lib/Vere/Pier.hs diff --git a/pkg/king/lib/Vere/Pier/Types.hs b/pkg/hs/king/lib/Vere/Pier/Types.hs similarity index 100% rename from pkg/king/lib/Vere/Pier/Types.hs rename to pkg/hs/king/lib/Vere/Pier/Types.hs diff --git a/pkg/king/lib/Vere/Serf.hs b/pkg/hs/king/lib/Vere/Serf.hs similarity index 100% rename from pkg/king/lib/Vere/Serf.hs rename to pkg/hs/king/lib/Vere/Serf.hs diff --git a/pkg/king/lib/Vere/Term.hs b/pkg/hs/king/lib/Vere/Term.hs similarity index 100% rename from pkg/king/lib/Vere/Term.hs rename to pkg/hs/king/lib/Vere/Term.hs diff --git a/pkg/king/lib/Vere/Term/API.hs b/pkg/hs/king/lib/Vere/Term/API.hs similarity index 100% rename from pkg/king/lib/Vere/Term/API.hs rename to pkg/hs/king/lib/Vere/Term/API.hs diff --git a/pkg/king/lib/Vere/Term/Demux.hs b/pkg/hs/king/lib/Vere/Term/Demux.hs similarity index 100% rename from pkg/king/lib/Vere/Term/Demux.hs rename to pkg/hs/king/lib/Vere/Term/Demux.hs diff --git a/pkg/king/lib/Vere/Term/Logic.hs b/pkg/hs/king/lib/Vere/Term/Logic.hs similarity index 100% rename from pkg/king/lib/Vere/Term/Logic.hs rename to pkg/hs/king/lib/Vere/Term/Logic.hs diff --git a/pkg/king/package.yaml b/pkg/hs/king/package.yaml similarity index 100% rename from pkg/king/package.yaml rename to pkg/hs/king/package.yaml diff --git a/pkg/king/test/AmesTests.hs b/pkg/hs/king/test/AmesTests.hs similarity index 100% rename from pkg/king/test/AmesTests.hs rename to pkg/hs/king/test/AmesTests.hs diff --git a/pkg/king/test/ArvoTests.hs b/pkg/hs/king/test/ArvoTests.hs similarity index 100% rename from pkg/king/test/ArvoTests.hs rename to pkg/hs/king/test/ArvoTests.hs diff --git a/pkg/king/test/BehnTests.hs b/pkg/hs/king/test/BehnTests.hs similarity index 100% rename from pkg/king/test/BehnTests.hs rename to pkg/hs/king/test/BehnTests.hs diff --git a/pkg/king/test/ClayTests.hs b/pkg/hs/king/test/ClayTests.hs similarity index 100% rename from pkg/king/test/ClayTests.hs rename to pkg/hs/king/test/ClayTests.hs diff --git a/pkg/king/test/DawnTests.hs b/pkg/hs/king/test/DawnTests.hs similarity index 100% rename from pkg/king/test/DawnTests.hs rename to pkg/hs/king/test/DawnTests.hs diff --git a/pkg/king/test/DeriveNounTests.hs b/pkg/hs/king/test/DeriveNounTests.hs similarity index 100% rename from pkg/king/test/DeriveNounTests.hs rename to pkg/hs/king/test/DeriveNounTests.hs diff --git a/pkg/king/test/HoonMapSetTests.hs b/pkg/hs/king/test/HoonMapSetTests.hs similarity index 97% rename from pkg/king/test/HoonMapSetTests.hs rename to pkg/hs/king/test/HoonMapSetTests.hs index 8da55f903f..242dd43f0f 100644 --- a/pkg/king/test/HoonMapSetTests.hs +++ b/pkg/hs/king/test/HoonMapSetTests.hs @@ -73,7 +73,7 @@ goldenFile :: String -> String -> (FilePath -> IO L.ByteString) -> TestTree goldenFile testName testFileName action = goldenVsString testName gold (action pill) where - root = "pkg/king/test/gold" testFileName + root = "pkg/hs/king/test/gold" testFileName gold = root <.> "gold" pill = root <.> "pill" diff --git a/pkg/king/test/JamTests.hs b/pkg/hs/king/test/JamTests.hs similarity index 100% rename from pkg/king/test/JamTests.hs rename to pkg/hs/king/test/JamTests.hs diff --git a/pkg/king/test/LogTests.hs b/pkg/hs/king/test/LogTests.hs similarity index 100% rename from pkg/king/test/LogTests.hs rename to pkg/hs/king/test/LogTests.hs diff --git a/pkg/king/test/Main.hs b/pkg/hs/king/test/Main.hs similarity index 94% rename from pkg/king/test/Main.hs rename to pkg/hs/king/test/Main.hs index f209418c3a..cc76dd6dbf 100644 --- a/pkg/king/test/Main.hs +++ b/pkg/hs/king/test/Main.hs @@ -24,7 +24,7 @@ import qualified NounConversionTests main :: IO () main = do - makeAbsolute "../.." >>= setCurrentDirectory + makeAbsolute "../../.." >>= setCurrentDirectory setEnv "TASTY_NUM_THREADS" "1" runInBoundThread $ defaultMain $ testGroup "Urbit" [ AmesTests.tests diff --git a/pkg/king/test/NounConversionTests.hs b/pkg/hs/king/test/NounConversionTests.hs similarity index 100% rename from pkg/king/test/NounConversionTests.hs rename to pkg/hs/king/test/NounConversionTests.hs diff --git a/pkg/king/test/gold/hoontree.gold b/pkg/hs/king/test/gold/hoontree.gold similarity index 100% rename from pkg/king/test/gold/hoontree.gold rename to pkg/hs/king/test/gold/hoontree.gold diff --git a/pkg/king/test/gold/hoontree.pill b/pkg/hs/king/test/gold/hoontree.pill similarity index 100% rename from pkg/king/test/gold/hoontree.pill rename to pkg/hs/king/test/gold/hoontree.pill diff --git a/pkg/lmdb-static/.gitignore b/pkg/hs/lmdb-static/.gitignore similarity index 100% rename from pkg/lmdb-static/.gitignore rename to pkg/hs/lmdb-static/.gitignore diff --git a/pkg/lmdb-static/LICENSE b/pkg/hs/lmdb-static/LICENSE similarity index 100% rename from pkg/lmdb-static/LICENSE rename to pkg/hs/lmdb-static/LICENSE diff --git a/pkg/lmdb-static/README.md b/pkg/hs/lmdb-static/README.md similarity index 100% rename from pkg/lmdb-static/README.md rename to pkg/hs/lmdb-static/README.md diff --git a/pkg/lmdb-static/Setup.hs b/pkg/hs/lmdb-static/Setup.hs similarity index 100% rename from pkg/lmdb-static/Setup.hs rename to pkg/hs/lmdb-static/Setup.hs diff --git a/pkg/lmdb-static/cbits/lmdb.h b/pkg/hs/lmdb-static/cbits/lmdb.h similarity index 100% rename from pkg/lmdb-static/cbits/lmdb.h rename to pkg/hs/lmdb-static/cbits/lmdb.h diff --git a/pkg/lmdb-static/cbits/mdb.c b/pkg/hs/lmdb-static/cbits/mdb.c similarity index 100% rename from pkg/lmdb-static/cbits/mdb.c rename to pkg/hs/lmdb-static/cbits/mdb.c diff --git a/pkg/lmdb-static/cbits/midl.c b/pkg/hs/lmdb-static/cbits/midl.c similarity index 100% rename from pkg/lmdb-static/cbits/midl.c rename to pkg/hs/lmdb-static/cbits/midl.c diff --git a/pkg/lmdb-static/cbits/midl.h b/pkg/hs/lmdb-static/cbits/midl.h similarity index 100% rename from pkg/lmdb-static/cbits/midl.h rename to pkg/hs/lmdb-static/cbits/midl.h diff --git a/pkg/lmdb-static/hsrc_lib/Database/LMDB/Raw.hsc b/pkg/hs/lmdb-static/hsrc_lib/Database/LMDB/Raw.hsc similarity index 100% rename from pkg/lmdb-static/hsrc_lib/Database/LMDB/Raw.hsc rename to pkg/hs/lmdb-static/hsrc_lib/Database/LMDB/Raw.hsc diff --git a/pkg/lmdb-static/lmdb-static.cabal b/pkg/hs/lmdb-static/lmdb-static.cabal similarity index 100% rename from pkg/lmdb-static/lmdb-static.cabal rename to pkg/hs/lmdb-static/lmdb-static.cabal diff --git a/pkg/proto/.gitignore b/pkg/hs/proto/.gitignore similarity index 100% rename from pkg/proto/.gitignore rename to pkg/hs/proto/.gitignore diff --git a/pkg/proto/LICENSE b/pkg/hs/proto/LICENSE similarity index 100% rename from pkg/proto/LICENSE rename to pkg/hs/proto/LICENSE diff --git a/pkg/proto/app/Main.hs b/pkg/hs/proto/app/Main.hs similarity index 100% rename from pkg/proto/app/Main.hs rename to pkg/hs/proto/app/Main.hs diff --git a/pkg/proto/lib/Dashboard.hs b/pkg/hs/proto/lib/Dashboard.hs similarity index 100% rename from pkg/proto/lib/Dashboard.hs rename to pkg/hs/proto/lib/Dashboard.hs diff --git a/pkg/proto/lib/Deppy/Core.hs b/pkg/hs/proto/lib/Deppy/Core.hs similarity index 100% rename from pkg/proto/lib/Deppy/Core.hs rename to pkg/hs/proto/lib/Deppy/Core.hs diff --git a/pkg/proto/lib/Nock.hs b/pkg/hs/proto/lib/Nock.hs similarity index 100% rename from pkg/proto/lib/Nock.hs rename to pkg/hs/proto/lib/Nock.hs diff --git a/pkg/proto/lib/SimpleNoun.hs b/pkg/hs/proto/lib/SimpleNoun.hs similarity index 100% rename from pkg/proto/lib/SimpleNoun.hs rename to pkg/hs/proto/lib/SimpleNoun.hs diff --git a/pkg/proto/lib/Untyped/CST.hs b/pkg/hs/proto/lib/Untyped/CST.hs similarity index 100% rename from pkg/proto/lib/Untyped/CST.hs rename to pkg/hs/proto/lib/Untyped/CST.hs diff --git a/pkg/proto/lib/Untyped/Core.hs b/pkg/hs/proto/lib/Untyped/Core.hs similarity index 100% rename from pkg/proto/lib/Untyped/Core.hs rename to pkg/hs/proto/lib/Untyped/Core.hs diff --git a/pkg/proto/lib/Untyped/Hoon.hs b/pkg/hs/proto/lib/Untyped/Hoon.hs similarity index 100% rename from pkg/proto/lib/Untyped/Hoon.hs rename to pkg/hs/proto/lib/Untyped/Hoon.hs diff --git a/pkg/proto/lib/Untyped/Parser.hs b/pkg/hs/proto/lib/Untyped/Parser.hs similarity index 100% rename from pkg/proto/lib/Untyped/Parser.hs rename to pkg/hs/proto/lib/Untyped/Parser.hs diff --git a/pkg/proto/lib/Untyped/ShittyCorePrinter.hs b/pkg/hs/proto/lib/Untyped/ShittyCorePrinter.hs similarity index 100% rename from pkg/proto/lib/Untyped/ShittyCorePrinter.hs rename to pkg/hs/proto/lib/Untyped/ShittyCorePrinter.hs diff --git a/pkg/proto/package.yaml b/pkg/hs/proto/package.yaml similarity index 100% rename from pkg/proto/package.yaml rename to pkg/hs/proto/package.yaml diff --git a/pkg/proto/test/Spec.hs b/pkg/hs/proto/test/Spec.hs similarity index 100% rename from pkg/proto/test/Spec.hs rename to pkg/hs/proto/test/Spec.hs diff --git a/stack.yaml b/pkg/hs/stack.yaml similarity index 94% rename from stack.yaml rename to pkg/hs/stack.yaml index 037570cdc9..71c13d6baf 100644 --- a/stack.yaml +++ b/pkg/hs/stack.yaml @@ -1,9 +1,9 @@ resolver: lts-14.4 packages: - - pkg/proto - - pkg/king - - pkg/lmdb-static + - proto + - king + - lmdb-static extra-deps: - flat-0.3.4@sha256:002a0e0ae656ea8cc02a772d0bcb6ea7dbd7f2e79070959cc748ad1e7138eb38 diff --git a/sh/ci-tests b/sh/ci-tests index 805b3e92cf..7c03f9a9fa 100755 --- a/sh/ci-tests +++ b/sh/ci-tests @@ -2,7 +2,9 @@ set -ex -stack test king --fast +export STACK_YAML="`pwd`/pkg/hs/stack.yaml" + +stack test king if [ "$TRAVIS_PULL_REQUEST" = false ] then diff --git a/sh/release b/sh/release index cb04be22c8..82d03acf72 100755 --- a/sh/release +++ b/sh/release @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -ex if [ -n "${TRAVIS_TAG-}" ] then @@ -14,13 +14,6 @@ fi mkdir -p release -stack clean # Make sure we optimize -stack install king --local-bin-path ./release -mv release/king release/king-linux64-$ver - -# OSX -# otool -L ./release/king-darwin-$ver - for plat in linux64 darwin do sh/cross urbit "$plat" diff --git a/sh/release-king-darwin-dynamic b/sh/release-king-darwin-dynamic new file mode 100755 index 0000000000..ff319c7789 --- /dev/null +++ b/sh/release-king-darwin-dynamic @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -ex + +if [ -n "${TRAVIS_TAG-}" ] +then + ver="$TRAVIS_TAG" +elif [ -n "${TRAVIS_COMMIT-}" ] +then + ver="$TRAVIS_COMMIT" +else + ver="$(git rev-parse HEAD)" +fi + +export STACK_YAML="`pwd`/pkg/hs/stack.yaml" + +mkdir -p release + +stack clean # Make sure we optimize + +stack install king \ + --local-bin-path "`pwd`/release" \ + --test --no-run-tests + +out="release/king-darwin-dynamic-$ver" + +mv release/king "$out" + +otool -L "$out" diff --git a/sh/release-king-linux64-dynamic b/sh/release-king-linux64-dynamic new file mode 100755 index 0000000000..d5db458a2b --- /dev/null +++ b/sh/release-king-linux64-dynamic @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -ex + +if [ -n "${TRAVIS_TAG-}" ] +then + ver="$TRAVIS_TAG" +elif [ -n "${TRAVIS_COMMIT-}" ] +then + ver="$TRAVIS_COMMIT" +else + ver="$(git rev-parse HEAD)" +fi + +export STACK_YAML="`pwd`/pkg/hs/stack.yaml" + +mkdir -p release + +stack clean # Make sure we optimize + +stack install king \ + --local-bin-path "`pwd`/release" \ + --test --no-run-tests + +out="release/king-linux64-dynamic-$ver" + +mv release/king "$out" + +ldd "$out" diff --git a/sh/release-king-linux64-static b/sh/release-king-linux64-static new file mode 100755 index 0000000000..ae25a02e5e --- /dev/null +++ b/sh/release-king-linux64-static @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -ex + +if [ -n "${TRAVIS_TAG-}" ] +then + ver="$TRAVIS_TAG" +elif [ -n "${TRAVIS_COMMIT-}" ] +then + ver="$TRAVIS_COMMIT" +else + ver="$(git rev-parse HEAD)" +fi + +pushd pkg/hs + +king=$(bash $(nix-build --no-link -A fullBuildScript)) + +popd + +out="release/king-linux64-static-$ver" + +cp "$king"/bin/king "$out" + +ldd "$out"