RejectedSoftware Forums

Sign up

dub build has a "all-or-nothing" policy on resolving link flags.

See the case below:
=> Trying to use pkg-config to resolve library flags for ["event", "event_pthreads", "ssl", "crypto"].

The "ssl" and "crypto" libs are available in the system lib path but HAVE NO pkg-config file. The "event", "event_pthreads" DO HAVE a pkg-config file.
This result on full fallback for all libs. Why not use the available pkg-config --libs output and default only the missing ones?

dmd -of.dub/build/application-debug-posix.freebsd-x86_64-dmd-3016DEFA322F9B48A04F8D3A0B2ABCFD/web-framework-example .dub/build/application-debug-posix.freebsd-x86_64-dmd-3016DEFA322F9B48A04F8D3A0B2ABCFD/web-framework-example.o ../../libvibe-d.a -L-levent -L-levent_pthreads -L-lssl -L-lcrypto -g
/usr/bin/ld: cannot find -levent_pthreads
--- errorlevel 1

Re: dub build has a "all-or-nothing" policy on resolving link flags.

On Tue, 11 Mar 2014 10:58:38 GMT, Arjan wrote:

See the case below:
=> Trying to use pkg-config to resolve library flags for ["event", "event_pthreads", "ssl", "crypto"].

The "ssl" and "crypto" libs are available in the system lib path but HAVE NO pkg-config file. The "event", "event_pthreads" DO HAVE a pkg-config file.
This result on full fallback for all libs. Why not use the available pkg-config --libs output and default only the missing ones?

dmd -of.dub/build/application-debug-posix.freebsd-x86_64-dmd-3016DEFA322F9B48A04F8D3A0B2ABCFD/web-framework-example .dub/build/application-debug-posix.freebsd-x86_64-dmd-3016DEFA322F9B48A04F8D3A0B2ABCFD/web-framework-example.o ../../libvibe-d.a -L-levent -L-levent_pthreads -L-lssl -L-lcrypto -g
/usr/bin/ld: cannot find -levent_pthreads
--- errorlevel 1

The problem is that the order of the linker flags may be important and so all libraries must be passed to pkg-config at once. But it looks like the --exists flag would come in handy here. I've added a ticket for this.

Re: dub build has a "all-or-nothing" policy on resolving link flags.

On Tue, 11 Mar 2014 11:28:14 GMT, Sönke Ludwig wrote:

On Tue, 11 Mar 2014 10:58:38 GMT, Arjan wrote:

See the case below:
=> Trying to use pkg-config to resolve library flags for ["event", "event_pthreads", "ssl", "crypto"].

The "ssl" and "crypto" libs are available in the system lib path but HAVE NO pkg-config file. The "event", "event_pthreads" DO HAVE a pkg-config file.
This result on full fallback for all libs. Why not use the available pkg-config --libs output and default only the missing ones?

dmd -of.dub/build/application-debug-posix.freebsd-x86_64-dmd-3016DEFA322F9B48A04F8D3A0B2ABCFD/web-framework-example .dub/build/application-debug-posix.freebsd-x86_64-dmd-3016DEFA322F9B48A04F8D3A0B2ABCFD/web-framework-example.o ../../libvibe-d.a -L-levent -L-levent_pthreads -L-lssl -L-lcrypto -g
/usr/bin/ld: cannot find -levent_pthreads
--- errorlevel 1

The problem is that the order of the linker flags may be important and so all libraries must be passed to pkg-config at once. But it looks like the --exists flag would come in handy here. I've added a ticket for this.

Yes that would make the build work out off the box.
Thanx.