-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reproduction case for failing quasiquoting when using JS backend (#…
…2199) * Add reproduction case for failing quasiquoting when using JS backend - 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. * Remove unnecesary base constraint * GHC JS backend fixes * Workarounds for ghc 9.10 * Disable c-ffi test for js backend * Disable broken tests * Add .profiled and .dwarft checks * Add .profiled and .dwarft checks * Exclude test for musl on aarch64 --------- Co-authored-by: Samuel Evans-Powell <[email protected]>
- Loading branch information
1 parent
236e79c
commit 093ab6c
Showing
10 changed files
with
90 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Test building TH code that needs DLLs when cross compiling for windows | ||
{ stdenv, lib, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
project = project' { | ||
inherit compiler-nix-name; | ||
src = testSrc "js-template-haskell"; | ||
}; | ||
|
||
packages = project.hsPkgs; | ||
|
||
in recurseIntoAttrs { | ||
ifdInputs = { | ||
inherit (project) plan-nix; | ||
}; | ||
|
||
meta.disabled = stdenv.buildPlatform != stdenv.hostPlatform && stdenv.hostPlatform.isAarch64; | ||
|
||
build = packages.js-template-haskell.components.library; | ||
check = packages.js-template-haskell.checks.test; | ||
} // optionalAttrs (!stdenv.hostPlatform.isGhcjs) { | ||
build-profiled = packages.js-template-haskell.components.library.profiled; | ||
check-profiled = packages.js-template-haskell.checks.test.profiled; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
cabal-version: 3.0 | ||
name: js-template-haskell | ||
version: 0.1.0.0 | ||
category: Repro | ||
build-type: Simple | ||
|
||
common warnings | ||
ghc-options: -Wall | ||
|
||
library | ||
import: warnings | ||
exposed-modules: MyLib | ||
build-depends: base | ||
, uri-bytestring | ||
hs-source-dirs: src | ||
default-language: Haskell2010 | ||
|
||
test-suite test | ||
type: exitcode-stdio-1.0 | ||
main-is: test/Main.hs | ||
build-depends: base, js-template-haskell | ||
if arch(javascript) && impl(ghc >=9.10.1) | ||
ghc-options: -ddisable-js-c-sources | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{-# LANGUAGE QuasiQuotes #-} | ||
|
||
module MyLib (someUri) where | ||
|
||
import URI.ByteString.QQ | ||
|
||
someUri :: String | ||
someUri = show [uri|https://www.example.com/|] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module Main where | ||
|
||
import Control.Monad (unless) | ||
import System.Exit (exitFailure) | ||
|
||
import MyLib (someUri) | ||
|
||
expected, actual :: String | ||
expected = "URI {uriScheme = Scheme {schemeBS = \"https\"}, uriAuthority = Just (Authority {authorityUserInfo = Nothing, authorityHost = Host {hostBS = \"www.example.com\"}, authorityPort = Nothing}), uriPath = \"/\", uriQuery = Query {queryPairs = []}, uriFragment = Nothing}" | ||
actual = someUri | ||
|
||
main :: IO () | ||
main = | ||
unless (expected == actual) $ do | ||
putStrLn $ "Unexpected TH result : " <> actual | ||
exitFailure | ||
|