Skip to content

shared library version should be optional #2230

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

Closed
daurnimator opened this issue Apr 10, 2019 · 2 comments · Fixed by #6315
Closed

shared library version should be optional #2230

daurnimator opened this issue Apr 10, 2019 · 2 comments · Fixed by #6315
Labels
accepted This proposal is planned. breaking Implementing this issue could cause existing code to no longer compile or have different behavior. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. standard library This issue involves writing Zig code for the standard library. zig build system std.Build, the build runner, `zig build` subcommand, package management
Milestone

Comments

@daurnimator
Copy link
Contributor

Not all shared libraries should have a version; the version parameter to addSharedLibrary in the zig build system should be optional.

@andrewrk andrewrk added this to the 0.5.0 milestone Apr 10, 2019
@andrewrk andrewrk added the proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. label Apr 10, 2019
@andrewrk andrewrk modified the milestones: 0.5.0, 0.6.0 Sep 20, 2019
@daurnimator daurnimator added the zig build system std.Build, the build runner, `zig build` subcommand, package management label Nov 6, 2019
@andrewrk andrewrk added the accepted This proposal is planned. label Nov 27, 2019
@andrewrk
Copy link
Member

Let's make it a tagged union, so that at least people are encouraged to choose to not have a version, vs that being the default.

@andrewrk andrewrk added breaking Implementing this issue could cause existing code to no longer compile or have different behavior. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. standard library This issue involves writing Zig code for the standard library. labels Nov 27, 2019
@andrewrk andrewrk modified the milestones: 0.6.0, 0.7.0 Nov 27, 2019
@waruqi
Copy link

waruqi commented Jul 9, 2020

I also very much hope there is a way to remove '0.0.0' from the dynamic library file name.

on linux:

generate libtest.so.0.0.0 and lld test -> libtest.so.0 not found! oh, no..

on macOS

generate libtest.0.0.0.dylib. I also cannot link -ltest.

for example

[ 37%]: ccache compiling.release src/main.zig
/usr/local/bin/zig build-obj --release-fast --output-dir build/.objs/test/macosx/x86_64/release/src --name main.zig src/main.zig
[ 50%]: ccache compiling.release src/test.zig
/usr/local/bin/zig build-obj --release-fast -fPIC --output-dir build/.objs/testlib/macosx/x86_64/release/src --name test.zig src/test.zig
[ 62%]: linking.release libtestlib.dylib
/usr/local/bin/zig build-lib --strip -dynamic -fPIC --output-dir build/macosx/x86_64/release --name testlib --object build/.objs/testlib/macosx/x86_64/release/src/test.zig.o
[ 87%]: linking.release test
/usr/local/bin/zig build-exe -Lbuild/macosx/x86_64/release -rpath @loader_path --strip -ltestlib --output-dir build/macosx/x86_64/release --name test --object build/.objs/test/macosx/x86_64/release/src/main.zig.o
error: lld: error: Unable to find library for -ltestlib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This proposal is planned. breaking Implementing this issue could cause existing code to no longer compile or have different behavior. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. standard library This issue involves writing Zig code for the standard library. zig build system std.Build, the build runner, `zig build` subcommand, package management
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants