Skip to content

support linker_allow_shlib_undefined#5

Merged
wemeetagain merged 1 commit intomainfrom
bing/linker-allow-shlib-undefined
Dec 11, 2025
Merged

support linker_allow_shlib_undefined#5
wemeetagain merged 1 commit intomainfrom
bing/linker-allow-shlib-undefined

Conversation

@spiral-ladder
Copy link
Copy Markdown
Contributor

unblocks ChainSafe/zapi#1

@spiral-ladder spiral-ladder self-assigned this Dec 11, 2025
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @spiral-ladder, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the build system by adding support for the linker_allow_shlib_undefined option. This feature provides finer control over linker behavior for shared libraries, specifically allowing or disallowing undefined symbols. The change involves updating the configuration structure, its parsing, and the generation of build system code to reflect this new setting, which is essential for unblocking a related project.

Highlights

  • New Configuration Option: Introduced a new optional boolean field, linker_allow_shlib_undefined, to the Library configuration struct. This allows specifying whether the linker should permit undefined symbols in shared libraries.
  • Configuration Parsing: Added logic to the configuration parser to correctly interpret and apply the linker_allow_shlib_undefined setting when it is present in a library's configuration.
  • Build Configuration Generation: Implemented the necessary changes in the build configuration generator to propagate the linker_allow_shlib_undefined setting into the generated build system files for libraries.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for the linker_allow_shlib_undefined option for libraries. The implementation is straightforward and correct. While reviewing, I noticed a small, pre-existing omission in the library parser where the version field was not being handled. I've included a suggestion to address this for completeness.

Comment thread src/Config.zig
Comment on lines +1038 to 1040
} else if (std.mem.eql(u8, field_name, "linker_allow_shlib_undefined")) {
library.linker_allow_shlib_undefined = try self.parseBool(field_value);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

While adding support for linker_allow_shlib_undefined, I noticed that the version field for a Library is not being parsed. The Library struct has a version field, and it's used when generating the build.zig file, but it's missing from the parser logic here. This is inconsistent with parseExecutable, which does handle its version field.

This seems like a good opportunity to fix this omission. I've updated the suggestion to include parsing for the version field.

            } else if (std.mem.eql(u8, field_name, "version")) {
                library.version = try self.parseVersionString(field_value);
            } else if (std.mem.eql(u8, field_name, "linker_allow_shlib_undefined")) {
                library.linker_allow_shlib_undefined = try self.parseBool(field_value);
            }

@wemeetagain wemeetagain merged commit 2320194 into main Dec 11, 2025
wemeetagain added a commit that referenced this pull request Mar 17, 2026
- #1: Clean stale build.zig.zon (remove deleted exe/test refs, bump to 0.3.0)
- #2: Remove @ptrCast for dest_sub_path (Zig coerces comptime strings)
- #3: Default modules to public (export to b.modules unless private = true)
- #4: @CompileError for unknown option types + validateManifest for unknown
  top-level fields
- #5: resolveImport returns error.ModuleNotFound instead of @Panic
- #6: Remove duplicate modules.put (createModule handles it, callers don't)
- #7: Add 8 comptime helper tests (toStringSlice, toEnumSlice, isIntType,
  isFloatType, isKnownField, validateManifest)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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