Thread overview | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
May 23, 2019 Using D's precise GC when running an app with DUB | ||||
---|---|---|---|---|
| ||||
How do I specify a druntime flag such as --DRT-gcopt=gc:precise when running with dub as dub run --compiler=dmd --build=unittest ? The precise GC flag was introduced in verison 2.085.0 See: - https://dlang.org/changelog/2.085.0.html#gc_precise - https://dlang.org/spec/garbage.html#precise_gc |
May 24, 2019 Re: Using D's precise GC when running an app with DUB | ||||
---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | On 24/05/2019 2:50 AM, Per Nordlöw wrote:
> How do I specify a druntime flag such as
>
> --DRT-gcopt=gc:precise
>
> when running with dub as
>
> dub run --compiler=dmd --build=unittest
dub run --compiler=dmd --build=unittest -- --DRT-gcopt=gc:precise
|
May 23, 2019 Re: Using D's precise GC when running an app with DUB | ||||
---|---|---|---|---|
| ||||
Posted in reply to rikki cattermole | On Thursday, 23 May 2019 at 14:51:41 UTC, rikki cattermole wrote:
> dub run --compiler=dmd --build=unittest -- --DRT-gcopt=gc:precise
Thanks!
And if I want to set this in a dub.sdl?
|
May 23, 2019 Re: Using D's precise GC when running an app with DUB | ||||
---|---|---|---|---|
| ||||
Posted in reply to rikki cattermole | On Thursday, 23 May 2019 at 14:51:41 UTC, rikki cattermole wrote:
> dub run --compiler=dmd --build=unittest -- --DRT-gcopt=gc:precise
Hmm, the flag doesn't propagate to dmd when compiling in verbose mode via -v as
dub run -v --compiler=dmd --build=unittest -- --DRT-gcopt=gc:precise
Shouldn't it?
|
May 24, 2019 Re: Using D's precise GC when running an app with DUB | ||||
---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | On 24/05/2019 2:58 AM, Per Nordlöw wrote:
> On Thursday, 23 May 2019 at 14:51:41 UTC, rikki cattermole wrote:
>> dub run --compiler=dmd --build=unittest -- --DRT-gcopt=gc:precise
>
> Thanks!
>
> And if I want to set this in a dub.sdl?
No can do. There is meant to be a way to set it in D however.
But I have heard mixed results (not that I've tried it).
|
May 24, 2019 Re: Using D's precise GC when running an app with DUB | ||||
---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | On 24/05/2019 3:01 AM, Per Nordlöw wrote:
> On Thursday, 23 May 2019 at 14:51:41 UTC, rikki cattermole wrote:
>> dub run --compiler=dmd --build=unittest -- --DRT-gcopt=gc:precise
>
> Hmm, the flag doesn't propagate to dmd when compiling in verbose mode via -v as
>
> dub run -v --compiler=dmd --build=unittest -- --DRT-gcopt=gc:precise
>
> Shouldn't it?
No. You told dub to -v.
DFLAGS="-v" dub run --compiler=dmd --build=unittest -- --DRT-gcopt=gc:precise
|
May 23, 2019 Re: Using D's precise GC when running an app with DUB | ||||
---|---|---|---|---|
| ||||
Posted in reply to rikki cattermole | On Thursday, 23 May 2019 at 15:02:12 UTC, rikki cattermole wrote:
>> And if I want to set this in a dub.sdl?
>
> No can do. There is meant to be a way to set it in D however.
> But I have heard mixed results (not that I've tried it).
Should be as easy as
dflags "--DRT-gcopt=gc:precise"
right?
|
May 24, 2019 Re: Using D's precise GC when running an app with DUB | ||||
---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | On 24/05/2019 3:03 AM, Per Nordlöw wrote:
> On Thursday, 23 May 2019 at 15:02:12 UTC, rikki cattermole wrote:
>>> And if I want to set this in a dub.sdl?
>>
>> No can do. There is meant to be a way to set it in D however.
>> But I have heard mixed results (not that I've tried it).
>
> Should be as easy as
>
> dflags "--DRT-gcopt=gc:precise"
>
> right?
That would be passed to dmd, not to the build executable upon running.
|
May 23, 2019 Re: Using D's precise GC when running an app with DUB | ||||
---|---|---|---|---|
| ||||
Posted in reply to rikki cattermole | On Thursday, 23 May 2019 at 15:05:15 UTC, rikki cattermole wrote:
>> Should be as easy as
>>
>> dflags "--DRT-gcopt=gc:precise"
>>
>> right?
>
> That would be passed to dmd, not to the build executable upon running.
You mean wise versa, right?
Now I understand,
--DRT-gcopt=gc:precise
is passed to the resulting binary...
|
May 23, 2019 Re: Using D's precise GC when running an app with DUB | ||||
---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | On Thursday, 23 May 2019 at 14:50:12 UTC, Per Nordlöw wrote:
> How do I specify a druntime flag such as
>
> --DRT-gcopt=gc:precise
>
> when running with dub as
>
> dub run --compiler=dmd --build=unittest
>
> ?
>
> The precise GC flag was introduced in verison 2.085.0
>
> See:
> - https://dlang.org/changelog/2.085.0.html#gc_precise
> - https://dlang.org/spec/garbage.html#precise_gc
You can put into the source:
extern(C) __gshared string[] rt_options = [
"gcopt=gc:precise"
];
you can wrap it into some "version ()" and set the version in the dub configuration.
|
Copyright © 1999-2021 by the D Language Foundation