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

suggestion/draft: add "strip" option for zig build #19811

Open
nikkicoon opened this issue Apr 29, 2024 · 0 comments
Open

suggestion/draft: add "strip" option for zig build #19811

nikkicoon opened this issue Apr 29, 2024 · 0 comments
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@nikkicoon
Copy link
Contributor

nikkicoon commented Apr 29, 2024

Zig Version

0.12.0

Steps to Reproduce and Observed Behavior

As discussed a little earlier (as far as I remember, #14420), in NetBSD we sometimes omit debug symbols under some conditions.
A package we have in pkgsrc, passphrase (https://codeberg.org/owl/passphrase/src/branch/trunk/build.zig), provides this working option:

pub fn build(b: *std.Build) !void {
... snip ...
    const exe = b.addExecutable(.{
... snip ...
        .strip = b.option(
            bool,
            "strip",
            "Omit debug symbols",
        ) orelse (optimize != .Debug),
    });

Since this is something zig can do, I think this ought to be something zig provides by default to keep the patches to build.zig files to a minimum.

I'm guessing this won't be enough, am I missing something: master...nikkicoon:zig:build/strip

Used in pkgsrc like this (mk code fragment snippet):

.if ${ZIGSTRIP:Uyes:M[yY][eE][sS]}
.  if ${MKDEBUG:Uyes:M[yY][eE][sS]} && ${INSTALL_UNSTRIPPED:Uyes:tl} == yes
ZIGBUILDARGS+=		-Dstrip=true
.  endif
.endif
@nikkicoon nikkicoon added the bug Observed behavior contradicts documented or intended behavior label Apr 29, 2024
@nikkicoon nikkicoon changed the title suggestion/draft: add "strip" option suggestion/draft: add "strip" option for zig build Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

1 participant