[tor-commits] [tor-browser-build/master] Bug 32437: Add wasi-sysroot project for RLBox

boklm at torproject.org boklm at torproject.org
Wed Feb 26 20:12:34 UTC 2020


commit e8574bbde076ba917f4d3fd3e71c6c7ee10716c4
Author: Georg Koppen <gk at torproject.org>
Date:   Sun Jan 12 20:38:10 2020 +0000

    Bug 32437: Add wasi-sysroot project for RLBox
---
 projects/ninja/build               | 21 +++++++++++++++++++++
 projects/ninja/config              | 16 ++++++++++++++++
 projects/wasi-sysroot/build        | 32 ++++++++++++++++++++++++++++++++
 projects/wasi-sysroot/config       | 28 ++++++++++++++++++++++++++++
 projects/wasi-sysroot/no-git.patch | 28 ++++++++++++++++++++++++++++
 5 files changed, 125 insertions(+)

diff --git a/projects/ninja/build b/projects/ninja/build
new file mode 100644
index 0000000..6500ca7
--- /dev/null
+++ b/projects/ninja/build
@@ -0,0 +1,21 @@
+#!/bin/bash
+[% c("var/set_default_env") -%]
+distdir=/var/tmp/dist/[% project %]
+[% IF c("var/linux") %]
+  [% pc('gcc', 'var/setup', { compiler_tarfile => c('input_files_by_name/gcc'),
+                              hardened_gcc => 0 }) %]
+[% END -%]
+[% pc('python', 'var/setup', { python_tarfile => c('input_files_by_name/python') }) %]
+mkdir /var/tmp/build
+tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
+cd /var/tmp/build/[% project %]-[% c('version') %]
+
+./configure.py --bootstrap
+
+mkdir $distdir
+cp ninja $distdir
+cd /var/tmp/dist
+[% c('tar', {
+        tar_src => [ project ],
+        tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
+    }) %]
diff --git a/projects/ninja/config b/projects/ninja/config
new file mode 100644
index 0000000..8615511
--- /dev/null
+++ b/projects/ninja/config
@@ -0,0 +1,16 @@
+# vim: filetype=yaml sw=2
+version: '[% c("abbrev") %]'
+git_url: https://github.com/ninja-build/ninja.git
+git_hash: b25c08bda4949192c69cea4cee057887341a2ffc #v1.9.0
+filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
+var:
+  container:
+    use_container: 1
+
+input_files:
+  - project: container-image
+  - name: '[% c("var/compiler") %]'
+    project: '[% c("var/compiler") %]'
+    enable: '[% c("var/linux") %]'
+  - name: python
+    project: python
diff --git a/projects/wasi-sysroot/build b/projects/wasi-sysroot/build
new file mode 100644
index 0000000..5ea885c
--- /dev/null
+++ b/projects/wasi-sysroot/build
@@ -0,0 +1,32 @@
+#!/bin/bash
+[% c("var/set_default_env") -%]
+# We need a link to our GCC, otherwise the system cc gets used which points to
+# /usr/bin/gcc.
+[% pc('gcc', 'var/setup', { compiler_tarfile => c('input_files_by_name/gcc'),
+                            hardened_gcc => 0 }) %]
+ln -s gcc /var/tmp/dist/gcc/bin/cc
+
+distdir=/var/tmp/dist
+builddir=/var/tmp/build/[% project %]
+mkdir -p $distdir
+tar -C /var/tmp/dist -xf [% c('input_files_by_name/binutils') %]
+tar -C /var/tmp/dist -xf [% c('input_files_by_name/cmake') %]
+tar -C /var/tmp/dist -xf [% c('input_files_by_name/ninja') %]
+export PATH=/var/tmp/dist/binutils/bin:/var/tmp/dist/cmake/bin:/var/tmp/dist/ninja:$PATH
+
+mkdir -p /var/tmp/build
+tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
+
+mv /var/tmp/build/[% project %]-[% c('version') %] $builddir
+cd $builddir
+# We have no .git in our tar ball but the Makefile depends on that. Just
+# hard-code the version for now.
+patch -p1 < $rootdir/no-git.patch
+
+make -j[% c("buildconf/num_procs") %] PREFIX=$distdir/[% project %]
+
+cd $distdir
+[% c('tar', {
+        tar_src => [ project ],
+        tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
+    }) %]
diff --git a/projects/wasi-sysroot/config b/projects/wasi-sysroot/config
new file mode 100644
index 0000000..512769b
--- /dev/null
+++ b/projects/wasi-sysroot/config
@@ -0,0 +1,28 @@
+# vim: filetype=yaml sw=2
+filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %]'
+version: '[% c("abbrev") %]'
+git_hash: 87b7a019472770f08d49cf3b558867dc76ea74eb
+git_url: https://github.com/CraneStation/wasi-sdk
+git_submodule: 1
+
+var:
+  container:
+    use_container: 1
+
+targets:
+  linux:
+    var:
+      arch_deps:
+        - patch
+
+input_files:
+  - project: container-image
+  - name: gcc
+    project: gcc
+  - name: binutils
+    project: binutils
+  - name: cmake
+    project: cmake
+  - name: ninja
+    project: ninja
+  - filename: no-git.patch
diff --git a/projects/wasi-sysroot/no-git.patch b/projects/wasi-sysroot/no-git.patch
new file mode 100644
index 0000000..27c3446
--- /dev/null
+++ b/projects/wasi-sysroot/no-git.patch
@@ -0,0 +1,28 @@
+From 55a106779cd012f9cf5d6f46a7a3523de9ba93c3 Mon Sep 17 00:00:00 2001
+From: Georg Koppen <gk at torproject.org>
+Date: Sat, 7 Dec 2019 16:12:42 +0000
+Subject: [PATCH] No .git in our tarball
+
+
+diff --git a/Makefile b/Makefile
+index f09a901..dc114cb 100644
+--- a/Makefile
++++ b/Makefile
+@@ -6,11 +6,11 @@ LLVM_PROJ_DIR?=$(ROOT_DIR)/src/llvm-project
+ PREFIX?=/opt/wasi-sdk
+ 
+ CLANG_VERSION=$(shell ./llvm_version.sh $(LLVM_PROJ_DIR))
+-VERSION:=$(shell ./version.sh)
+-DEBUG_PREFIX_MAP=-fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v$(VERSION)
++#VERSION:=$(shell ./version.sh)
++DEBUG_PREFIX_MAP=-fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v8.1g5225b05436ce
+ 
+ default: build
+-	@echo "Use -fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v$(VERSION)"
++	@echo "Use -fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v8.1g5225b05436ce"
+ 
+ clean:
+ 	rm -rf build $(PREFIX)
+-- 
+2.24.0
+



More information about the tor-commits mailing list