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

Add reproduction case for failing quasiquoting when using JS backend #2193

Closed

Conversation

sevanspowell
Copy link
Contributor

  • When using quasiquoting, the JS backend is failing (with ghc-9.8.2) due to missing "nodejs" executable and "ghci" package.

  • This PR adds a failing test to demonstrate this behaviour.

  • Execute the test with:

    nix-build -A allJobs.x86_64-linux.unstable.ghc982.ghcjs.tests.js-template-haskell.build
    

    The error is:

    node: createProcess: posix_spawnp: does not exist (No such file or directory)
    
  • We can add nodejs to the package build-tools to fix the nodejs issue:

        ({ pkgs,... }: {
          packages.js-template-haskell.components.library.build-tools = [ pkgs.pkgsBuildHost.nodejs ];
        })
    
  • The error is now:

    JS interpreter: couldn't find "ghci" package
    
  • I am unsure how to fix this error.

I think haskell.nix should add nodejs and ghci to the build environment when using the GHC JS backend, so that compiling code using quasiquoting/template haskell "just works" without too many headaches.

Evidence that nodejs and ghci are required:

- The JS backend is failing with ghc-9.8.2 due to missing "nodejs" executable
  and "ghci" package.
- Uncommenting the code in "modules" of "test/js-template-haskell/default.nix"
  will fix the nodejs issue.
- Unsure how to fix the "ghci" issue.
@sevanspowell
Copy link
Contributor Author

Additionally, is there a way to restrict my test to only run on ghc >=9.8.2? I don't think earlier versions of GHC/GHCJS support building with Template Haskell.

@hamishmack
Copy link
Collaborator

I don't think earlier versions of GHC/GHCJS support building with Template Haskell.

GHCJS 8.10 supports TH.

@hamishmack
Copy link
Collaborator

Moved to #2199

@hamishmack hamishmack closed this May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants