Closed hsyl20 closed 1 year ago
How can we test this in CI?
You need to build GHC with the JS backend enabled. Apparently CI is using ghcup so it would be good to fix https://github.com/haskell/ghcup-hs/issues/838 first
@hsyl20 it's fine to add a custom CI job, which manually grabs GHC JS from elsewhere, without ghcup
, if it's easier. But I'm reluctant to merge without one.
it's fine to add a custom CI job, which manually grabs GHC JS from elsewhere, without ghcup, if it's easier. But I'm reluctant to merge without one.
We're in the process of fixing GHCup to build cross-compilers. Moritz, however, suggested that we use the haskell.nix infrastructure to avoid the build times. I'll try this.
Moritz, however, suggested that we use the haskell.nix infrastructure to avoid the build times. I'll try this.
I personally don't want to maintain nix code in CI.
GHCup should be fixed to be able to install cross toolchain from bindist as well.
I personally don't want to maintain nix code in CI.
Nix would only be used to provide the environment with the appropriate ghc (nix shell some_url
). Does that count as nix code? :)
GHCup should be fixed to be able to install cross toolchain from bindist as well.
Sadly upstream doesn't provide JS bindists. Does ghcup already provide custom bindists (and where are they hosted)?
Nix would only be used to provide the environment with the appropriate ghc (nix shell some_url). Does that count as nix code? :)
Yes, my experience with nix has been rather negative and I want to avoid pinging other people whenever there's a problem with it (and IME, there are a lot).
Sadly upstream doesn't provide JS bindists.
We can just build our own.
@bgamari the reason we insist on GitHub CI job is so that the feature does not get accidentally broken in the very next commit. We cannot really tell all future contributors "go bump a submodule in GHC source tree and check that it works, then report back".
ghcup is very close to being able to install ghc JS cross from bindist. I already built one: https://downloads.haskell.org/~ghcup/unofficial-bindists/ghc/javascript-unknown-ghcjs-9.6.2/
It'll require another ghcup release first. Then we'll maintain a separate ghcup metadata for JS.
I've opened https://github.com/haskell/unix/pull/290 to make the testsuite runnable with GHC head+!10900 built with the JS backend. I just have to rebase and to add a test for this PR.
CI will be more difficult because we need to use GHC 9.8 at least. But releasing 9.8 might be blocked on this...
Can't we just build a bindist from the current 9.8 branch?
I already have ghcup CI that tests ghcup compile ghc
against JS cross: https://github.com/haskell/ghcup-hs/actions/runs/5593656559
I don't think CI is prerequisite to get this merged, but it needs to remain a TODO list, so that we don't regress.
Can't we just build a bindist from the current 9.8 branch?
After https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10900 is backported, we can.
I don't think CI is prerequisite to get this merged, but it needs to remain a TODO list, so that we don't regress.
I've opened https://github.com/haskell/unix/issues/291 to track this.
I'm working on a test for this PR but I need https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10909 to fix createFile
and https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10912 to fix getFileStatus
...
@hsyl20 could you please rebase? How can I test this patch manually?
@Bodigrim I'm on vacation this week but next week sure. I have a wip test but it isn't complete yet. There is also a test for touchFd in the ghc MR.
I've rebased. Test is stil wip and depends on (at least) https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10909 (currently being merged).
In particular, add support for
touchFd
required here: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9237Cc @bgamari