Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 948168

Summary: zig.eclass: unspecified my_zbs_args causes build failures
Product: Gentoo Linux Reporter: demize
Component: EclassesAssignee: Eric Joldasov <bratishkaerik>
Status: RESOLVED FIXED    
Severity: normal CC: demize, floppym
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/40197
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: ebuild logs
WIP ebuild with issue

Description demize 2025-01-16 02:59:40 UTC
Created attachment 916655 [details]
ebuild logs

An empty or unspecified `my_zbs_args` will cause portage to pass an empty string to ZBS during the compile phase, which is interpreted by ZBS as the build step to execute. As there's usually no unnamed build step, this will cause builds to fail.

I've attached the temp directory from such a failure (minus the zig-cache and zig-detect folders, and zig_libc.txt), as well as the WIP ebuild I'm considering where I ran into this issue.

A workaround within the ebuild is to add a `src_configure` function which **unsets** `my_zbs_args`. This line is commented out in the ebuild I uploaded; uncommenting it allows the application to build correctly. While this workaround allows for the application to build correctly, it also requires a potentially useless `src_configure` function; when there are no options to pass, I would prefer to leave the function out of the ebuild.
Comment 1 demize 2025-01-16 03:00:15 UTC
Created attachment 916656 [details]
WIP ebuild with issue
Comment 2 Mike Gilbert gentoo-dev 2025-01-16 18:25:52 UTC
The eclass initializes my_zbs_args as an empty string, but it is supposed to be an array.
Comment 3 Larry the Git Cow gentoo-dev 2025-03-03 19:27:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f68007349b216b75d31a7513e49b9813b24a993e

commit f68007349b216b75d31a7513e49b9813b24a993e
Author:     Eric Joldasov <bratishkaerik@landless-city.net>
AuthorDate: 2025-01-18 16:15:24 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-03-03 19:26:27 +0000

    zig.eclass: allow unset `my_zbs_args`
    
    Previously it was defined as empty string when not setting this variable,
    which caused error during building because Zig treat it as a name of
    non-existant step "".
    
    Also fix DEFAULT_UNSET comment on `BUILD_DIR` and `my_zbs_args`.
    
    Closes: https://bugs.gentoo.org/948168
    Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/zig.eclass | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)