Skip to content

build,deps,src: bring back v8 abseil-cpp#349

Closed
santigimeno wants to merge 1 commit intonode-v22.x-nsolid-v5.xfrom
santi/fix_abseil
Closed

build,deps,src: bring back v8 abseil-cpp#349
santigimeno wants to merge 1 commit intonode-v22.x-nsolid-v5.xfrom
santi/fix_abseil

Conversation

@santigimeno
Copy link
Copy Markdown
Member

@santigimeno santigimeno commented Jul 28, 2025

Make sure v8 is built with its own abseil-cpp version while the other
dependencies use the one from protobuffer.
In order to avoid name collisions when building libnsolid, a new
libagents target has been added.
Also, commented AbslInternalGetFileMappingHint from protobuf's
abseil-cpp to avoid collisions, as it's defined outside a namespace.

Summary by CodeRabbit

  • Chores
    • Updated build configurations to refine dependency management and modularization of source files.
    • Adjusted references to Abseil dependencies across multiple components for improved clarity and separation.
    • No changes to user-facing features or functionality.

@santigimeno santigimeno self-assigned this Jul 28, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jul 28, 2025

Walkthrough

This set of changes updates build configuration files to rename the Abseil dependency from abseil to abseil_proto across multiple components, adjusts dependency references in V8 and other build targets, adds a source file to the grpc static library, and modifies include directives in source files related to continuous profiling. No logic or control flow in the source code is modified.

Changes

Cohort / File(s) Change Summary
Abseil Dependency Renaming and Build Reference Updates
deps/protobuf/abseil.gyp, deps/protobuf/protobuf.gyp, deps/protobuf/utf8_range.gyp, deps/grpc/grpc.gyp, deps/opentelemetry-cpp/otlp-http-exporter.gyp, tools/v8_gypfiles/v8.gyp
Renames the Abseil static library target from abseil to abseil_proto and updates all related dependency references in build configuration files accordingly. Changes dependency paths in V8 and other build targets from relative paths to simpler references. Adds src/core/lib/promise/wait_set.cc to the grpc static library sources. No changes to code logic or exported entities.
Agent and NSolid Build Configuration Adjustments
node.gyp
Modifies dependencies of node_lib_target_name and cctest targets by splitting Abseil dependency into two components: abseil_proto and abseil. Updates build target dependencies accordingly. No source code changes.
Include Directive Changes in Source Files
agents/grpc/src/grpc_agent.cc, src/nsolid/nsolid_api.h
Adds #include "nsolid/continuous_profiler.h" to grpc_agent.cc and removes #include "continuous_profiler.h" from nsolid_api.h. No other source code or logic changes are made.

Sequence Diagram(s)

Not applicable: Only build configuration and include directive changes, no new or modified control flow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

Dependencies shift, names rearranged,
Abseil’s identity slightly changed.
Includes added, some removed with care,
Build files tidy, all laid bare.
A rabbit hops through code so bright,
Keeping builds smooth, day and night.
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 65716d2 and 4fda0a1.

📒 Files selected for processing (9)
  • agents/grpc/src/grpc_agent.cc (1 hunks)
  • deps/grpc/grpc.gyp (4 hunks)
  • deps/opentelemetry-cpp/otlp-http-exporter.gyp (1 hunks)
  • deps/protobuf/abseil.gyp (2 hunks)
  • deps/protobuf/protobuf.gyp (1 hunks)
  • deps/protobuf/utf8_range.gyp (1 hunks)
  • node.gyp (2 hunks)
  • src/nsolid/nsolid_api.h (0 hunks)
  • tools/v8_gypfiles/v8.gyp (9 hunks)
💤 Files with no reviewable changes (1)
  • src/nsolid/nsolid_api.h
✅ Files skipped from review due to trivial changes (5)
  • deps/protobuf/protobuf.gyp
  • agents/grpc/src/grpc_agent.cc
  • deps/protobuf/utf8_range.gyp
  • deps/opentelemetry-cpp/otlp-http-exporter.gyp
  • node.gyp
🚧 Files skipped from review as they are similar to previous changes (3)
  • deps/grpc/grpc.gyp
  • deps/protobuf/abseil.gyp
  • tools/v8_gypfiles/v8.gyp
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: lint-js-and-md
  • GitHub Check: test-macOS
  • GitHub Check: test-linux (ubuntu-24.04)
  • GitHub Check: build-docs
  • GitHub Check: coverage-windows
  • GitHub Check: test-linux (ubuntu-24.04-arm)
  • GitHub Check: build-tarball
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch santi/fix_abseil

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
agents/grpc/src/grpc_agent.cc (1)

73-75: Fix misleading size comment (4 GB → 4 MB).

4L * 1024 * 1024 equals 4 MB, not 4 GB. The constant currently matches the default gRPC message size limit; the comment should reflect that to avoid confusion.

-const size_t GRPC_MAX_SIZE = 4L * 1024 * 1024;  // 4GB
+const size_t GRPC_MAX_SIZE = 4L * 1024 * 1024;  // 4MB (default gRPC max)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b22a61c and c59e74d.

📒 Files selected for processing (6)
  • agents/grpc/src/grpc_agent.cc (1 hunks)
  • deps/protobuf/third_party/abseil-cpp/absl/debugging/internal/symbolize.h (1 hunks)
  • deps/protobuf/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc (1 hunks)
  • node.gyp (5 hunks)
  • src/nsolid/nsolid_api.h (0 hunks)
  • tools/v8_gypfiles/v8.gyp (8 hunks)
💤 Files with no reviewable changes (1)
  • src/nsolid/nsolid_api.h
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: santigimeno
PR: nodesource/nsolid#339
File: src/nsolid/nsolid_elf_utils.cc:18-18
Timestamp: 2025-07-08T16:05:45.341Z
Learning: In the NSolid project, the `GetBuildId` function in `src/nsolid/nsolid_elf_utils.cc` is designed to be called only from the NSolid thread, so the static cache doesn't require thread safety mechanisms like mutex protection.
agents/grpc/src/grpc_agent.cc (3)

Learnt from: santigimeno
PR: #327
File: test/addons/nsolid-code-event-hook/binding.cc:64-78
Timestamp: 2025-06-10T09:52:49.401Z
Learning: In the nsolid codebase, test files in test/addons/ consistently use assert() for input validation and runtime checks, not CHECK() macros. This is the established testing convention.

Learnt from: santigimeno
PR: #339
File: src/nsolid/nsolid_elf_utils.cc:18-18
Timestamp: 2025-07-08T16:05:45.341Z
Learning: In the NSolid project, the GetBuildId function in src/nsolid/nsolid_elf_utils.cc is designed to be called only from the NSolid thread, so the static cache doesn't require thread safety mechanisms like mutex protection.

Learnt from: santigimeno
PR: #339
File: test/addons/nsolid-elf-utils/binding.cc:13-28
Timestamp: 2025-07-08T14:48:04.827Z
Learning: In nsolid test native addons (e.g., test/addons/*/binding.cc), additional JavaScript-facing argument validation is typically omitted because the tests supply well-formed inputs.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: test-macOS
  • GitHub Check: build-tarball
  • GitHub Check: lint-js-and-md
  • GitHub Check: build-docs
  • GitHub Check: test-linux (ubuntu-24.04)
  • GitHub Check: test-linux (ubuntu-24.04-arm)
  • GitHub Check: coverage-windows
🔇 Additional comments (7)
agents/grpc/src/grpc_agent.cc (1)

6-6: Header include looks appropriate.

Adding the explicit nsolid/continuous_profiler.h include is the right move now that the dependency is no longer transitively pulled in by nsolid_api.h.

deps/protobuf/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc (1)

1759-1764: AbslInternalGetFileMappingHint removal is safe

Search results confirm that the C wrapper is never called elsewhere in this codebase, and the underlying C++ GetFileMappingHint remains implemented and in use:

• No occurrences of AbslInternalGetFileMappingHint outside its own definition in
deps/protobuf/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc (lines 1759–1764)
absl::debugging_internal::GetFileMappingHint is still declared in
deps/protobuf/third_party/abseil-cpp/absl/debugging/internal/symbolize.h and defined in
symbolize_elf.inc
• Other code paths call GetFileMappingHint(...) directly

This change cleanly disables an unused extern "C" shim without impacting functionality.

deps/protobuf/third_party/abseil-cpp/absl/debugging/internal/symbolize.h (1)

149-151: LGTM! Consistent with implementation file changes.

The function declaration is properly commented out, maintaining consistency with the corresponding definition being disabled in symbolize_elf.inc. This coordinated approach prevents compilation errors that could arise from having a declaration without a definition.

node.gyp (4)

416-532: LGTM! Good modularization of source files.

The reorganization separating agent sources from nsolid sources improves build modularity and aligns with the PR objective of bringing back v8 abseil-cpp. The variable renaming from nsolid_sources to agent_sources and the creation of a new nsolid_sources list clearly separates concerns.


982-982: LGTM! Abseil dependency path updated to v8 version.

The change from deps/protobuf/abseil.gyp:abseil to tools/v8_gypfiles/abseil.gyp:abseil correctly implements the PR objective of bringing back v8 abseil-cpp for the main node library and cctest targets.

Also applies to: 1350-1350


984-984: LGTM! Proper dependency on the new libagents target.

Adding the libagents dependency to the main node library target correctly establishes the build relationship after modularizing the agent code.


1181-1208: LGTM! Well-structured intermediate library target.

The libagents target is properly configured with appropriate include directories, dependencies, and build settings. This modularization will improve build organization and maintainability.

Comment thread node.gyp Outdated
Comment thread tools/v8_gypfiles/v8.gyp
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a7c4f2 and 39985fe.

📒 Files selected for processing (7)
  • deps/grpc/grpc.gyp (4 hunks)
  • deps/opentelemetry-cpp/otlp-http-exporter.gyp (1 hunks)
  • deps/protobuf/abseil.gyp (2 hunks)
  • deps/protobuf/protobuf.gyp (1 hunks)
  • deps/protobuf/utf8_range.gyp (1 hunks)
  • node.gyp (5 hunks)
  • tools/v8_gypfiles/v8.gyp (9 hunks)
✅ Files skipped from review due to trivial changes (3)
  • deps/protobuf/protobuf.gyp
  • deps/opentelemetry-cpp/otlp-http-exporter.gyp
  • tools/v8_gypfiles/v8.gyp
🚧 Files skipped from review as they are similar to previous changes (3)
  • deps/protobuf/abseil.gyp
  • deps/grpc/grpc.gyp
  • node.gyp
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: test-macOS
  • GitHub Check: build-tarball
  • GitHub Check: test-linux (ubuntu-24.04-arm)
  • GitHub Check: test-linux (ubuntu-24.04)
  • GitHub Check: coverage-windows
  • GitHub Check: build-docs
  • GitHub Check: lint-js-and-md

'type': 'static_library',
'dependencies': [
'./abseil.gyp:abseil',
'./abseil.gyp:abseil_proto',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify the target rename is consistent across the build system.

The dependency update from abseil to abseil_proto looks correct and aligns with the PR's objective to reintroduce v8 abseil-cpp. However, ensure that the corresponding target in abseil.gyp has been properly renamed and all dependent build targets have been updated consistently.


🏁 Script executed:

#!/bin/bash
# Description: Verify that the abseil_proto target exists and all references are consistent

# Check if abseil_proto target exists in abseil.gyp
echo "Checking for abseil_proto target definition:"
rg -A 5 "target_name.*abseil_proto" deps/protobuf/abseil.gyp

# Check for any remaining references to the old 'abseil' target
echo -e "\nChecking for any remaining references to old 'abseil' target:"
rg "abseil\.gyp:abseil[^_]" --type gyp

# Check all files that reference abseil_proto to ensure consistency
echo -e "\nChecking all references to abseil_proto:"
rg "abseil\.gyp:abseil_proto" --type gyp

Length of output: 728


🏁 Script executed:

#!/bin/bash
# Description: Re-verify that no old 'abseil' references remain and all 'abseil_proto' usages are consistent

echo "Checking for any remaining references to the old 'abseil' target (excluding abseil_proto):"
rg -P "abseil\.gyp:abseil(?!_proto)" -g "*.gyp" -g "*.gypi" || echo "No old references found."

echo -e "\nChecking all references to 'abseil_proto':"
rg "abseil.gyp:abseil_proto" -g "*.gyp" -g "*.gypi" || echo "No abseil_proto references found."

Length of output: 1485


Update remaining abseil target references to abseil_proto

The search shows several build files still depending on the old abseil target. To keep the rename consistent and avoid build failures, please update these references:

• node.gyp
• tools/v8_gypfiles/d8.gyp
• tools/v8_gypfiles/v8.gyp

Each line like

'…/abseil.gyp:abseil',  

should be changed to

'…/abseil.gyp:abseil_proto',  
🤖 Prompt for AI Agents
In deps/protobuf/utf8_range.gyp at line 7 and similarly in node.gyp,
tools/v8_gypfiles/d8.gyp, and tools/v8_gypfiles/v8.gyp, update all references
from '…/abseil.gyp:abseil' to '…/abseil.gyp:abseil_proto' to maintain
consistency with the renamed target and prevent build errors.

@santigimeno santigimeno force-pushed the santi/fix_abseil branch 5 times, most recently from 2e35f87 to 65716d2 Compare August 5, 2025 20:04
Make sure v8 is built with its own abseil-cpp version while the other
dependencies use the one from protobuffer.
The actual fix was avoid using the same name for the abseil target as it
doesn't work on Windows.
santigimeno added a commit that referenced this pull request Aug 6, 2025
Make sure v8 is built with its own abseil-cpp version while the other
dependencies use the one from protobuffer.
The actual fix was avoid using the same name for the abseil target as it
doesn't work on Windows.

PR-URL: #349
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
@santigimeno
Copy link
Copy Markdown
Member Author

Landed in cd19746

@santigimeno santigimeno closed this Aug 6, 2025
@santigimeno santigimeno deleted the santi/fix_abseil branch August 6, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants