aboutsummaryrefslogtreecommitdiffhomepage
path: root/flake.nix
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2023-10-14 14:03:57 +0200
committerRon Evans <[email protected]>2023-10-14 17:32:56 +0200
commit2d4307647e98f9abf05618b90a3f9658cee29d85 (patch)
treebf23d5201c5dcff3eba43e7db9ac0f7f2bcdbe03 /flake.nix
parent935a29310694f899601da14bb2d6e316b4f489c3 (diff)
downloadtinygo-2d4307647e98f9abf05618b90a3f9658cee29d85.tar.gz
tinygo-2d4307647e98f9abf05618b90a3f9658cee29d85.zip
nix: improve docs and add support for wasi-libc
I forgot a few things in the flake file, but now everything should be included.
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix14
1 files changed, 13 insertions, 1 deletions
diff --git a/flake.nix b/flake.nix
index 9116fd2df..60cb579b2 100644
--- a/flake.nix
+++ b/flake.nix
@@ -16,6 +16,17 @@
#
# tinygo version
#
+# But you'll need a bit more to make TinyGo actually able to compile code:
+#
+# make llvm-source # fetch compiler-rt
+# git submodule update --init # fetch lots of other libraries and SVD files
+# make gen-device -j4 # build src/device/*/*.go files
+# make wasi-libc # build support for wasi/wasm
+#
+# With this, you should have an environment that can compile anything - except
+# for the Xtensa architecture (ESP8266/ESP32) because support for that lives in
+# a separate LLVM fork.
+#
# You can also do many other things from this environment. Building and flashing
# should work as you're used to: it's not a VM or container so there are no
# access restrictions and you're running in the same host environment - just
@@ -55,7 +66,8 @@
shellHook= ''
# Ugly hack to make the Clang resources directory available.
# Perhaps there is a cleaner way to do it, but this works.
- export GOFLAGS="\"-ldflags=-X github.com/tinygo-org/tinygo/goenv.clangResourceDir=${llvmPackages_16.clang.cc.lib}/lib/clang/16"\"
+ export CLANG_RESOURCE_DIR="${llvmPackages_16.clang.cc.lib}/lib/clang/16"
+ export GOFLAGS="\"-ldflags=-X github.com/tinygo-org/tinygo/goenv.clangResourceDir=$CLANG_RESOURCE_DIR"\"
'';
};
}