Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,400
    • Issues 5,400
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 590
    • Merge requests 590
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #23346
Closed
Open
Issue created May 04, 2023 by Naïm Favier@ncfavier

[question] Can't build with cabal using the JS backend

I'm trying to build a project using the JS backend in GHC 9.6 (or 9.7.20230406). I'm getting GHC from nixpkgs (pkgsCross.ghcjs.haskell.compiler.ghc96) and running this command:

cabal --with-compiler=javascript-unknown-ghcjs-ghc --with-ghc-pkg=javascript-unknown-ghcjs-ghc-pkg build

This eventually fails to build lens, because ghcjs_HOST_OS is not set, and this file relies on it. Setting --ghc-option='-Dghcjs_HOST_OS' doesn't change anything.

So I tried this instead:

cabal --ghcjs --with-ghcjs=javascript-unknown-ghcjs-ghc --with-ghcjs-pkg=javascript-unknown-ghcjs-ghc-pkg build

Which now complains that it can't determine the version of javascript-unknown-ghcjs-ghc. And indeed, Cabal is trying to run javascript-unknown-ghcjs-ghc --numeric-ghcjs-version, which is not a recognised flag.

How do I use the new JS backend with Cabal?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking