huntlabs / hunt

A refined core library for D programming language. The module has concurrency / collections / event / io / logging / text / serialization and more.
Apache License 2.0
95 stars 15 forks source link

Use meson for building #73

Closed Cogitri closed 4 years ago

Cogitri commented 4 years ago

This is still very WIP. This is still missing:

fixes #72

Cogitri commented 4 years ago

Ah, I guess it won't be possible to split hunt into multiple libs due to it being so interconnected... I guess I'll just have to make one (rather) massive lib, although I don't really like that too much.

Cogitri commented 4 years ago

Hm, I'm currently getting the following when running an exe linking to hunt:

object.Error@rt/minfo.d(371): Cyclic dependency between module constructors/destructors of hunt.concurrency.Executors and hunt.concurrency.AbstractExecutorService
hunt.concurrency.Executors* ->
hunt.concurrency.AbstractExecutorService* ->
hunt.concurrency.FutureTask* ->
hunt.concurrency.Executors*

Illegal instruction (core dumped)
Cogitri commented 4 years ago

Hm, I think the stuff in resources/ is included on runtime, not sure how that is supposed to work unless you run the command in the root of the hunt repo :thinking:

Cogitri commented 4 years ago

The examples work now if you pass --DRT-oncycle=ignore to the binaries due to the dep cycle mentioned above.

Heromyth commented 4 years ago

Ah, I guess it won't be possible to split hunt into multiple libs due to it being so interconnected... I guess I'll just have to make one (rather) massive lib, although I don't really like that too much.

It will not be done in a short time, but it will in a long time.

Heromyth commented 4 years ago

Hm, I'm currently getting the following when running an exe linking to hunt:

object.Error@rt/minfo.d(371): Cyclic dependency between module constructors/destructors of hunt.concurrency.Executors and hunt.concurrency.AbstractExecutorService
hunt.concurrency.Executors* ->
hunt.concurrency.AbstractExecutorService* ->
hunt.concurrency.FutureTask* ->
hunt.concurrency.Executors*

Illegal instruction (core dumped)

It makes me headache! Running dub test can't detect this. So, we will try to fix this in near future.

Heromyth commented 4 years ago

Hm, I think the stuff in resources/ is included on runtime, not sure how that is supposed to work unless you run the command in the root of the hunt repo 🤔

The whole resources directory should be copied into the root in your project. They are used by hunt.util.MimeTypeUtils and hunt.util.Locale respectively

Heromyth commented 4 years ago

The main problem for Meson is that it can't include all the source files in a directory automatically, especially for a unstable project.

Cogitri commented 4 years ago

It makes me headache! Running dub test can't detect this. So, we will try to fix this in near future.

Thanks. No clue why it only happens with meson and not with dub.

The whole resources directory should be copied into the root in your project. They are used by hunt.util.MimeTypeUtils and hunt.util.Locale respectively

Hm, in my opinion we shouldn't have projects copy those into the root of their projects but instead have a shared copy of these somewhere in the system. I'll see what I can do.

The main problem for Meson is that it can't include all the source files in a directory automatically, especially for a unstable project.

I personally don't see the problem with adding/removing a file when you're adding/removing a line. We could emulate scanning for sources in meson, but that's rather fragile.

Cogitri commented 4 years ago

Thanks. No clue why it only happens with meson and not with dub.

Ah! Apparently this only happens when building with meson in debug mode (i.e. with --buildtype=debug, which is also the default of meson). It works fine if you do meson --buildtype=release and build that then.

Cogitri commented 4 years ago

Ah, it's due to meson adding -d-debug to LDC's arguments, so I guess this is more about dub disabling some rather important asserts by default that meson doesn't. Would be best if we could fix this properly.

Cogitri commented 4 years ago

I've started to use this in a project of mine and it appears to work fine.

Heromyth commented 4 years ago

Thanks for your great works! Notify us please after you finished this patch.

Cogitri commented 4 years ago

Seems to work now :tada:

Heromyth commented 4 years ago

Great works! We will merge it soon.

Heromyth commented 4 years ago

I run ninja -C build test and got this error: unrecognized switch '-link-defaultlib-shared'

It seems that dmd can't recongnize this option -link-defaultlib-shared

Cogitri commented 4 years ago

Oh, I guess the option differs between dmd and ldc. I'll look into it

-------- Original Message -------- On 17 Dec 2019, 07:28, Xueping wrote:

I run ninja -C build test and got this error: unrecognized switch '-link-defaultlib-shared'

It seems that dmd can't recongnize this option -link-defaultlib-shared

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.