Skip to content
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

haskellPackages.ghcjs-dom: build on js backend of ghc 9.8 #309650

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions pkgs/development/haskell-modules/configuration-common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,6 @@ self: super: {
sha256 = "1c7knpvxr7p8c159jkyk6w29653z5yzgjjqj11130bbb8mk9qhq7";
}) super.c2hsc;

# Some Hackage packages reference this attribute, which exists only in the
# GHCJS package set. We provide a dummy version here to fix potential
# evaluation errors.
ghcjs-base = null;
ghcjs-prim = null;

ghc-debug-client = doJailbreak super.ghc-debug-client;

# Test failure. Tests also disabled in Stackage:
Expand Down
22 changes: 22 additions & 0 deletions pkgs/development/haskell-modules/configuration-ghcjs-9.x.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ pkgs, haskellLib }:

with haskellLib;

# cabal2nix doesn't properly add dependencies conditional on arch(javascript)
(self: super: {
ghcjs-base = addBuildDepends (with self; [
aeson
attoparsec
dlist
hashable
primitive
scientific
unordered-containers
vector
]) super.ghcjs-base;

ghcjs-dom = addBuildDepend self.ghcjs-dom-javascript super.ghcjs-dom;
ghcjs-dom-javascript = addBuildDepend self.ghcjs-base super.ghcjs-dom-javascript;
jsaddle = addBuildDepend self.ghcjs-base super.jsaddle;
jsaddle-dom = addBuildDepend self.ghcjs-base super.jsaddle-dom;
})
Original file line number Diff line number Diff line change
Expand Up @@ -1995,7 +1995,6 @@ broken-packages:
- ghc-internal # failure in job https://hydra.nixos.org/build/260723678 at 2024-05-25
- ghcitui # failure in job https://hydra.nixos.org/build/252737339 at 2024-03-16
- ghcjs-base-stub # timeout
- ghcjs-dom-javascript # failure in job https://hydra.nixos.org/build/255688382 at 2024-04-16
- ghcjs-dom-jsffi # failure in job https://hydra.nixos.org/build/233215225 at 2023-09-02
- ghcjs-fetch # timeout
- ghcjs-promise # failure in job https://hydra.nixos.org/build/233243985 at 2023-09-02
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ package-maintainers:
- ghcjs-dom
- ghcjs-dom-hello
- ghcjs-dom-javascript
- ghcjs-dom-jsaddle
- haveibeenpwned
- jsaddle
- jsaddle-clib
Expand Down Expand Up @@ -792,6 +793,7 @@ supported-platforms:
geomancy: [ platforms.x86 ] # x86 intrinsics
geomancy-layout: [ platforms.x86 ] # x86 intrinsics
gi-gtkosxapplication: [ platforms.darwin ]
ghcjs-dom-javascript: [ javascript-ghcjs ]
gtk-mac-integration: [ platforms.darwin ]
gtk3-mac-integration: [ platforms.darwin ]
halide-haskell: [ platforms.linux ]
Expand Down
6 changes: 5 additions & 1 deletion pkgs/development/haskell-modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
, configurationNix ? import ./configuration-nix.nix
, configurationArm ? import ./configuration-arm.nix
, configurationDarwin ? import ./configuration-darwin.nix
, configurationJS ? import ./configuration-ghcjs-9.x.nix
}:

let
Expand All @@ -26,7 +27,10 @@ let
(configurationArm { inherit pkgs haskellLib; })
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
(configurationDarwin { inherit pkgs haskellLib; })
];
] ++ lib.optionals stdenv.hostPlatform.isGhcjs [
(configurationJS { inherit pkgs haskellLib; })
]
;

extensions = lib.composeManyExtensions ([
(nonHackagePackages { inherit pkgs haskellLib; })
Expand Down
17 changes: 10 additions & 7 deletions pkgs/development/haskell-modules/generic-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
let
isCross = stdenv.buildPlatform != stdenv.hostPlatform;

# Note that ghc.isGhcjs != stdenv.hostPlatform.isGhcjs.
# ghc.isGhcjs implies that we are using ghcjs, a project separate from GHC.
# (mere) stdenv.hostPlatform.isGhcjs means that we are using GHC's JavaScript
# backend. The latter is a normal cross compilation backend and needs little
# special accommodation.
outputsJS = ghc.isGhcjs or false || stdenv.hostPlatform.isGhcjs;

# Pass the "wrong" C compiler rather than none at all so packages that just
# use the C preproccessor still work, see
# https://github.com/haskell/cabal/issues/6466 for details.
Expand All @@ -19,15 +26,11 @@ let
fetchurl removeReferencesTo
pkg-config coreutils gnugrep glibcLocales
emscripten;

in

{ pname
# Note that ghc.isGhcjs != stdenv.hostPlatform.isGhcjs.
# ghc.isGhcjs implies that we are using ghcjs, a project separate from GHC.
# (mere) stdenv.hostPlatform.isGhcjs means that we are using GHC's JavaScript
# backend. The latter is a normal cross compilation backend and needs little
# special accommodation.
, dontStrip ? (ghc.isGhcjs or false || stdenv.hostPlatform.isGhcjs)
, dontStrip ? outputsJS
, version, revision ? null
, sha256 ? null
, src ? fetchurl { url = "mirror://hackage/${pname}-${version}.tar.gz"; inherit sha256; }
Expand All @@ -44,7 +47,7 @@ in
, doHaddockQuickjump ? doHoogle
, doInstallIntermediates ? false
, editedCabalFile ? null
, enableLibraryProfiling ? !(ghc.isGhcjs or false)
, enableLibraryProfiling ? !outputsJS
, enableExecutableProfiling ? false
, profilingDetail ? "exported-functions"
# TODO enable shared libs for cross-compiling
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/haskell-modules/hackage-packages.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkgs/top-level/haskell-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ in {
buildHaskellPackages = ghc.bootPkgs;
ghc = bh.compiler.ghcjs810;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { };
packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs-8.x.nix { };
};

# The integer-simple attribute set contains package sets for all the GHC compilers
Expand Down