1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 23:59:59 -05:00

Remove DENO_BUILD_MODE and DENO_BUILD_PATH (#4431)

* Remove DENO_BUILD_MODE and DENO_BUILD_PATH

Also remove outdated docs related to ninja/gn.

* fix

* remove parameter to build_mode()

* remove arg parsing from benchmark.py
This commit is contained in:
Ryan Dahl 2020-03-20 21:48:34 -04:00 committed by GitHub
parent 77a44163fb
commit 0adc86f105
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 69 deletions

View file

@ -29,7 +29,6 @@ jobs:
env:
RUST_BACKTRACE: full
DENO_BUILD_MODE: release
RUSTC_WRAPPER: sccache
V8_BINARY: true
@ -157,9 +156,7 @@ jobs:
- name: Build debug
if: matrix.kind == 'test_debug'
run: |
echo ::set-env name=DENO_BUILD_MODE::debug
cargo build --locked --all-targets
run: cargo build --locked --all-targets
- name: Test release
if: matrix.kind == 'test_release'
@ -167,13 +164,11 @@ jobs:
- name: Test debug
if: matrix.kind == 'test_debug'
run: |
echo ::set-env name=DENO_BUILD_MODE::debug
cargo test --locked --all-targets
run: cargo test --locked --all-targets
- name: Run Benchmarks
if: matrix.kind == 'bench'
run: python ./tools/benchmark.py target/release
run: python ./tools/benchmark.py --release
- name: Post Benchmarks
if: matrix.kind == 'bench' && github.ref == 'refs/heads/master' && github.repository == 'denoland/deno'
@ -181,7 +176,7 @@ jobs:
DENOBOT_PAT: ${{ secrets.DENOBOT_PAT }}
run: |
git clone --depth 1 -b gh-pages https://${DENOBOT_PAT}@github.com/denoland/benchmark_data.git gh-pages
python ./tools/build_benchmark_jsons.py
python ./tools/build_benchmark_jsons.py --release
cd gh-pages
git config user.email "propelml@gmail.com"
git config user.name "denobot"

View file

@ -1996,8 +1996,8 @@ mod util {
.env("DENO_DIR", DENO_DIR.path())
.current_dir(root_path())
.arg(script)
.arg(format!("--build-dir={}", target_dir().display()))
.arg(format!("--executable={}", deno_exe_path().display()))
.env("DENO_BUILD_PATH", target_dir())
.output()
.expect("failed to spawn script");
if !output.status.success() {

View file

@ -1,8 +1,3 @@
/// To run this benchmark:
///
/// > DENO_BUILD_MODE=release ./tools/build.py && \
/// ./target/release/deno_core_http_bench --multi-thread
#[macro_use]
extern crate derive_deref;
#[macro_use]

View file

@ -1603,40 +1603,6 @@ Format the code:
./tools/format.py
```
#### Other Useful Commands
```bash
# Call ninja manually.
ninja -C target/debug
# Build a release binary.
cargo build --release
# List executable targets.
gn --root=core/libdeno ls target/debug "//:*" --as=output --type=executable
# List build configuration.
gn --root=core/libdeno args target/debug/ --list
# Edit build configuration.
gn --root=core/libdeno args target/debug/
# Describe a target.
gn --root=core/libdeno desc target/debug/ :deno
gn help
# Update third_party modules
git submodule update
# Skip downloading binary build tools and point the build
# to the system provided ones (for packagers of deno ...).
export DENO_BUILD_ARGS="clang_base_path=/usr clang_use_chrome_plugins=false"
DENO_NO_BINARY_DOWNLOAD=1 DENO_GN_PATH=/usr/bin/gn cargo build
```
Environment variables: `DENO_BUILD_MODE`, `DENO_BUILD_PATH`, `DENO_BUILD_ARGS`,
`DENO_DIR`, `DENO_GN_PATH`, `DENO_NO_BINARY_DOWNLOAD`.
### Submitting a Pull Request
Before submitting, please make sure the following is done:

View file

@ -223,15 +223,8 @@ def bundle_benchmark(deno_exe):
return sizes
def main(argv):
if len(argv) == 2:
build_dir = sys.argv[1]
elif len(argv) == 1:
build_dir = build_path()
else:
print "Usage: tools/benchmark.py [build_dir]"
sys.exit(1)
def main():
build_dir = build_path()
sha1 = run_output(["git", "rev-parse", "HEAD"],
exit_on_fail=True).out.strip()
http_server.spawn()
@ -271,4 +264,4 @@ def main(argv):
if __name__ == '__main__':
main(sys.argv)
main()

View file

@ -2,7 +2,7 @@ import os
import sys
from test_util import DenoTestCase, run_tests
from util import build_mode, executable_suffix, tests_path, run, run_output
from util import executable_suffix, tests_path, run, run_output
class TestTarget(DenoTestCase):

View file

@ -204,21 +204,16 @@ def rmtree(directory):
shutil.rmtree(directory, onerror=rm_readonly)
def build_mode(default="debug"):
if "DENO_BUILD_MODE" in os.environ:
return os.environ["DENO_BUILD_MODE"]
elif "--release" in sys.argv:
def build_mode():
if "--release" in sys.argv:
return "release"
else:
return default
return "debug"
# E.G. "target/debug"
def build_path():
if "DENO_BUILD_PATH" in os.environ:
return os.environ["DENO_BUILD_PATH"]
else:
return os.path.join(root_path, "target", build_mode())
return os.path.join(root_path, "target", build_mode())
def parse_exit_code(s):