From 703f950a6316486bd626cb39e6cbe1484c5d2019 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 25 Jul 2022 09:12:00 -0400 Subject: Remove GHCJS support completely I don't care about ghcjs anymore, the most javascript I want to do is jQuery. --- Biz/Bild.hs | 69 +++++++---------------------------------------- Biz/Bild.nix | 26 ------------------ Biz/Bild/Constants.nix | 1 - Biz/Bild/Deps.nix | 26 ------------------ Biz/Bild/Deps/Haskell.nix | 1 - Biz/Bild/Sources.json | 26 ------------------ 6 files changed, 9 insertions(+), 140 deletions(-) diff --git a/Biz/Bild.hs b/Biz/Bild.hs index 016b48f..538b991 100644 --- a/Biz/Bild.hs +++ b/Biz/Bild.hs @@ -86,10 +86,9 @@ -- -- > -- : out my-ap.js -- --- When multiple compilers are possible (e.g. ghc vs ghcjs) we use the @out@ --- extension, for example we chose ghcjs when the target @out@ ends in .js. If --- @out@ does not have an extension, each build type falls back to a default, --- namely an executable binary. +-- When multiple compilers are possible we use the @out@ extension to determine +-- target platform. If @out@ does not have an extension, each build type falls +-- back to a default, namely an executable binary. -- -- This method of setting metadata in the module comments works pretty well, -- and really only needs to be done in the entrypoint module anyway. @@ -205,8 +204,6 @@ data Compiler = Copy | GhcLib | GhcExe - | GhcjsExe - | GhcjsLib | Guile | NixBuild | Rustc @@ -333,7 +330,7 @@ analyze path = do pure Target { builder = user <> "@localhost", - compiler = detectGhcCompiler out <| Text.unpack content, + compiler = detectGhcCompiler out, sysdeps = contentLines /> Text.unpack @@ -430,23 +427,11 @@ ghcPkgFindModule acc m = do /> Set.union acc -- | Some rules for detecting the how to compile a ghc module. If there is an --- out, then we know it's some Exe; if the out ends in .js then it's GhcjsExe, --- otherwise GhcExe. That part is solved. --- --- Detecting a Lib is harder, and much code can be compiled by both ghc and --- ghcjs. For now I'm just guarding against known ghcjs-only modules in the --- import list. -detectGhcCompiler :: Maybe Out -> String -> Compiler -detectGhcCompiler (Just out) _ | jsSuffix out = GhcjsExe -detectGhcCompiler (Just _) _ = GhcExe -detectGhcCompiler Nothing content - | match "import GHCJS" = GhcjsLib - | otherwise = GhcLib - where - match s = s `List.isInfixOf` content - -jsSuffix :: String -> Bool -jsSuffix = List.isSuffixOf ".js" +-- out, then we know it's some Exe, otherwise it's a Lib. +detectGhcCompiler :: Maybe Out -> Compiler +detectGhcCompiler = \case + Just _ -> GhcExe + Nothing -> GhcLib isFailure :: Exit.ExitCode -> Bool isFailure (Exit.ExitFailure _) = True @@ -516,42 +501,6 @@ build andTest loud target@Target {..} = do "--make", path ] - GhcjsExe -> do - Log.info ["bild", "dev", "ghcjs-exe", nschunk namespace] - pure Exit.ExitSuccess - --proc - -- loud - -- namespace - -- "ghcjs" - -- [ "-Werror", - -- "-i" <> root, - -- "-odir", - -- root intdir, - -- "-hidir", - -- root intdir, - -- "--make", - -- path, - -- "-main-is", - -- Namespace.toHaskellModule namespace, - -- "-o", - -- root vardir Maybe.fromJust out - -- ] - GhcjsLib -> do - Log.info ["bild", "dev", "ghcjs-lib", nschunk namespace] - pure Exit.ExitSuccess - --proc - -- loud - -- namespace - -- "ghcjs" - -- [ "-Werror", - -- "-i" <> root, - -- "-odir", - -- root intdir, - -- "-hidir", - -- root intdir, - -- "--make", - -- path - -- ] Guile -> do Log.info ["bild", "dev", "guile", nschunk namespace] _ <- diff --git a/Biz/Bild.nix b/Biz/Bild.nix index 5a06595..ff525eb 100644 --- a/Biz/Bild.nix +++ b/Biz/Bild.nix @@ -21,7 +21,6 @@ rec { haskellDeps = import ./Bild/Deps/Haskell.nix; ghcWith = nixpkgs.haskell.packages.${constants.ghcCompiler}.ghcWithHoogle; - #mkGhcjsPackageSet = nixpkgs.haskell.packages.${ghcjsCompiler}.ghcWithPackages; sbclWith = nixpkgs.lispPackages_new.sbclWithPackages; @@ -113,31 +112,6 @@ rec { installPhase = "exit 0"; } // { env = ghc; }; - #ghcjs = main: - # let - # data = analyze main; - # ghcjs = mkGhcjsPackageSet (hp: private.selectAttrs data.deps hp); - # in stdenv.mkDerivation { - # name = data.module; - # src = ../.; - # nativeBuildInputs = [ ghcjs ]; - # strictDeps = true; - # buildPhase = '' - # mkdir -p $out/static - # # compile with ghcjs - # ${ghcjs}/bin/ghcjs \ - # -Werror \ - # -i. \ - # --make ${main} \ - # -main-is ${data.module} \ - # -o ${data.out} - # # optimize js output - # ${nixpkgs.pkgs.closurecompiler}/bin/closure-compiler \ - # ${data.out}/all.js > $out/static/${data.out} - # ''; - # installPhase = "exit 0"; - # } // { env = ghcjs; }; - env = nixpkgs.pkgs.mkShell { name = "bizdev"; # this should just be dev tools diff --git a/Biz/Bild/Constants.nix b/Biz/Bild/Constants.nix index 0ffc85d..161957a 100644 --- a/Biz/Bild/Constants.nix +++ b/Biz/Bild/Constants.nix @@ -1,4 +1,3 @@ { ghcCompiler = "ghc923"; - ghcjsCompiler = "ghcjs86"; } diff --git a/Biz/Bild/Deps.nix b/Biz/Bild/Deps.nix index 84639b5..79f7ac3 100644 --- a/Biz/Bild/Deps.nix +++ b/Biz/Bild/Deps.nix @@ -18,7 +18,6 @@ in rec envy = doJailbreak sup.envy; fast-tags = sup.fast-tags.overrideAttrs (old: old // { patches = []; }); generic-data = dontCheck sup.generic-data; # https://github.com/Lysxia/generic-data/issues/56 - ghcjs-base = null; # otherwise ghc tries to build this via overridePinnedDeps readable = doJailbreak sup.readable; # why is this even being built? servant-auth = doJailbreak (buildCabalSubdir sel {name = "servant-auth"; subdir = "servant-auth/servant-auth";}); servant-server = doJailbreak sup.servant-server; @@ -29,31 +28,6 @@ in rec wai-middleware-metrics = dontCheck sup.wai-middleware-metrics; }; }); - #ghcjs86 = pkgs.haskell.packages.ghcjs86.override (old: { - # overrides = with pkgs.haskell.lib; sel: sup: - # super.overridePinnedDeps (buildCabal sel) // { - # Glob = dontCheck sup.Glob; - # QuickCheck = dontCheck sup.QuickCheck; - # aeson = dontCheck sup.aeson; - # base-compat-batteries = dontCheck sup.base-compat-batteries; - # clay = dontCheck sup.clay; - # comonad = dontCheck sup.comonad; - # ghcjs-base = dontCheck (buildCabal sel "ghcjs-base"); - # jsaddle-warp = dontCheck (buildCabalSubdir sel { - # name = "jsaddle-warp"; - # src = pkgs.sources.jsaddle; - # }); - # http-types = dontCheck sup.http-types; - # network-uri= dontCheck sup.network-uri; - # scientific = dontCheck sup.scientific; # takes forever - # servant = dontCheck sup.servant; - # servant-auth = buildCabalSubdir sel "servant-auth"; - # tasty-quickcheck = dontCheck sup.tasty-quickcheck; - # temporary = dontCheck sup.temporary; - # time-compat = dontCheck sup.time-compat; - # vector = dontCheck sup.vector; - # }; - #}); }; }; diff --git a/Biz/Bild/Deps/Haskell.nix b/Biz/Bild/Deps/Haskell.nix index 7e9f4fe..d8108d7 100644 --- a/Biz/Bild/Deps/Haskell.nix +++ b/Biz/Bild/Deps/Haskell.nix @@ -23,7 +23,6 @@ with hpkgs; envy fast-logger filepath - ghcjs-base github hashids haskeline diff --git a/Biz/Bild/Sources.json b/Biz/Bild/Sources.json index b754685..d151bdc 100644 --- a/Biz/Bild/Sources.json +++ b/Biz/Bild/Sources.json @@ -37,19 +37,6 @@ "url_template": "https://github.com///archive/.tar.gz", "version": "0.6.3.4" }, - "ghcjs-base": { - "branch": "master", - "description": "base library for GHCJS for JavaScript interaction and marshalling, used by higher level libraries like JSC", - "homepage": "", - "owner": "ghcjs", - "repo": "ghcjs-base", - "rev": "18f31dec5d9eae1ef35ff8bbf163394942efd227", - "sha256": "09h3rc639n4768y75v0dbrys9pnd4da538cdgzx11dzrjm971f60", - "type": "tarball", - "url": "https://github.com/ghcjs/ghcjs-base/archive/18f31dec5d9eae1ef35ff8bbf163394942efd227.tar.gz", - "url_template": "https://github.com///archive/.tar.gz", - "version": "18f31dec5d9eae1ef35ff8bbf163394942efd227" - }, "guix": { "branch": "master", "repo": "https://git.savannah.gnu.org/git/guix.git", @@ -77,19 +64,6 @@ "url_template": "https://gitlab.com/kavalogic-inc/inspekt3d/-/archive//inspekt3d-.tar.gz", "version": "703f52ccbfedad2bf5240bf8183d1b573c9d54ef" }, - "jsaddle": { - "branch": "master", - "description": "JavaScript interface that works with GHCJS or GHC", - "homepage": "", - "owner": "ghcjs", - "repo": "jsaddle", - "rev": "00b206288c2cd019b56ff9f0b72a065f67ffb242", - "sha256": "179q0j4wmn28h1ny2p8qgpr25krl4v6dn3xmbn8zkvylkz4f3m42", - "type": "tarball", - "url": "https://github.com/ghcjs/jsaddle/archive/00b206288c2cd019b56ff9f0b72a065f67ffb242.tar.gz", - "url_template": "https://github.com///archive/.tar.gz", - "version": "1e39844" - }, "niv": { "branch": "master", "description": "Easy dependency management for Nix projects", -- cgit v1.2.3