December 21, 2021

On Tuesday, 21 December 2021 at 17:32:44 UTC, rempas wrote:

>

Yeah, you are right! Please eugene use LDC2 and check confirm

LDC2 stdlib does not have correct struct event_t for 12+ in
/usr/local/include/d/core/sys/freebsd/sys/event.d at all,
only for earlier versions, ie without extension field.

DMD stdlib does have, the only problem is the OS version is wrong.


@bsd:~/d> ldc2 -v
binary /usr/local/bin/ldc2
version 1.23.0 (DMD v2.093.1, LLVM 10.0.1)

December 21, 2021

On Tuesday, 21 December 2021 at 18:28:12 UTC, rempas wrote:

>

I would love to see more full (and correct) support for FreeBSD, OpenBSD and DragonflyBSD from Dlang! Maybe one day..

My interest was kqueue facility.
I use linux epoll facility a lot in my progs,
and just wanted to do some exersises with kqueue

December 21, 2021

On Tuesday, 21 December 2021 at 18:35:43 UTC, eugene wrote:

>

LDC2 stdlib does not have correct struct event_t for 12+ in
/usr/local/include/d/core/sys/freebsd/sys/event.d at all,
only for earlier versions, ie without extension field.

DMD stdlib does have, the only problem is the OS version is wrong.


@bsd:~/d> ldc2 -v
binary /usr/local/bin/ldc2
version 1.23.0 (DMD v2.093.1, LLVM 10.0.1)

I'm wondering what happens in the latest LDC2 version. Your version is from 1 year and 4 months ago. The latest release offers pre built binaries from FreeBSD so can you grab one and test to see if there are any changes?

December 21, 2021

On Tuesday, 21 December 2021 at 17:00:06 UTC, Johan wrote:

>

I think the fix is needed here: https://github.com/dlang/dmd/blob/ad8412530e607ffebec36f2dbdff1a6f2798faf7/src/dmd/target.d#L362-L372

looks like this.

it is a little bit strange, that in
/usr/include/d/dmd/core/sys/freebsd/config.d
there is ver 12:

    version (FreeBSD_12) enum __FreeBSD_version = 1202000;
else version (FreeBSD_11) enum __FreeBSD_version = 1104000;
else version (FreeBSD_10) enum __FreeBSD_version = 1004000;
else version (FreeBSD_9)  enum __FreeBSD_version = 903000;
else version (FreeBSD_8)  enum __FreeBSD_version = 804000;
else static assert(false, "Unsupported version of FreeBSD");

but __FreeBSD_version is 1104000 anyway.

December 21, 2021

On Tuesday, 21 December 2021 at 18:42:10 UTC, rempas wrote:

>

I'm wondering what happens in the latest LDC2 version. Your version is from 1 year and 4 months ago.

Well, I just installed it by

pkg intstall ldc

Actually, this is my first experience with FreeBSD,
I did not have much to go deeper.

>

The latest release offers pre built binaries from FreeBSD so can you grab one and test to see if there are any changes?

Oh, no, sorry. :)
It is the problem of FreeBSD maintainers to have fresh ldc in the distribution.

December 21, 2021

On Tuesday, 21 December 2021 at 17:00:06 UTC, Johan wrote:

>

On Tuesday, 21 December 2021 at 10:28:15 UTC, eugene wrote:

>

On Monday, 20 December 2021 at 21:19:43 UTC, rempas wrote:

>

I would recommend you to file an issue just so the developers themself can notice it.

filed an issue, see
https://issues.dlang.org/show_bug.cgi?id=22615

Please add which compiler(s) you have tried in the bug report.

done, added a couple of comments

December 21, 2021

On 12/21/21 1:50 PM, eugene wrote:

>

On Tuesday, 21 December 2021 at 17:00:06 UTC, Johan wrote:

>

I think the fix is needed here: https://github.com/dlang/dmd/blob/ad8412530e607ffebec36f2dbdff1a6f2798faf7/src/dmd/target.d#L362-L372

looks like this.

it is a little bit strange, that in
/usr/include/d/dmd/core/sys/freebsd/config.d
there is ver 12:

     version (FreeBSD_12) enum __FreeBSD_version = 1202000;
else version (FreeBSD_11) enum __FreeBSD_version = 1104000;
else version (FreeBSD_10) enum __FreeBSD_version = 1004000;
else version (FreeBSD_9)  enum __FreeBSD_version = 903000;
else version (FreeBSD_8)  enum __FreeBSD_version = 804000;
else static assert(false, "Unsupported version of FreeBSD");

but __FreeBSD_version is 1104000 anyway.

Not sure how those versions are set. I have a hard time following the dmd code to see where it might check the current-running OS to check for the version.

-Steve

December 21, 2021

On Tuesday, 21 December 2021 at 19:00:04 UTC, eugene wrote:

>

Well, I just installed it by

pkg intstall ldc

Actually, this is my first experience with FreeBSD,
I did not have much to go deeper.

That's nice trying new things ;)

>

Oh, no, sorry. :)
It is the problem of FreeBSD maintainers to have fresh ldc in the distribution.

Yeah, don't use the "pkg" version as it is outdated. It is very hard to keep a whole OS (thousands of packages) up to date. So yeah, uninstall your current ldc and trying with the one from the link I gave you and tell me the output

December 21, 2021

On Tuesday, 21 December 2021 at 19:13:19 UTC, Steven Schveighoffer wrote:

>

On 12/21/21 1:50 PM, eugene wrote:

>
     version (FreeBSD_12) enum __FreeBSD_version = 1202000;
else version (FreeBSD_11) enum __FreeBSD_version = 1104000;
else version (FreeBSD_10) enum __FreeBSD_version = 1004000;
else version (FreeBSD_9)  enum __FreeBSD_version = 903000;
else version (FreeBSD_8)  enum __FreeBSD_version = 804000;
else static assert(false, "Unsupported version of FreeBSD");

but __FreeBSD_version is 1104000 anyway.

Not sure how those versions are set. I have a hard time following the dmd code to see where it might check the current-running OS to check for the version.

I think, it'd be nice to set it in /etc/dmd.conf
Or.. is it bad idea?..

December 21, 2021

On Tuesday, 21 December 2021 at 19:22:35 UTC, rempas wrote:

>

On Tuesday, 21 December 2021 at 19:00:04 UTC, eugene wrote:

>

Well, I just installed it by

pkg intstall ldc

Actually, this is my first experience with FreeBSD,
I did not have much to go deeper.

That's nice trying new things ;)

Yeah, but as I've already said, "new thing" for was kqueue.
That's all.

> >

Oh, no, sorry. :)
It is the problem of FreeBSD maintainers to have fresh ldc in the distribution.

Yeah, don't use the "pkg" version as it is outdated.

But i like to use software out of the box and
do not like compile it from source.

>

It is very hard to keep a whole OS (thousands of packages) up to date. So yeah, uninstall your current ldc and trying with the one from the link I gave you and tell me the output

I do not see any reason for me to do this.
The "problem" (with dmd, not with ldc) is
that despite phobos does contain everthing for ver 12+,
the version itself is incorrect.