-
Notifications
You must be signed in to change notification settings - Fork 26
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
Conversation
native: | ||
nix-build -A native.splitmix |
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
js: | ||
nix-build -A js.splitmix | ||
|
||
wasm: |
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.
Not in nixpkgs yet, so we're using ghc-wasm-meta for now.
wasm: | ||
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" |
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.
I wonder if -single-threaded
should instead be conditionally enabled in the .cabal since wasm backend does not currently support -threaded
so for now downstream will have to disable at least that test suite
source-repository-package | ||
type: git | ||
location: https://github.com/haskell-wasm/hostname | ||
tag: 8d110f03b3117af233683ac90b125fcfc767a2ef |
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.
I assume this will eventually get upstreamed (we are the inconvenienced downstream in this case)
Sorry, but I wont work with nix based solutions. I'm not versatile in Nix and nix scripts always bitrot sooner that I'd hope (though the promise is that they wont). |
cc @amesgen @Bodigrim @dmjio @maralorn @TerrorJack @ymeister
Problem
There've been several issues/PRs to splitmix attempting fixes for a platform that are generally hard to test on the maintainer side, and sometimes also end up breaking another platform in the process.
It seems to me there are two main sources of burden to maintainers when it comes to cross-platform support:
One suggested approach was to have a fork per platform, but if we want to minimize the aggregated ecosystem effort, it's better to handle things in one place, instead of having multiple downstreams project re-discover the forks and add them as patches for each platform they need.
Solution
With this PR I add a few helpers using the nixpkgs cross infrastructure to target several platforms (when compatible with the build platform).
If desired, these can be added to CI (potentially blocking merges and/or releases).
This would simplify the 'detecting' bit at the cost of a new bit of burden on maintaining the .nix.
I can commit to that maintenance and I believe several others would agree to commit as well since that sort of work has been happening already, just scattered across repos. There's certainly been override/patch/source-repository-package juggling happening on nixpkgs/miso/reflex-dom/etc for a while, and this approach already seems like less work to me.
As for 'fixing', it should becomes less of a concern if we break things less.
So far I've only described building, and nothing about detecting/fixing runtime failures, which is the case for #75.
Currently, this PR only runs wasm tests, but the idea is to gradually expand coverage.
Usage