Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghc-wasm-meta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
haskell-wasm
ghc-wasm-meta
Merge requests
!2
Add README
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add README
wip/readme
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Cheng Shao
requested to merge
wip/readme
into
master
2 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
53c35feb
1 commit,
2 years ago
1 file
+
51
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
README.md
0 → 100644
+
51
−
0
Options
# `ghc-wasm-meta`
This repo provides convenient methods of using x86_64-linux binary
artifacts of GHC's wasm backend.
## Getting started as a nix flake
This repo is a nix flake. The default output is a derivation that
bundles all provided tools:
```
sh
$
nix shell https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/archive/master/ghc-wasm-meta-master.tar.gz
$
echo
'main = putStrLn "hello world"'
>
hello.hs
$
wasm32-wasi-ghc hello.hs
-o
hello.wasm
[
1 of 2] Compiling Main
(
hello.hs, hello.o
)
[
2 of 2] Linking hello.wasm
$
wasm-run ./hello.wasm
hello world
```
First start will download a bunch of stuff, but won't take too long
since it just patches the binaries and performs little real
compilation. There is no need to set up a binary cache.
## Getting started without nix
For Ubuntu 20.04 and similar glibc-based distros, this repo provides a
`setup.sh`
script that installs the provided tools to
`~/.ghc-wasm`
:
```
sh
$
./setup.sh
...
Everything
set
up
in
/home/username/.ghc-wasm.
Run
'source /home/username/.ghc-wasm/env'
to add tools to your PATH.
```
After installing,
`~/.ghc-wasm`
will contain:
-
`env`
which can be sourced into the current shell to add the tools
to
`PATH`
-
`add_to_github_path.sh`
which can be run in GitHub actions, so
later steps in the same job can access the tools from
`PATH`
`setup.sh`
can be configured via these environment variables:
-
`PREFIX`
: installation destination, defaults to
`~/.ghc-wasm`
-
`BIGNUM_BACKEND`
: which
`ghc-bignum`
backend to use, can be either
`gmp`
or
`native`
, defaults to
`gmp`
-
`SKIP_GHC`
: set this to skip installing
`cabal`
and
`ghc`
`setup.sh`
requires
`cc`
,
`curl`
,
`jq`
,
`unzip`
to run.
Loading