mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
ci: ensure correct ninja is used (#37071)
* ci: ensure correct ninja is used
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
* chore: remove no longer needed patch
* ci: fixup ninja for release
(cherry picked from commit 78b83864cd)
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
@@ -484,7 +484,9 @@ step-fix-sync: &step-fix-sync
|
||||
run:
|
||||
name: Fix Sync
|
||||
command: |
|
||||
SEDOPTION="-i"
|
||||
if [ "`uname`" == "Darwin" ]; then
|
||||
SEDOPTION="-i ''"
|
||||
# Fix Clang Install (wrong binary)
|
||||
rm -rf src/third_party/llvm-build
|
||||
python3 src/tools/clang/scripts/update.py
|
||||
@@ -494,13 +496,16 @@ step-fix-sync: &step-fix-sync
|
||||
# Remove extra output from calling gclient getdep which always calls update_depot_tools
|
||||
sed -i '' "s/Updating depot_tools... //g" esbuild_ensure_file
|
||||
cipd ensure --root src/third_party/devtools-frontend/src/third_party/esbuild -ensure-file esbuild_ensure_file
|
||||
|
||||
# Fix ninja (wrong binary)
|
||||
echo 'infra/3pp/tools/ninja/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/third_party/ninja:infra/3pp/tools/ninja/${platform}'` > ninja_ensure_file
|
||||
sed -i '' "s/Updating depot_tools... //g" ninja_ensure_file
|
||||
cipd ensure --root src/third_party/ninja -ensure-file ninja_ensure_file
|
||||
fi
|
||||
|
||||
# Make sure we are using the right ninja
|
||||
echo 'infra/3pp/tools/ninja/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/third_party/ninja:infra/3pp/tools/ninja/${platform}'` > ninja_ensure_file
|
||||
sed $SEDOPTION "s/Updating depot_tools... //g" ninja_ensure_file
|
||||
cipd ensure --root src/third_party/ninja -ensure-file ninja_ensure_file
|
||||
|
||||
# Explicitly add ninja to the path
|
||||
echo 'export PATH="$PATH:'"$PWD"'/src/third_party/ninja"' >> $BASH_ENV
|
||||
|
||||
cd src/third_party/angle
|
||||
rm .git/objects/info/alternates
|
||||
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
|
||||
|
||||
@@ -51,6 +51,8 @@ environment:
|
||||
|
||||
clone_folder: C:\projects\src\electron
|
||||
|
||||
skip_branch_with_pr: true
|
||||
|
||||
# the first failed job cancels other jobs and fails entire build
|
||||
matrix:
|
||||
fast_finish: true
|
||||
@@ -130,6 +132,7 @@ for:
|
||||
}
|
||||
- if "%RUN_GCLIENT_SYNC%"=="true" ( gclient sync --with_branch_heads --with_tags ) else ( gclient runhooks )
|
||||
- cd src
|
||||
- ps: $env:PATH="$pwd\third_party\ninja;$env:PATH"
|
||||
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
|
||||
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
|
||||
- gn check out/Default //electron:electron_lib
|
||||
|
||||
@@ -49,6 +49,8 @@ environment:
|
||||
|
||||
clone_folder: C:\projects\src\electron
|
||||
|
||||
skip_branch_with_pr: true
|
||||
|
||||
# the first failed job cancels other jobs and fails entire build
|
||||
matrix:
|
||||
fast_finish: true
|
||||
@@ -128,6 +130,7 @@ for:
|
||||
}
|
||||
- if "%RUN_GCLIENT_SYNC%"=="true" ( gclient sync --with_branch_heads --with_tags ) else ( gclient runhooks )
|
||||
- cd src
|
||||
- ps: $env:PATH="$pwd\third_party\ninja;$env:PATH"
|
||||
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
|
||||
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
|
||||
- gn check out/Default //electron:electron_lib
|
||||
|
||||
@@ -127,4 +127,3 @@ cherry-pick-3235c1d1955b.patch
|
||||
expose_v8initializer_codegenerationcheckcallbackinmainthread.patch
|
||||
cherry-pick-43637378b14e.patch
|
||||
axselectedtextmarkerrange_should_not_be_backwards.patch
|
||||
cherry-pick-57c54ae221d6.patch
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Vasiliev <vasilvv@chromium.org>
|
||||
Date: Wed, 21 Dec 2022 17:26:42 +0000
|
||||
Subject: Ensure clean destruction of network::WebTransport
|
||||
|
||||
Once the destruction of the object begins, we should not process any
|
||||
callbacks, nor should we attempt to reset the streams on a connection
|
||||
that is already being closed.
|
||||
|
||||
Bug: 1376354
|
||||
Change-Id: Ib49e0ce0b177062cccd0e52368782e291cf8166c
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4117501
|
||||
Reviewed-by: Eric Orth <ericorth@chromium.org>
|
||||
Commit-Queue: Victor Vasiliev <vasilvv@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1085965}
|
||||
|
||||
diff --git a/services/network/web_transport.cc b/services/network/web_transport.cc
|
||||
index 8ddbeb9473cb94ebcc64286797ae574ca08d1001..cd92d0f26b23229aeb1e415b81165b2ebf05452f 100644
|
||||
--- a/services/network/web_transport.cc
|
||||
+++ b/services/network/web_transport.cc
|
||||
@@ -177,7 +177,7 @@ class WebTransport::Stream final {
|
||||
|
||||
~Stream() {
|
||||
auto* stream = incoming_ ? incoming_.get() : outgoing_.get();
|
||||
- if (!stream) {
|
||||
+ if (!stream || transport_->closing_ || transport_->torn_down_) {
|
||||
return;
|
||||
}
|
||||
stream->MaybeResetDueToStreamObjectGone();
|
||||
@@ -399,7 +399,10 @@ WebTransport::WebTransport(
|
||||
transport_->Connect();
|
||||
}
|
||||
|
||||
-WebTransport::~WebTransport() = default;
|
||||
+WebTransport::~WebTransport() {
|
||||
+ // Ensure that we ignore all callbacks while mid-destruction.
|
||||
+ torn_down_ = true;
|
||||
+}
|
||||
|
||||
void WebTransport::SendDatagram(base::span<const uint8_t> data,
|
||||
base::OnceCallback<void(bool)> callback) {
|
||||
diff --git a/services/network/web_transport_unittest.cc b/services/network/web_transport_unittest.cc
|
||||
index 81bf26f9e0509e8c56160042519f9ea9034c68df..1a9e6bcfef8b5f7cb642412cb59381c5082e2c19 100644
|
||||
--- a/services/network/web_transport_unittest.cc
|
||||
+++ b/services/network/web_transport_unittest.cc
|
||||
@@ -610,6 +610,51 @@ TEST_F(WebTransportTest, EchoOnUnidirectionalStreams) {
|
||||
EXPECT_EQ(0u, resets_sent.size());
|
||||
}
|
||||
|
||||
+TEST_F(WebTransportTest, DeleteClientWithStreamsOpen) {
|
||||
+ base::RunLoop run_loop_for_handshake;
|
||||
+ mojo::PendingRemote<mojom::WebTransportHandshakeClient> handshake_client;
|
||||
+ TestHandshakeClient test_handshake_client(
|
||||
+ handshake_client.InitWithNewPipeAndPassReceiver(),
|
||||
+ run_loop_for_handshake.QuitClosure());
|
||||
+
|
||||
+ CreateWebTransport(GetURL("/echo"),
|
||||
+ url::Origin::Create(GURL("https://example.org/")),
|
||||
+ std::move(handshake_client));
|
||||
+
|
||||
+ run_loop_for_handshake.Run();
|
||||
+
|
||||
+ ASSERT_TRUE(test_handshake_client.has_seen_connection_establishment());
|
||||
+
|
||||
+ TestClient client(test_handshake_client.PassClientReceiver());
|
||||
+ mojo::Remote<mojom::WebTransport> transport_remote(
|
||||
+ test_handshake_client.PassTransport());
|
||||
+
|
||||
+ constexpr int kNumStreams = 10;
|
||||
+ auto writable_for_outgoing =
|
||||
+ std::make_unique<mojo::ScopedDataPipeProducerHandle[]>(kNumStreams);
|
||||
+ for (int i = 0; i < kNumStreams; i++) {
|
||||
+ const MojoCreateDataPipeOptions options = {
|
||||
+ sizeof(options), MOJO_CREATE_DATA_PIPE_FLAG_NONE, 1, 4 * 1024};
|
||||
+ mojo::ScopedDataPipeConsumerHandle readable_for_outgoing;
|
||||
+ ASSERT_EQ(MOJO_RESULT_OK,
|
||||
+ mojo::CreateDataPipe(&options, writable_for_outgoing[i],
|
||||
+ readable_for_outgoing));
|
||||
+ base::RunLoop run_loop_for_stream_creation;
|
||||
+ bool stream_created;
|
||||
+ transport_remote->CreateStream(
|
||||
+ std::move(readable_for_outgoing),
|
||||
+ /*writable=*/{},
|
||||
+ base::BindLambdaForTesting([&](bool b, uint32_t /*id*/) {
|
||||
+ stream_created = b;
|
||||
+ run_loop_for_stream_creation.Quit();
|
||||
+ }));
|
||||
+ run_loop_for_stream_creation.Run();
|
||||
+ ASSERT_TRUE(stream_created);
|
||||
+ }
|
||||
+
|
||||
+ // Keep the streams open so that they are closed via destructor.
|
||||
+}
|
||||
+
|
||||
// crbug.com/1129847: disabled because it is flaky.
|
||||
TEST_F(WebTransportTest, DISABLED_EchoOnBidirectionalStream) {
|
||||
base::RunLoop run_loop_for_handshake;
|
||||
Reference in New Issue
Block a user