Skip to content

Commit

Permalink
chore: remove third_party submodule (denoland#20201)
Browse files Browse the repository at this point in the history
removes third_party submodule, tools are installed on-demand.

- removed `load_test` and websocket benchmark (covered by benchy)
- removed node/bun http benchmarks (covered by benchy)
- `dlint` & `dprint` downloaded on-demand. 
- `wrk` & `hyperfine` downloaded before CI benchmark run. 
   Install locally using: `./tools/install_prebuilt.js wrk hyperfine`

#### updating dlint/dprint

update version in `tools/util.js` and place binary in
`denoland/deno_third_party`.
  • Loading branch information
littledivy committed Aug 21, 2023
1 parent 8ac2895 commit 72ee075
Show file tree
Hide file tree
Showing 25 changed files with 132 additions and 16,537 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 65,8 @@ sudo mount --rbind /sys /sysroot/sys
sudo mount --rbind /home /sysroot/home
sudo mount -t proc /proc /sysroot/proc
cp third_party/prebuilt/linux64/libdl/libdl.so.2 .
cp third_party/prebuilt/linux64/libdl/libdl.a .
wget https://github.com/denoland/deno_third_party/raw/master/prebuilt/linux64/libdl/libdl.a
wget https://github.com/denoland/deno_third_party/raw/master/prebuilt/linux64/libdl/libdl.so.2
sudo ln -s libdl.so.2 /sysroot/lib/x86_64-linux-gnu/libdl.so
sudo ln -s libdl.a /sysroot/lib/x86_64-linux-gnu/libdl.a
Expand Down Expand Up @@ -106,6 106,8 @@ CFLAGS=-flto=thin --sysroot=/sysroot
__0`,
};

const installBenchTools = "./tools/install_prebuilt.js wrk hyperfine";

// The Windows builder is a little strange -- there's lots of room on C: and not so much on D:
// We'll check out to D:, but then all of our builds should happen on a C:-mapped drive
const reconfigureWindowsStorage = {
Expand Down Expand Up @@ -395,7 397,6 @@ const ci = {
reconfigureWindowsStorage,
...cloneRepoStep,
submoduleStep("./test_util/std"),
submoduleStep("./third_party"),
{
...submoduleStep("./test_util/wpt"),
if: "matrix.wpt",
Expand Down Expand Up @@ -504,6 505,8 @@ const ci = {
'if [ "${{ matrix.job }}" == "bench" ]',
"then",
" node -v",
// Install benchmark tools.
installBenchTools,
"fi",
].join("\n"),
},
Expand Down Expand Up @@ -552,7 555,7 @@ const ci = {
name: "test_format.js",
if: "matrix.job == 'lint' && startsWith(matrix.os, 'ubuntu')",
run:
"deno run --unstable --allow-write --allow-read --allow-run ./tools/format.js --check",
"deno run --unstable --allow-write --allow-read --allow-run --allow-net ./tools/format.js --check",
},
{
name: "Lint PR title",
Expand All @@ -567,7 570,7 @@ const ci = {
name: "lint.js",
if: "matrix.job == 'lint'",
run:
"deno run --unstable --allow-write --allow-read --allow-run ./tools/lint.js",
"deno run --unstable --allow-write --allow-read --allow-run --allow-net ./tools/lint.js",
},
{
name: "node_compat/setup.ts --check",
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 128,6 @@ jobs:
- name: Clone submodule ./test_util/std
run: git submodule update --init --recursive --depth=1 -- ./test_util/std
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr)'
- name: Clone submodule ./third_party
run: git submodule update --init --recursive --depth=1 -- ./third_party
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr)'
- name: Clone submodule ./test_util/wpt
run: git submodule update --init --recursive --depth=1 -- ./test_util/wpt
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.wpt)'
Expand Down Expand Up @@ -252,8 249,8 @@ jobs:
sudo mount --rbind /home /sysroot/home
sudo mount -t proc /proc /sysroot/proc
cp third_party/prebuilt/linux64/libdl/libdl.so.2 .
cp third_party/prebuilt/linux64/libdl/libdl.a .
wget https://github.com/denoland/deno_third_party/raw/master/prebuilt/linux64/libdl/libdl.a
wget https://github.com/denoland/deno_third_party/raw/master/prebuilt/linux64/libdl/libdl.so.2
sudo ln -s libdl.so.2 /sysroot/lib/x86_64-linux-gnu/libdl.so
sudo ln -s libdl.a /sysroot/lib/x86_64-linux-gnu/libdl.a
Expand Down Expand Up @@ -303,6 300,7 @@ jobs:
if [ "${{ matrix.job }}" == "bench" ]
then
node -v
./tools/install_prebuilt.js wrk hyperfine
fi
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr)'
- name: Cache Cargo home
Expand Down Expand Up @@ -332,15 330,15 @@ jobs:
cache-path: ./target
- name: test_format.js
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''lint'' && startsWith(matrix.os, ''ubuntu''))'
run: deno run --unstable --allow-write --allow-read --allow-run ./tools/format.js --check
run: deno run --unstable --allow-write --allow-read --allow-run --allow-net ./tools/format.js --check
- name: Lint PR title
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''lint'' && github.event_name == ''pull_request'' && startsWith(matrix.os, ''ubuntu''))'
env:
PR_TITLE: '${{ github.event.pull_request.title }}'
run: deno run ./tools/verify_pr_title.js "$PR_TITLE"
- name: lint.js
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''lint'')'
run: deno run --unstable --allow-write --allow-read --allow-run ./tools/lint.js
run: deno run --unstable --allow-write --allow-read --allow-run --allow-net ./tools/lint.js
- name: node_compat/setup.ts --check
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''lint'' && startsWith(matrix.os, ''ubuntu''))'
run: deno run --allow-write --allow-read --allow-run=git ./tools/node_compat/setup.ts --check
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 11,7 @@ gclient_config.py_entries
/target/
/std/hash/_wasm/target
/tools/wpt/manifest.json
/third_party/
/test_napi/node_modules
/test_napi/build
/test_napi/third_party_tests/node_modules
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 1,3 @@
[submodule "deno_third_party"]
path = third_party
url = https://github.com/denoland/deno_third_party.git
shallow = true
[submodule "test_util/std"]
path = test_util/std
url = https://github.com/denoland/deno_std
Expand Down
79 changes: 19 additions & 60 deletions cli/bench/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 38,6 @@ pub fn benchmark(
if path.ends_with(".lua") {
continue;
}
let name = entry.file_name().into_string().unwrap();
let file_stem = pathbuf.file_stem().unwrap().to_str().unwrap();

let lua_script = http_dir.join(format!("{file_stem}.lua"));
Expand All @@ -48,65 47,25 @@ pub fn benchmark(
}

let port = get_port();
if name.starts_with("node") {
// node <path> <port>
res.insert(
file_stem.to_string(),
run(
&["node", path, &port.to_string()],
port,
None,
None,
maybe_lua,
)?,
);
} else if name.starts_with("bun") && !cfg!(target_os = "windows") {
// Bun does not support Windows.
#[cfg(target_arch = "x86_64")]
#[cfg(not(target_vendor = "apple"))]
let bun_exe = test_util::prebuilt_tool_path("bun");
#[cfg(target_vendor = "apple")]
#[cfg(target_arch = "x86_64")]
let bun_exe = test_util::prebuilt_tool_path("bun-x64");
#[cfg(target_vendor = "apple")]
#[cfg(target_arch = "aarch64")]
let bun_exe = test_util::prebuilt_tool_path("bun-aarch64");
#[cfg(target_os = "linux")]
#[cfg(target_arch = "aarch64")]
let bun_exe = test_util::prebuilt_tool_path("bun-aarch64");

// bun <path> <port>
res.insert(
file_stem.to_string(),
run(
&[&bun_exe.to_string(), path, &port.to_string()],
port,
None,
None,
maybe_lua,
)?,
);
} else {
// deno run -A --unstable <path> <addr>
res.insert(
file_stem.to_string(),
run(
&[
deno_exe.as_str(),
"run",
"--allow-all",
"--unstable",
"--enable-testing-features-do-not-use",
path,
&server_addr(port),
],
port,
None,
None,
maybe_lua,
)?,
);
}
// deno run -A --unstable <path> <addr>
res.insert(
file_stem.to_string(),
run(
&[
deno_exe.as_str(),
"run",
"--allow-all",
"--unstable",
"--enable-testing-features-do-not-use",
path,
&server_addr(port),
],
port,
None,
None,
maybe_lua,
)?,
);
}

res.insert("hyper".to_string(), hyper_http(hyper_hello_exe)?);
Expand Down
17 changes: 0 additions & 17 deletions cli/bench/http/bun_hono_router.js

This file was deleted.

10 changes: 0 additions & 10 deletions cli/bench/http/bun_http.js

This file was deleted.

14 changes: 0 additions & 14 deletions cli/bench/http/bun_http_send_file.js

This file was deleted.

9 changes: 0 additions & 9 deletions cli/bench/http/node_http.js

This file was deleted.

10 changes: 0 additions & 10 deletions cli/bench/http/node_http_read_headers.js

This file was deleted.

5 changes: 0 additions & 5 deletions cli/bench/http/node_http_read_headers.lua

This file was deleted.

18 changes: 0 additions & 18 deletions cli/bench/http/node_post_bin.js

This file was deleted.

5 changes: 0 additions & 5 deletions cli/bench/http/node_post_bin.lua

This file was deleted.

18 changes: 0 additions & 18 deletions cli/bench/http/node_post_json.js

This file was deleted.

3 changes: 0 additions & 3 deletions cli/bench/http/node_post_json.lua

This file was deleted.

Loading

0 comments on commit 72ee075

Please sign in to comment.