www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - dmd 2.099 regression: unittest -checkaction=context and import

reply kdevel <kdevel vogtner.de> writes:
zstack.d:
```
module zstack;
import std.stdio: writeln;

void bar (int [] i)
{
    writeln ("i: ", i);
}

unittest {
    int [] arr;
    bar (arr);
}
```

zrepo.d:
```
module parser;
import std.regex;
import zstack;
```

```
    $ dmd -g -i -unittest -checkaction=context -main -run zrepro 
2>&1 | ddemangle
```

gives

```
zrepro.o: In function `pure nothrow  nogc  safe immutable(char)[] 
core.internal.dassert._d_assert_fail!(int)._d_assert_fail(scope 
const(immutable(char)[]), const(int))':
[...]/dmd2/linux/bin64/../../src/druntime/import/core/internal/dassert.d:41:
undefined reference to `pure nothrow  nogc  safe bool
core.internal.dassert.inFinalizer!().inFinalizer()'
zrepro.o: In function `pure nothrow  nogc  safe uint 
std.uni.sliceBits!(0uL, 
8uL).sliceBits.opCall!(dchar).opCall(dchar)':
[...]/dmd2/linux/bin64/../../src/phobos/std/uni/package.d:5593: 
undefined reference to `pure nothrow  nogc  safe 
immutable(char)[] 
core.internal.dassert._d_assert_fail!(const(uint))._d_assert_fail!(int).
d_assert_fail(scope const(immutable(char)[]), ref const(uint), const(int))'
zrepro.o: In function `pure nothrow  nogc  safe immutable(char)[] 
core.internal.dassert._d_assert_fail!(bool)._d_assert_fail(scope 
const(immutable(char)[]), ref const(bool))':
[...]/dmd2/linux/bin64/../../src/druntime/import/core/internal/dassert.d:41:
undefined reference to `pure nothrow  nogc  safe bool
core.internal.dassert.inFinalizer!().inFinalizer()'
zrepro.o: In function `pure nothrow  nogc  safe uint 
std.uni.sliceBits!(13uL, 
21uL).sliceBits.opCall!(dchar).opCall(dchar)':
[...]/dmd2/linux/bin64/../../src/phobos/std/uni/package.d:5593: 
undefined reference to `pure nothrow  nogc  safe 
immutable(char)[] 
core.internal.dassert._d_assert_fail!(const(uint))._d_assert_fail!(int).
d_assert_fail(scope const(immutable(char)[]), ref const(uint), const(int))'
zrepro.o: In function `pure nothrow  nogc  safe uint 
std.uni.sliceBits!(8uL, 
13uL).sliceBits.opCall!(dchar).opCall(dchar)':
[...]/dmd2/linux/bin64/../../src/phobos/std/uni/package.d:5593: 
undefined reference to `pure nothrow  nogc  safe 
immutable(char)[] 
core.internal.dassert._d_assert_fail!(const(uint))._d_assert_fail!(int).
d_assert_fail(scope const(immutable(char)[]), ref const(uint), const(int))'
zrepro.o: In function `pure nothrow  nogc  safe immutable(char)[] 
core.internal.dassert._d_assert_fail!(ulong)._d_assert_fail!(ulong).
d_assert_fail(scope const(immutable(char)[]), ref const(ulong), const(ulong))':
[...]/dmd2/linux/bin64/../../src/druntime/import/core/internal/dassert.d:70:
undefined reference to `pure nothrow  nogc  safe bool
core.internal.dassert.inFinalizer!().inFinalizer()'
[...]/dmd2/linux/bin64/../../src/druntime/import/core/internal/dassert.d:75:
undefined reference to `pure nothrow  nogc  safe immutable(char)[]
core.internal.dassert.miniFormatFakeAttributes!(ulong).miniForm
tFakeAttributes(ref const(ulong))'
[...]/dmd2/linux/bin64/../../src/druntime/import/core/internal/dassert.d:77:
undefined reference to `pure nothrow  nogc  safe immutable(char)[]
core.internal.dassert.miniFormatFakeAttributes!(ulong).miniForm
tFakeAttributes(ref const(ulong))'
zrepro.o: In function `pure nothrow  nogc  safe immutable(char)[] 
core.internal.dassert._d_assert_fail!(ulong)._d_assert_fail!(int).
d_assert_fail(scope const(immutable(char)[]), ref const(ulong), const(int))':
[...]/dmd2/linux/bin64/../../src/druntime/import/core/internal/dassert.d:70:
undefined reference to `pure nothrow  nogc  safe bool
core.internal.dassert.inFinalizer!().inFinalizer()'
[...]/dmd2/linux/bin64/../../src/druntime/import/core/internal/dassert.d:75:
undefined reference to `pure nothrow  nogc  safe immutable(char)[]
core.internal.dassert.miniFormatFakeAttributes!(ulong).miniForm
tFakeAttributes(ref const(ulong))'
zrepro.o: In function `pure nothrow  nogc  safe immutable(char)[] 
core.internal.dassert._d_assert_fail!(ulong)._d_assert_fail!(ulong).
d_assert_fail(scope const(immutable(char)[]), ref const(ulong), ref
const(ulong))':
[...]/dmd2/linux/bin64/../../src/druntime/import/core/internal/dassert.d:70:
undefined reference to `pure nothrow  nogc  safe bool
core.internal.dassert.inFinalizer!().inFinalizer()'
[...]/dmd2/linux/bin64/../../src/druntime/import/core/internal/dassert.d:75:
undefined reference to `pure nothrow  nogc  safe immutable(char)[]
core.internal.dassert.miniFormatFakeAttributes!(ulong).miniForm
tFakeAttributes(ref const(ulong))'
[...]/dmd2/linux/bin64/../../src/druntime/import/core/internal/dassert.d:77:
undefined reference to `pure nothrow  nogc  safe immutable(char)[]
core.internal.dassert.miniFormatFakeAttributes!(ulong).miniForm
tFakeAttributes(ref const(ulong))'
collect2: ld returned 1 exit status
Error: linker exited with status 1
```

If ```import std.regex;``` is commented out or if 
```-checkaction=context``` is removed from the cmd line the 
unittest passes. Can anybody reproduce this?
Mar 17 2022
parent reply Anonymouse <zorael gmail.com> writes:
On Thursday, 17 March 2022 at 14:00:45 UTC, kdevel wrote:
 If ```import std.regex;``` is commented out or if 
 ```-checkaction=context``` is removed from the cmd line the 
 unittest passes. Can anybody reproduce this?
https://run.dlang.io/is/GYDUBz File an issue, I'd say. The worst thing that can happen is that someone flags it as a duplicate.
Mar 18 2022
parent reply kdevel <kdevel vogtner.de> writes:
On Friday, 18 March 2022 at 19:42:02 UTC, Anonymouse wrote:
 On Thursday, 17 March 2022 at 14:00:45 UTC, kdevel wrote:
 If ```import std.regex;``` is commented out or if 
 ```-checkaction=context``` is removed from the cmd line the 
 unittest passes. Can anybody reproduce this?
https://run.dlang.io/is/GYDUBz File an issue, I'd say. The worst thing that can happen is that someone flags it as a duplicate.
Issue 22902 - dmd 2.099 regression: unittest -checkaction=context and import std.regex causes link error (edit) https://issues.dlang.org/show_bug.cgi?id=22902
May 28 2022
parent reply Gavin Ray <ray.gavin97 gmail.com> writes:
On Saturday, 28 May 2022 at 23:02:45 UTC, kdevel wrote:
 On Friday, 18 March 2022 at 19:42:02 UTC, Anonymouse wrote:
 On Thursday, 17 March 2022 at 14:00:45 UTC, kdevel wrote:
 If ```import std.regex;``` is commented out or if 
 ```-checkaction=context``` is removed from the cmd line the 
 unittest passes. Can anybody reproduce this?
https://run.dlang.io/is/GYDUBz File an issue, I'd say. The worst thing that can happen is that someone flags it as a duplicate.
Issue 22902 - dmd 2.099 regression: unittest -checkaction=context and import std.regex causes link error (edit) https://issues.dlang.org/show_bug.cgi?id=22902
Just came here to say I hit the same bug, here's my import list: ```d import std.typecons : Tuple; import std.container : Array; import std.format : format; import std.stdio; import std.file; import std.conv; import std.outbuffer; import core.stdc.stdio; import core.stdc.stdint; import core.sys.posix.fcntl; import core.sys.posix.unistd; ```
Nov 14 2022
parent reply kdevel <kdevel vogtner.de> writes:
On Monday, 14 November 2022 at 17:08:38 UTC, Gavin Ray wrote:
 Just came here to say I hit the same bug, here's my import list:
* https://issues.dlang.org/show_bug.cgi?id=19937 object._d_assert_fail linker error if compiling with -checkaction=context * https://issues.dlang.org/show_bug.cgi?id=22374 [REG 2.093] 'import std;' with -checkaction=context causes link error * https://issues.dlang.org/show_bug.cgi?id=22902 dmd 2.099 regression: unittest -checkaction=context and import std.regex causes link error Does `dmd -allinst ...` help in your case?
Nov 14 2022
parent Gavin Ray <ray.gavin97 gmail.com> writes:
On Monday, 14 November 2022 at 20:37:12 UTC, kdevel wrote:
 On Monday, 14 November 2022 at 17:08:38 UTC, Gavin Ray wrote:
 Just came here to say I hit the same bug, here's my import 
 list:
* https://issues.dlang.org/show_bug.cgi?id=19937 object._d_assert_fail linker error if compiling with -checkaction=context * https://issues.dlang.org/show_bug.cgi?id=22374 [REG 2.093] 'import std;' with -checkaction=context causes link error * https://issues.dlang.org/show_bug.cgi?id=22902 dmd 2.099 regression: unittest -checkaction=context and import std.regex causes link error Does `dmd -allinst ...` help in your case?
Hey, it does actually, thanks a bunch!
Nov 17 2022