lol

tinygo: 0.37.0 -> 0.39.0

+18 -25
+10 -12
pkgs/by-name/ti/tinygo/0001-GNUmakefile.patch
··· 1 diff --git a/GNUmakefile b/GNUmakefile 2 --- a/GNUmakefile 3 +++ b/GNUmakefile 4 - @@ -14,11 +14,6 @@ LLVM_VERSIONS = 19 18 17 16 15 5 errifempty = $(if $(1),$(1),$(error $(2))) 6 detect = $(shell which $(call errifempty,$(firstword $(foreach p,$(2),$(shell command -v $(p) 2> /dev/null && echo $(p)))),failed to locate $(1) at any of: $(2))) 7 toolSearchPathsVersion = $(1)-$(2) 8 - -ifeq ($(shell uname -s),Darwin) 9 - # Also explicitly search Brew's copy, which is not in PATH by default. 10 - BREW_PREFIX := $(shell brew --prefix) 11 - toolSearchPathsVersion += $(BREW_PREFIX)/opt/llvm@$(2)/bin/$(1)-$(2) $(BREW_PREFIX)/opt/llvm@$(2)/bin/$(1) ··· 13 # First search for a custom built copy, then move on to explicitly version-tagged binaries, then just see if the tool is in path with its normal name. 14 findLLVMTool = $(call detect,$(1),$(abspath llvm-build/bin/$(1)) $(foreach ver,$(LLVM_VERSIONS),$(call toolSearchPathsVersion,$(1),$(ver))) $(1)) 15 CLANG ?= $(call findLLVMTool,clang) 16 - @@ -939,10 +934,9 @@ endif 17 wasmtest: 18 $(GO) test ./tests/wasm 19 20 - -build/release: tinygo gen-device wasi-libc $(if $(filter 1,$(USE_SYSTEM_BINARYEN)),,binaryen) 21 +build/release: 22 @mkdir -p build/release/tinygo/bin 23 @mkdir -p build/release/tinygo/lib/bdwgc 24 - @mkdir -p build/release/tinygo/lib/clang/include 25 @mkdir -p build/release/tinygo/lib/CMSIS/CMSIS 26 @mkdir -p build/release/tinygo/lib/macos-minimal-sdk 27 - @mkdir -p build/release/tinygo/lib/mingw-w64/mingw-w64-crt/lib-common 28 - @@ -964,7 +958,6 @@ ifneq ($(USE_SYSTEM_BINARYEN),1) 29 @cp -p build/wasm-opt$(EXE) build/release/tinygo/bin 30 endif 31 @cp -rp lib/bdwgc/* build/release/tinygo/lib/bdwgc ··· 33 @cp -rp lib/CMSIS/CMSIS/Include build/release/tinygo/lib/CMSIS/CMSIS 34 @cp -rp lib/CMSIS/README.md build/release/tinygo/lib/CMSIS 35 @cp -rp lib/macos-minimal-sdk/* build/release/tinygo/lib/macos-minimal-sdk 36 - @@ -1026,8 +1019,7 @@ endif 37 - @cp -rp lib/wasi-libc/libc-top-half/musl/include build/release/tinygo/lib/wasi-libc/libc-top-half/musl 38 - @cp -rp lib/wasi-libc/sysroot build/release/tinygo/lib/wasi-libc/sysroot 39 @cp -rp lib/wasi-cli/wit build/release/tinygo/lib/wasi-cli/wit 40 - @cp -rp llvm-project/compiler-rt/lib/builtins build/release/tinygo/lib/compiler-rt-builtins 41 - @cp -rp llvm-project/compiler-rt/LICENSE.TXT build/release/tinygo/lib/compiler-rt-builtins ··· 43 @cp -rp src build/release/tinygo/src 44 @cp -rp targets build/release/tinygo/targets 45 46 - -- 47 - 2.48.1 48 -
··· 1 diff --git a/GNUmakefile b/GNUmakefile 2 + index f078bde5..901c8e08 100644 3 --- a/GNUmakefile 4 +++ b/GNUmakefile 5 + @@ -21,11 +21,6 @@ LLVM_VERSIONS = 19 18 17 16 15 6 errifempty = $(if $(1),$(1),$(error $(2))) 7 detect = $(shell which $(call errifempty,$(firstword $(foreach p,$(2),$(shell command -v $(p) 2> /dev/null && echo $(p)))),failed to locate $(1) at any of: $(2))) 8 toolSearchPathsVersion = $(1)-$(2) 9 + -ifeq ($(uname),Darwin) 10 - # Also explicitly search Brew's copy, which is not in PATH by default. 11 - BREW_PREFIX := $(shell brew --prefix) 12 - toolSearchPathsVersion += $(BREW_PREFIX)/opt/llvm@$(2)/bin/$(1)-$(2) $(BREW_PREFIX)/opt/llvm@$(2)/bin/$(1) ··· 14 # First search for a custom built copy, then move on to explicitly version-tagged binaries, then just see if the tool is in path with its normal name. 15 findLLVMTool = $(call detect,$(1),$(abspath llvm-build/bin/$(1)) $(foreach ver,$(LLVM_VERSIONS),$(call toolSearchPathsVersion,$(1),$(ver))) $(1)) 16 CLANG ?= $(call findLLVMTool,clang) 17 + @@ -942,10 +937,9 @@ endif 18 wasmtest: 19 $(GO) test ./tests/wasm 20 21 + -build/release: tinygo gen-device $(if $(filter 1,$(USE_SYSTEM_BINARYEN)),,binaryen) 22 +build/release: 23 @mkdir -p build/release/tinygo/bin 24 @mkdir -p build/release/tinygo/lib/bdwgc 25 - @mkdir -p build/release/tinygo/lib/clang/include 26 @mkdir -p build/release/tinygo/lib/CMSIS/CMSIS 27 @mkdir -p build/release/tinygo/lib/macos-minimal-sdk 28 + @mkdir -p build/release/tinygo/lib/mingw-w64/mingw-w64-crt/crt 29 + @@ -968,7 +962,6 @@ ifneq ($(USE_SYSTEM_BINARYEN),1) 30 @cp -p build/wasm-opt$(EXE) build/release/tinygo/bin 31 endif 32 @cp -rp lib/bdwgc/* build/release/tinygo/lib/bdwgc ··· 34 @cp -rp lib/CMSIS/CMSIS/Include build/release/tinygo/lib/CMSIS/CMSIS 35 @cp -rp lib/CMSIS/README.md build/release/tinygo/lib/CMSIS 36 @cp -rp lib/macos-minimal-sdk/* build/release/tinygo/lib/macos-minimal-sdk 37 + @@ -1060,8 +1053,7 @@ endif 38 + @cp -rp lib/wasi-libc/libc-top-half/musl/src/unistd build/release/tinygo/lib/wasi-libc/libc-top-half/musl/src 39 + @cp -rp lib/wasi-libc/libc-top-half/sources build/release/tinygo/lib/wasi-libc/libc-top-half 40 @cp -rp lib/wasi-cli/wit build/release/tinygo/lib/wasi-cli/wit 41 - @cp -rp llvm-project/compiler-rt/lib/builtins build/release/tinygo/lib/compiler-rt-builtins 42 - @cp -rp llvm-project/compiler-rt/LICENSE.TXT build/release/tinygo/lib/compiler-rt-builtins ··· 44 @cp -rp src build/release/tinygo/src 45 @cp -rp targets build/release/tinygo/targets 46
+8 -13
pkgs/by-name/ti/tinygo/package.nix
··· 4 buildGoModule, 5 fetchFromGitHub, 6 makeWrapper, 7 - llvmPackages, 8 go, 9 xar, 10 binaryen, ··· 16 }: 17 18 let 19 llvmMajor = lib.versions.major llvm.version; 20 - inherit (llvmPackages) 21 llvm 22 clang 23 compiler-rt ··· 34 35 buildGoModule rec { 36 pname = "tinygo"; 37 - version = "0.37.0"; 38 39 src = fetchFromGitHub { 40 owner = "tinygo-org"; 41 repo = "tinygo"; 42 tag = "v${version}"; 43 - hash = "sha256-I/9JXjt6aF/80Mh3iRgUYXv4l+m3XIpmKsIBviOuWCo="; 44 fetchSubmodules = true; 45 # The public hydra server on `hydra.nixos.org` is configured with 46 # `max_output_size` of 3GB. The purpose of this `postFetch` step ··· 51 ''; 52 }; 53 54 - vendorHash = "sha256-juADakh+s8oEY9UXUwxknvVeL1TgB/zRi8Xtzt/4qPA="; 55 56 patches = [ 57 ./0001-GNUmakefile.patch ··· 76 "-X github.com/tinygo-org/tinygo/goenv.TINYGOROOT=${placeholder "out"}/share/tinygo" 77 "-X github.com/tinygo-org/tinygo/goenv.clangResourceDir=${clang.cc.lib}/lib/clang/${llvmMajor}" 78 ]; 79 subPackages = [ "." ]; 80 81 # Output contains static libraries for different arm cpus ··· 104 # Move binary 105 mkdir -p build 106 mv $GOPATH/bin/tinygo build/tinygo 107 - 108 - # Build our own custom wasi-libc. 109 - # This is necessary because we modify the build a bit for our needs (disable 110 - # heap, enable debug symbols, etc). 111 - make wasi-libc \ 112 - CLANG="${lib.getBin clang.cc}/bin/clang -resource-dir ${clang.cc.lib}/lib/clang/${llvmMajor}" \ 113 - LLVM_AR=${lib.getBin llvm}/bin/llvm-ar \ 114 - LLVM_NM=${lib.getBin llvm}/bin/llvm-nm 115 116 make gen-device -j $NIX_BUILD_CORES 117
··· 4 buildGoModule, 5 fetchFromGitHub, 6 makeWrapper, 7 + llvmPackages_20, 8 go, 9 xar, 10 binaryen, ··· 16 }: 17 18 let 19 + # nixpkgs typically updates default llvm version faster than tinygo releases 20 + # which ends up breaking this build. Use fixed version for each release. 21 llvmMajor = lib.versions.major llvm.version; 22 + inherit (llvmPackages_20) 23 llvm 24 clang 25 compiler-rt ··· 36 37 buildGoModule rec { 38 pname = "tinygo"; 39 + version = "0.39.0"; 40 41 src = fetchFromGitHub { 42 owner = "tinygo-org"; 43 repo = "tinygo"; 44 tag = "v${version}"; 45 + hash = "sha256-uooBZl4u9EHfs1DTI/dQ9Uz1uVOmRcIClEMB7D1q8Lk="; 46 fetchSubmodules = true; 47 # The public hydra server on `hydra.nixos.org` is configured with 48 # `max_output_size` of 3GB. The purpose of this `postFetch` step ··· 53 ''; 54 }; 55 56 + vendorHash = "sha256-Vae7IFACioxH4E61GX/X7G19/ITbajp96VNUhliV8ls="; 57 58 patches = [ 59 ./0001-GNUmakefile.patch ··· 78 "-X github.com/tinygo-org/tinygo/goenv.TINYGOROOT=${placeholder "out"}/share/tinygo" 79 "-X github.com/tinygo-org/tinygo/goenv.clangResourceDir=${clang.cc.lib}/lib/clang/${llvmMajor}" 80 ]; 81 + tags = [ "llvm${llvmMajor}" ]; 82 subPackages = [ "." ]; 83 84 # Output contains static libraries for different arm cpus ··· 107 # Move binary 108 mkdir -p build 109 mv $GOPATH/bin/tinygo build/tinygo 110 111 make gen-device -j $NIX_BUILD_CORES 112