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

build: fix format-cpp #42764

Merged
merged 1 commit into from
Apr 20, 2022
Merged

Conversation

RaisinTen
Copy link
Contributor

@RaisinTen RaisinTen commented Apr 17, 2022

According to the logs in
#42681 (comment),
make format-cpp exits with an NZEC. This change intentionally ignores
the error code because it is irrelevant. We already check if the
formatter produced a diff in the next line.

Ignoring the make format-cpp error code works as expected: https://github.com/nodejs/node/runs/6054137816?check_suite_focus=true

Formatting C++ diff from c3a581c360ca1a2a11e49e2e99ca9ea83bbbaaf9..
changed files:
    src/api/environment.cc
    src/env.h
    src/node_wasm_web_api.cc
    src/node_wasm_web_api.h
make: *** [Makefile:1437: format-cpp] Error 1
diff --git a/src/api/environment.cc b/src/api/environment.cc
index 02a4d8d2fc..f3a8f49812 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -255,7 +255,8 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
   isolate->SetAllowWasmCodeGenerationCallback(allow_wasm_codegen_cb);
 
   Mutex::ScopedLock lock(node::per_process::cli_options_mutex);
-  if (per_process::cli_options->get_per_isolate_options()->get_per_env_options()
+  if (per_process::cli_options->get_per_isolate_options()
+          ->get_per_env_options()
           ->experimental_fetch) {
     isolate->SetWasmStreamingCallback(wasm_web_api::StartStreamingCompilation);
   }
diff --git a/src/env.h b/src/env.h
index 7885a96771..7e35833e45 100644
--- a/src/env.h
+++ b/src/env.h
@@ -552,7 +552,7 @@ constexpr size_t kFsStatsBufferLength =
   V(udp_constructor_function, v8::Function)                                    \
   V(url_constructor_function, v8::Function)                                    \
   V(wasm_streaming_compilation_impl, v8::Function)                             \
-  V(wasm_streaming_object_constructor, v8::Function)                           \
+  V(wasm_streaming_object_constructor, v8::Function)
 
 class Environment;
 struct AllocatedBuffer;
diff --git a/src/node_wasm_web_api.cc b/src/node_wasm_web_api.cc
index 8d7a58a9cd..3a333900c9 100644
--- a/src/node_wasm_web_api.cc
+++ b/src/node_wasm_web_api.cc
@@ -95,8 +95,8 @@ void WasmStreamingObject::Push(
   }
 
   // Forward the data to V8. Internally, V8 will make a copy.
-  obj->streaming_->OnBytesReceived(
-      static_cast<const uint8_t*>(bytes) + offset, size);
+  obj->streaming_->OnBytesReceived(static_cast<const uint8_t*>(bytes) + offset,
+                                   size);
   obj->wasm_size_ += size;
 }
 
@@ -150,7 +150,7 @@ void StartStreamingCompilation(
   // instantiateStreaming).
   v8::Local<v8::Function> impl = env->wasm_streaming_compilation_impl();
   CHECK(!impl.IsEmpty());
-  v8::Local<v8::Value> args[] = { obj, info[0] };
+  v8::Local<v8::Value> args[] = {obj, info[0]};
 
   // Hand control to the JavaScript implementation. It should never throw an
   // error, but if it does, we leave it to the calling V8 code to handle that
diff --git a/src/node_wasm_web_api.h b/src/node_wasm_web_api.h
index 659344e2b8..9f5fe86816 100644
--- a/src/node_wasm_web_api.h
+++ b/src/node_wasm_web_api.h
@@ -44,8 +44,7 @@ class WasmStreamingObject final : public BaseObject {
 // This is a v8::WasmStreamingCallback implementation that must be passed to
 // v8::Isolate::SetWasmStreamingCallback when setting up the isolate in order to
 // enable the WebAssembly.(compile|instantiate)Streaming APIs.
-void StartStreamingCompilation(
-    const v8::FunctionCallbackInfo<v8::Value>& args);
+void StartStreamingCompilation(const v8::FunctionCallbackInfo<v8::Value>& args);
 
 }  // namespace wasm_web_api
 }  // namespace node

ERROR: Please run:

  CLANG_FORMAT_START="$(git merge-base HEAD <target-branch-name>)" make format-cpp

to format the commits in your branch.
Error: Process completed with exit code 1.

Refs: #42681 (comment)
Signed-off-by: Darshan Sen raisinten@gmail.com

@RaisinTen RaisinTen added the wip Issues and PRs that are still a work in progress. label Apr 17, 2022
@nodejs-github-bot

This comment was marked as off-topic.

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Apr 17, 2022
According to the logs in
nodejs#42681 (comment),
`make format-cpp` exits with an NZEC. This change intentionally ignores
the error code because it is irrelevant. We already check if the
formatter produced a diff in the next line.

Refs: nodejs#42681 (comment)
Signed-off-by: Darshan Sen <raisinten@gmail.com>
@RaisinTen RaisinTen removed the wip Issues and PRs that are still a work in progress. label Apr 17, 2022
@Trott
Copy link
Member

Trott commented Apr 17, 2022

This does mean that if the formatter fails to run for some other reason, the workflow will still pass. Maybe that's OK, but mentioning it just in case.

@Trott
Copy link
Member

Trott commented Apr 17, 2022

This does mean that if the formatter fails to run for some other reason, the workflow will still pass. Maybe that's OK, but mentioning it just in case.

For example, if we ever change the command to make format-src but don't update it here, the workflow will still pass.

(Again, maybe this is OK. I just want to make sure it's a decision we're making and not something that is happening unintentionally.)

@RaisinTen
Copy link
Contributor Author

For example, if we ever change the command to make format-src but don't update it here, the workflow will still pass.

I think that's also applicable in other places like

make lint-py-build || true
, so it's probably fine IMO.

@RaisinTen RaisinTen added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. meta Issues and PRs related to the general management of the project. and removed lib / src Issues and PRs related to general changes in the lib or src directory. labels Apr 17, 2022
@RaisinTen RaisinTen requested a review from Trott April 17, 2022 15:00
@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 19, 2022
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Apr 19, 2022
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/42764
✔  Done loading data for nodejs/node/pull/42764
----------------------------------- PR info ------------------------------------
Title      build: fix format-cpp (#42764)
Author     Darshan Sen  (@RaisinTen)
Branch     RaisinTen:fix-format-cpp -> nodejs:master
Labels     meta, author ready, needs-ci
Commits    1
 - build: fix format-cpp
Committers 1
 - Darshan Sen 
PR-URL: https://github.com/nodejs/node/pull/42764
Reviewed-By: Tobias Nießen 
Reviewed-By: Mestery 
Reviewed-By: Mohammed Keyvanzadeh 
Reviewed-By: Luigi Pinca 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/42764
Reviewed-By: Tobias Nießen 
Reviewed-By: Mestery 
Reviewed-By: Mohammed Keyvanzadeh 
Reviewed-By: Luigi Pinca 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Sun, 17 Apr 2022 13:13:24 GMT
   ✔  Approvals: 4
   ✔  - Tobias Nießen (@tniessen) (TSC): https://github.com/nodejs/node/pull/42764#pullrequestreview-943957984
   ✔  - Mestery (@Mesteery): https://github.com/nodejs/node/pull/42764#pullrequestreview-943982897
   ✔  - Mohammed Keyvanzadeh (@VoltrexMaster): https://github.com/nodejs/node/pull/42764#pullrequestreview-943995036
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/42764#pullrequestreview-944714674
   ✔  Last GitHub CI successful
   ✖  No Jenkins CI runs detected
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/2192710123

@RaisinTen RaisinTen added commit-queue Add this label to land a pull request using GitHub Actions. and removed needs-ci PRs that need a full CI run. commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Apr 20, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 20, 2022
@nodejs-github-bot nodejs-github-bot merged commit 61fefe1 into nodejs:master Apr 20, 2022
@nodejs-github-bot
Copy link
Collaborator

Landed in 61fefe1

@RaisinTen RaisinTen deleted the fix-format-cpp branch April 20, 2022 15:03
xtx1130 pushed a commit to xtx1130/node that referenced this pull request Apr 25, 2022
According to the logs in
nodejs#42681 (comment),
`make format-cpp` exits with an NZEC. This change intentionally ignores
the error code because it is irrelevant. We already check if the
formatter produced a diff in the next line.

Refs: nodejs#42681 (comment)
Signed-off-by: Darshan Sen <raisinten@gmail.com>

PR-URL: nodejs#42764
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Apr 28, 2022
According to the logs in
#42681 (comment),
`make format-cpp` exits with an NZEC. This change intentionally ignores
the error code because it is irrelevant. We already check if the
formatter produced a diff in the next line.

Refs: #42681 (comment)
Signed-off-by: Darshan Sen <raisinten@gmail.com>

PR-URL: #42764
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@targos targos mentioned this pull request May 2, 2022
juanarbol pushed a commit that referenced this pull request May 31, 2022
According to the logs in
#42681 (comment),
`make format-cpp` exits with an NZEC. This change intentionally ignores
the error code because it is irrelevant. We already check if the
formatter produced a diff in the next line.

Refs: #42681 (comment)
Signed-off-by: Darshan Sen <raisinten@gmail.com>

PR-URL: #42764
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams pushed a commit that referenced this pull request Jun 27, 2022
According to the logs in
#42681 (comment),
`make format-cpp` exits with an NZEC. This change intentionally ignores
the error code because it is irrelevant. We already check if the
formatter produced a diff in the next line.

Refs: #42681 (comment)
Signed-off-by: Darshan Sen <raisinten@gmail.com>

PR-URL: #42764
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Jul 12, 2022
According to the logs in
#42681 (comment),
`make format-cpp` exits with an NZEC. This change intentionally ignores
the error code because it is irrelevant. We already check if the
formatter produced a diff in the next line.

Refs: #42681 (comment)
Signed-off-by: Darshan Sen <raisinten@gmail.com>

PR-URL: #42764
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Jul 31, 2022
According to the logs in
#42681 (comment),
`make format-cpp` exits with an NZEC. This change intentionally ignores
the error code because it is irrelevant. We already check if the
formatter produced a diff in the next line.

Refs: #42681 (comment)
Signed-off-by: Darshan Sen <raisinten@gmail.com>

PR-URL: #42764
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
According to the logs in
nodejs/node#42681 (comment),
`make format-cpp` exits with an NZEC. This change intentionally ignores
the error code because it is irrelevant. We already check if the
formatter produced a diff in the next line.

Refs: nodejs/node#42681 (comment)
Signed-off-by: Darshan Sen <raisinten@gmail.com>

PR-URL: nodejs/node#42764
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. meta Issues and PRs related to the general management of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants