Skip to content

Instantly share code, notes, and snippets.

@anxiousmodernman
Last active May 12, 2019 15:57
Show Gist options
  • Save anxiousmodernman/712166713d041ae62cd926c3dc783f28 to your computer and use it in GitHub Desktop.
Save anxiousmodernman/712166713d041ae62cd926c3dc783f28 to your computer and use it in GitHub Desktop.
deno build for Centos 7
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
# Make sure you have the specs for this!
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.cpus = 4
end
config.vm.provision "shell", inline: <<-SHELL
yum update
yum install -y git glibc-static curl vim gcc clang wget
wget https://nodejs.org/dist/v10.15.3/node-v10.15.3-linux-x64.tar.xz
tar --strip-components 1 -xvf node-v* -C /usr/local
SHELL
$script = <<-SHELL
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain \"nightly\"
git clone --recurse-submodules https://github.com/denoland/deno.git
cd deno
sed -i '/default_args/a use_sysroot = false' .gn
SHELL
config.vm.provision "shell", inline: $script, privileged: false
# To build:
# vagrant up
# vagrant ssh
# cd deno
# ./tools/setup.py
# ./tools/build.py
#
# Sometimes I have to run the build twice :(
#
# After a successful build, get the binary out from the host machine:
# scp -i .vagrant/machines/default/virtualbox/private_key -P 2222 vagrant@127.0.0.1:/home/vagrant/deno/target/debug/deno .
end
@anxiousmodernman
Copy link
Author

anxiousmodernman commented May 11, 2019

Sometimes, the initial build fails after hanging for a long time, but a subsequent build succeeds (quickly!)

[vagrant@localhost deno]$ time ./tools/build.py
ninja: Entering directory `/home/vagrant/deno/target/debug'
[591/659] CXX obj/third_party/v8/torque_generated_initializers/torque_generated_initializers_jumbo_1.o
FAILED: obj/third_party/v8/torque_generated_initializers/torque_generated_initializers_jumbo_1.o
/home/vagrant/deno/prebuilt/linux64/sccache ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/third_party/v8/torque_generated_initializers/torque_generated_initializers_jumbo_1.o.d -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DCHROMIUM_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCR_CLANG_REVISION=\"357692-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -DCR_LIBCXX_REVISION=358423 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -DENABLE_DISASSEMBLER -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 -DENABLE_MINOR_MC -DOBJECT_PRINT -DVERIFY_HEAP -DV8_TRACE_MAPS -DV8_ENABLE_ALLOCATION_TIMEOUT -DV8_ENABLE_FORCE_SLOW_PATH -DENABLE_HANDLE_ZAPPING -DV8_USE_SNAPSHOT -DV8_SNAPSHOT_NATIVE_CODE_COUNTERS -DV8_CONCURRENT_MARKING -DV8_CHECK_MICROTASKS_SCOPES_CONSISTENCY -DV8_EMBEDDED_BUILTINS -DV8_WIN64_UNWINDING_INFO -DV8_ENABLE_CHECKS -DV8_TARGET_ARCH_X64 -DDEBUG -DDISABLE_UNTRUSTED_CODE_MITIGATIONS -DV8_ENABLE_CHECKS -I. -I../.. -Igen -I../../third_party/v8 -Igen/third_party/v8 -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -B../../third_party/binutils/Linux_x64/Release/bin -pthread -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -fcomplete-member-pointers -m64 -march=x86-64 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -Wall -Werror -Wextra -Wimplicit-fallthrough -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-ignored-pragma-optimize -fno-omit-frame-pointer -g1 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wmissing-field-initializers -Wunreachable-code -Wshorten-64-to-32 -O3 -fno-ident -fdata-sections -ffunction-sections -Wexit-time-destructors -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++14 -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include -fvisibility-inlines-hidden -c gen/third_party/v8/torque_generated_initializers_jumbo_1.cc -o obj/third_party/v8/torque_generated_initializers/torque_generated_initializers_jumbo_1.o
clang++: error: unable to execute command: Killed
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 9.0.0 (trunk 357692)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/vagrant/deno/target/debug/../../third_party/llvm-build/Release+Asserts/bin
clang++: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang++: error: unable to make temporary file: No such file or directory
clang++: note: diagnostic msg: Error generating preprocessed source(s).
[596/659] CXX obj/third_party/v8/v8_initializers/v8_initializers_jumbo_1.o
ninja: build stopped: subcommand failed.

real    41m29.703s
user    11m40.106s
sys     9m14.958s
[vagrant@localhost deno]$ time ./tools/build.py
ninja: Entering directory `/home/vagrant/deno/target/debug'
[64/64] STAMP obj/default.stamp

real    1m57.606s
user    2m12.905s
sys     0m8.399s

[vagrant@localhost deno]$ ./target/debug/deno
> console.log("hello world!")
hello world!
undefined
> exit

Note that deno appears to build successfully the second time.

@anxiousmodernman
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment