-
Notifications
You must be signed in to change notification settings - Fork 30
Add cross-platform testing utils #105
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,7 @@ cabal.project.local | |
| bench.html | ||
| splitmix-hugs | ||
| hugs.output | ||
|
|
||
| # nix | ||
| result | ||
| result-* | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,3 +34,20 @@ generate-mix32 : | |
| doctest : | ||
| perl -i -e 'while (<ARGV>) { print unless /package-id base-compat-\d+(\.\d+)*/; }' .ghc.environment.* | ||
| doctest src | ||
|
|
||
| native: | ||
| nix-build -A native.splitmix | ||
|
|
||
| freebsd: | ||
| nix-build -A freebsd.splitmix | ||
|
|
||
| android: | ||
| nix-build -A android.splitmix | ||
|
|
||
| js: | ||
| nix-build -A js.splitmix | ||
|
|
||
| wasm: | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not in nixpkgs yet, so we're using ghc-wasm-meta for now. |
||
| nix shell \ | ||
| 'gitlab:haskell-wasm/ghc-wasm-meta/7927129e42bcd6a54b9e06e26455803fa4878261?host=gitlab.haskell.org' \ | ||
| --command sh -c "wasm32-wasi-cabal update && wasm32-wasi-cabal test all --ghc-options='-single-threaded' --test-wrapper=wasmtime" | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,10 @@ tests: True | |
| allow-newer: async-2.2.5:base | ||
| allow-newer: hashable-1.4.4.0:base | ||
| allow-newer: hashable-1.4.4.0:containers | ||
|
|
||
| -- Due to error when building 'splitmix-tests': undefined symbol: gethostname | ||
| if arch(wasm32) | ||
| source-repository-package | ||
| type: git | ||
| location: https://github.com/haskell-wasm/hostname | ||
| tag: 8d110f03b3117af233683ac90b125fcfc767a2ef | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume this will eventually get upstreamed (we are the inconvenienced downstream in this case) |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| let | ||
| pins = { | ||
| # merge ancestor of https://github.com/NixOS/nixpkgs/pull/413046 | ||
| nixpkgs = builtins.fetchTarball { | ||
| url = "https://github.com/NixOS/nixpkgs/archive/3ea4dc04503b4370e06eca0e43c062c8b11883fa.tar.gz"; | ||
| sha256 = "sha256:04ygvidh3l3ls755b2wgl148567n9rnj168s87j03agly5wrf19c"; | ||
| }; | ||
| }; | ||
|
|
||
| defaultNixpkgs = import pins.nixpkgs {}; | ||
|
|
||
| cachedPackageSetVersion = "ghc" + builtins.replaceStrings ["."] [""] defaultNixpkgs.haskellPackages.ghc.version; | ||
|
|
||
| mkNixpkgs = version: import pins.nixpkgs { | ||
| config = { | ||
| packageOverrides = nixpkgs: with nixpkgs.haskell.lib.compose; { | ||
| haskell = nixpkgs.haskell // { | ||
| packages = nixpkgs.haskell.packages // { | ||
| "${version}" = nixpkgs.haskell.packages.${version}.override(old: { | ||
| overrides = self: super: { | ||
| # callCabal2nix is broken because of testu01 being missing so re-use splitmix drv | ||
| splitmix = overrideSrc | ||
| { src = nixpkgs.lib.sourceFilesBySuffices ./. [ ".hs" ".cabal" ".c" ".md" "LICENSE" ]; } | ||
| super.splitmix; | ||
| }; | ||
| }); | ||
| }; | ||
| }; | ||
| }; | ||
| }; | ||
| }; | ||
|
|
||
| build = version: getPkgs: ((getPkgs (mkNixpkgs version)).haskell.packages.${version}); | ||
|
|
||
| in { | ||
| native = build cachedPackageSetVersion (ps: ps); | ||
|
|
||
| freebsd = build cachedPackageSetVersion (ps: ps.pkgsCross.x86_64-freebsd); | ||
|
|
||
| android = build "ghc910" (ps: ps.pkgsCross.aarch64-android-prebuilt.pkgsStatic); | ||
|
|
||
| js = build "ghc912" (ps: ps.pkgsCross.ghcjs); | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is not needed I think, given the normal cabal flow, mostly added out of completeness