commit 37eb08fc9643749d4bfe602b6aca5dc1dcefcaf5 Author: Georg Koppen gk@torproject.org Date: Sun Jan 12 20:39:47 2020 +0000
Bug 32436: Add lucetc project for RLBox --- projects/lucetc/build | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ projects/lucetc/config | 35 +++++++++++++++++++++++++++++++++++ projects/rust/config | 10 ++++++++-- 3 files changed, 91 insertions(+), 2 deletions(-)
diff --git a/projects/lucetc/build b/projects/lucetc/build new file mode 100644 index 0000000..0157cc9 --- /dev/null +++ b/projects/lucetc/build @@ -0,0 +1,48 @@ +#!/bin/bash +[% c("var/set_default_env") -%] +[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %] +distdir=/var/tmp/dist +builddir=/var/tmp/build/[% project %] + +mkdir -p $distdir +tar -C /var/tmp/dist -xf [% c('input_files_by_name/cmake') %] +tar -C /var/tmp/dist -xf [% c('input_files_by_name/clang') %] +tar -C /var/tmp/dist -xf [% c('input_files_by_name/binutils') %] +tar -C /var/tmp/dist -xf [% c('input_files_by_name/rust') %] +tar -C /var/tmp/dist -xf [% c('input_files_by_name/wasi-sysroot') %] +export PATH="/var/tmp/dist/cmake/bin:/var/tmp/dist/clang/bin:/var/tmp/dist/binutils/bin:/var/tmp/dist/rust/bin:$PATH" +export CC=$distdir/clang/bin/clang +export CFLAGS="-L$distdir/clang/lib" +export CXXFLAGS=$CFLAGS +export CXX=$distdir/clang/bin/clang++ +export AR=$distdir/clang/bin/llvm-ar +export RUSTFLAGS="-C linker=$CXX -C link-arg=$CXXFLAGS" +export LUCET_PREFIX=$distdir/[% project %] +export WASI_SYSROOT=$distdir/wasi-sysroot + +mkdir -p /var/tmp/build +tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz + +# Now prepare the offline build +# Move the directory for hardcoding the path in .cargo/config +mv /var/tmp/build/[% project %]-[% c('version') %] $builddir +tar -C $builddir -xjf lucetc-vendor.tar.bz2 +cd $builddir +# .cargo exists already, let's just add to it +cat >> .cargo/config << 'EOF' + +[source.crates-io] +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "/var/tmp/build/lucetc/vendor" +EOF + +make -j[% c("buildconf/num_procs") %] build +make install + +cd $distdir +[% c('tar', { + tar_src => [ project ], + tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'), + }) %] diff --git a/projects/lucetc/config b/projects/lucetc/config new file mode 100644 index 0000000..647d83f --- /dev/null +++ b/projects/lucetc/config @@ -0,0 +1,35 @@ +# vim: filetype=yaml sw=2 +filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %]' +version: '[% c("abbrev") %]' +git_hash: 5c22392b5b1aaa60e915c75e92b57391e1e61e6d +git_url: https://github.com/PLSysSec/lucet_sandbox_compiler/ +git_submodule: 1 + +var: + container: + use_container: 1 + +input_files: + - project: container-image + # Our clang still needs GCC parts (libstdc++ for instance) so we include that + # one here even though compilation gets done solely by clang. + - name: '[% c("var/compiler") %]' + project: '[% c("var/compiler") %]' + - name: cmake + project: cmake + - name: clang + project: clang + - name: binutils + project: binutils + - name: rust + project: rust + input_file_var: + # lucetc needs Rust >= 1.36.0 + rust_version: 1.36.0 + prev_version: 1.35.0 + - name: wasi-sysroot + project: wasi-sysroot + # `cargo vendor vendor` in the `lucetc-sandbox-compiler` directory has vendored + # the sources. + - URL: https://people.torproject.org/~gk/mirrors/sources/lucetc-vendor.tar.bz2 + sha256sum: 5a7802834d0d4b9210f323cf69cc305946f22dba4ddaf2c4c0eb6d3621da2c2a diff --git a/projects/rust/config b/projects/rust/config index 848ccd0..13aad3e 100644 --- a/projects/rust/config +++ b/projects/rust/config @@ -1,9 +1,15 @@ # vim: filetype=yaml sw=2 filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz' -version: 1.34.2 +version: '[% c("input_file_var/rust_version") %]'
-var: +# those values can be changed from the input_files section of other +# projects. See projects/lucetc/config and bug 32436. +input_file_var: + rust_version: 1.34.2 prev_version: 1.33.0 + +var: + prev_version: '[% c("input_file_var/prev_version") %]' container: use_container: 1
tor-commits@lists.torproject.org