Skip to content

[openbsd] Fetching versioned library - #18475

Closed
rwsalie wants to merge 33 commits into
ziglang:masterfrom
rwsalie:master
Closed

rwsalie wants to merge 33 commits into
ziglang:masterfrom
rwsalie:master

Conversation

@rwsalie

@rwsalie rwsalie commented Jan 7, 2024

Copy link
Copy Markdown
Contributor

Hi zig developers, as i mention yesterday, Zig can't be able to fetch as well shared library on OpenBSD, because no symlink are available.
I made up a little patch for OpenBSD making Zig compilator link shared versioned library as well.

#18465

Sorry for disturbing you again, i'm just a novice on Zig who want to help/contribute, not to harass you what openbsd or by our idiomatic.

@Vexu

Vexu commented Jan 7, 2024

Copy link
Copy Markdown
Member

Could you remove the else block? Makes it clearer that this is a special case for the openBSD dynamic libs.

@rwsalie

rwsalie commented Jan 8, 2024 •

Copy link
Copy Markdown
Contributor Author

Is it more clear like this @Vexu ? or should i move somehting ?

Edit : Seems caught an error with src/Compilation.zig at 2062, i'll try to check it out too...

@rwsalie

rwsalie commented Jan 8, 2024

Copy link
Copy Markdown
Contributor Author

Compiling works well, i forgot to put path in test_path too.. sorry !

Comment thread src/main.zig Resolved
Comment thread src/main.zig Resolved
@rwsalie
rwsalie requested a review from andrewrk January 10, 2024 19:04
@rwsalie rwsalie mentioned this pull request Jan 14, 2024
9 of 10 tasks
@rwsalie

rwsalie commented Jan 17, 2024

Copy link
Copy Markdown
Contributor Author

Update Done !

@andrewrk andrewrk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you please ask an OpenBSD developer to check your work? I don't think they expect compilers to perform this logic inside every lib directory for every dynamic library. Or, provide evidence that it is supposed to work this way in another compiler's codebase, or OpenBSD documentation.

@andrewrk

Copy link
Copy Markdown
Member

Or, provide evidence that it is supposed to work this way in another compiler's codebase, or OpenBSD documentation.

oh my god, they actually patched LLD to do this logic
https://github.com/openbsd/ports/blob/master/devel/llvm/17/patches/patch-lld_ELF_DriverUtils_cpp

@andrewrk andrewrk left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for working on this.

I have a feeling this is going to require a few back and forths, so if you get tired of working on it, just let me know and I can finish it for you.

Comment thread src/main.zig Resolved
Comment thread src/main.zig Resolved
Comment thread src/main.zig Resolved
@rwsalie

rwsalie commented Jan 20, 2024 •

Copy link
Copy Markdown
Contributor Author

To make coherent with the patch of LLD, i put find_maj_min_sh_lib to run after main_check.
Sorry if the use of fatal function is incorrect on catch block of fs.cwd().openDir or with std.fmt.parseInt.

@rwsalie

rwsalie commented Jan 20, 2024

Copy link
Copy Markdown
Contributor Author

Thanks for working on this.

I have a feeling this is going to require a few back and forths, so if you get tired of working on it, just let me know and I can finish it for you.

You're welcome ! i should be the first one which should thank you, for helping us to use Zig on OpenBSD ! 😄

(i forgot to answer you, sorry of the late), i had no problem to help at all, but if you see i'm struggling a lot (as error handling because idk how to manage, or which message i should print) you can help or even commit on my branch !

implicit decimal with `{d}` for format rather `{}`
@rwsalie

rwsalie commented Jan 24, 2024

Copy link
Copy Markdown
Contributor Author

@andrewrk does this changes seems good ?

@semarie

semarie commented Feb 3, 2024

Copy link
Copy Markdown
Contributor

(OpenBSD dev here), from OpenBSD point of vue, it LGTM.

remove the useless switch(link_mode) put directly target.dynamicLibSuffix()
@rwsalie

rwsalie commented Feb 3, 2024

Copy link
Copy Markdown
Contributor Author

(OpenBSD dev here), from OpenBSD point of vue, it LGTM.

Thank you for your approval! sorry for the latest commit (i forgot to remove the stupid switch(link_mode) case i putted here)

@rwsalie
rwsalie requested a review from andrewrk February 8, 2024 13:28
@alexrp

alexrp commented Apr 25, 2026

Copy link
Copy Markdown
Member

This will have to be rebased and resubmitted on Codeberg.

@alexrp alexrp closed this Apr 25, 2026
github-actions Bot pushed a commit to SB0LTD/sig that referenced this pull request Jul 30, 2026
See ziglang#18475 for a prior attempt at implementing this
github-actions Bot pushed a commit to SB0LTD/sig that referenced this pull request Jul 30, 2026
See ziglang#18475 for a prior attempt at implementing this
jassielof pushed a commit to jassielof/zig that referenced this pull request Aug 6, 2026
See ziglang/zig#18475 for a prior attempt at implementing this
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.

5 participants