Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github actions part 2 #2

Merged
merged 27 commits into from
Nov 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ci

on: [pull_request] # TODO(ry) [push, pull_request]
on: [push] # TODO(ry) [push, pull_request]

jobs:
build:
Expand All @@ -9,7 +9,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
os: [macOS-10.14, windows-2019, ubuntu-16.04]
os: [macOS-10.14, ubuntu-16.04] # TODO(ry) windows-2019
steps:
- name: Configure git
run: git config --global core.symlinks true
Expand Down Expand Up @@ -46,15 +46,15 @@ jobs:
curl -LO https://github.com/mozilla/sccache/releases/download/0.2.12/sccache-0.2.12-x86_64-unknown-linux-musl.tar.gz
tar -xzvf sccache-0.2.12-x86_64-unknown-linux-musl.tar.gz
echo ::add-path::`pwd`/sccache-0.2.12-x86_64-unknown-linux-musl/
echo ::add-path::`pwd`/third_party/sscache/linux64
echo ::add-path::`pwd`/target/release
echo ::add-path::`pwd`/third_party/depot_tools/

- name: Environment (mac)
if: startsWith(matrix.os, 'macOS')
run: |
curl -LO https://github.com/mozilla/sccache/releases/download/0.2.12/sccache-0.2.12-x86_64-apple-darwin.tar.gz
tar -xzvf sccache-0.2.12-x86_64-apple-darwin.tar.gz
echo ::add-path::`pwd`/sccache-0.2.12-x86_64-apple-darwin/
echo ::add-path::`pwd`/third_party/depot_tools/

- name: Environment (windows)
if: startsWith(matrix.os, 'windows')
Expand All @@ -65,22 +65,25 @@ jobs:
curl -LO https://github.com/mozilla/sccache/releases/download/0.2.12/sccache-0.2.12-x86_64-pc-windows-msvc.tar.gz
tar -zxvf sccache-0.2.12-x86_64-pc-windows-msvc.tar.gz
echo ::add-path::$(pwd)\sccache-0.2.12-x86_64-pc-windows-msvc\
echo ::add-path::$(pwd)\target\release
echo ::add-path::$(pwd)\third_party\depot_tools\

- name: Start sccache
env:
AWS_ACCESS_KEY_ID: AKIAIVRN52PLDBP55LBQ
AWS_ACCESS_KEY_ID: AKIA6QEJVNZDGHRMR2KF
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SCCACHE_BUCKET: deno-sccache
SCCACHE_IDLE_TIMEOUT: 0
run: sccache --start-server

- name: Build
run: cargo build -vv --release --locked --all-targets
run: |
git --version
cargo build -vv --release --locked --all-targets

- name: Test
if: matrix.kind == 'test'
run: cargo test -vv --release --locked --all-targets

- name: Clippy
run: cargo clippy --all-targets --release --locked -- -D clippy::all
run: |
rustup component add clippy
cargo clippy --all-targets --release --locked -- -D clippy::all
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
**/*.rs.bk
/third_party/.cipd/
/third_party/gclient_config.py_entries
/third_party/v8
/third_party/v8/
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# rusty_v8

[![Build Status](https://github.com/denoland/rusty_v8/workflows/ci/badge.svg?branch=master)](https://github.com/denoland/rusty_v8/actions)

This is a project to replace libdeno with a full V8 binding. It's very much
under construction and not usable. I'll update this message if it ever is.
37 changes: 29 additions & 8 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use cargo_gn;
use std::env;
use std::path::Path;
use std::path::PathBuf;
use std::process::Command;
use which::which;

Expand All @@ -25,7 +26,14 @@ fn main() {
println!("cargo:warning=Not using sccache");
}

let gn_out = cargo_gn::maybe_gen(".", gn_args);
// gn_root should be absolute.
let gn_root = env::current_dir()
.unwrap()
.into_os_string()
.into_string()
.unwrap();;

let gn_out = cargo_gn::maybe_gen(&gn_root, gn_args);
assert!(gn_out.exists());
assert!(gn_out.join("args.gn").exists());
cargo_gn::build("rusty_v8");
Expand All @@ -35,6 +43,7 @@ fn main() {
}
}

// TODO(ry) Remove
fn disable_depot_tools_update() {
Command::new("python")
.arg("third_party/depot_tools/update_depot_tools_toggle.py")
Expand All @@ -54,22 +63,34 @@ fn git_submodule_update() {
}

fn gclient_sync() {
let gclient = Path::new("third_party/depot_tools/gclient.py");
let root = env::current_dir().unwrap();
let third_party = root.join("third_party");
let gclient_rel = PathBuf::from("depot_tools/gclient.py");

if !gclient.exists() {
if !third_party.join(&gclient_rel).exists() {
git_submodule_update();
}
assert!(gclient.exists());
disable_depot_tools_update();
// Command::new(gclient config http://src.chromium.org/svn/trunk/src

println!(
"cargo:warning=Running gclient sync to download V8. This could take a while."
);

println!("cargo:warning=Running gclient sync to download V8. This could take a while.");
let mut cmd = Command::new("python");
cmd.arg("depot_tools/gclient.py");
cmd.current_dir(&third_party);
cmd.arg(&gclient_rel);
cmd.arg("sync");
cmd.arg("--gclientfile=gclient_config.py");
cmd.arg("--no-history");
cmd.arg("--shallow");
cmd.current_dir("third_party");
// cmd.arg("--verbose");
cmd.env("DEPOT_TOOLS_UPDATE", "0");
cmd.env("DEPOT_TOOLS_METRICS", "0");
cmd.env("GCLIENT_FILE", third_party.join("gclient_config.py"));
// We're not using Google's internal infrastructure.
cmd.env("DEPOT_TOOLS_WIN_TOOLCHAIN", "0");

println!("running: {:?}", cmd);
let status = cmd.status().expect("gclient sync failed");
assert!(status.success());
}
Expand Down
3 changes: 0 additions & 3 deletions env.bat

This file was deleted.

2 changes: 1 addition & 1 deletion testing
2 changes: 1 addition & 1 deletion third_party/depot_tools
Submodule depot_tools updated from acf922 to ba97f6
1 change: 1 addition & 0 deletions third_party/jinja2
1 change: 1 addition & 0 deletions third_party/markupsafe
25 changes: 25 additions & 0 deletions tools/gclient_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
solutions = [
{
'url': 'https://chromium.googlesource.com/v8/v8.git@7.9.317.12',
'name': 'v8',
'deps_file': 'DEPS',
'custom_deps': {
# 'v8/build': None,
'v8/third_party/catapult': None,
'v8/third_party/colorama/src': None,
'v8/testing/gmock': None,
'v8/tools/swarming_client': None,
'v8/tools/gyp': None,
'v8/third_party/instrumented_libraries': None,
'v8/third_party/android_tools': None,
# 'v8/third_party/depot_tools': None,
'v8/test/wasm-js': None,
'v8/test/benchmarks/data': None,
'v8/test/mozilla/data': None,
'v8/third_party/icu': None,
'v8/test/test262/data': None,
'v8/test/test262/harness': None,
'v8/tools/luci-go': None
}
}
]