Search code examples
macosd

Error (object._d_arraysetlengthTImpl not found) while building D project on MacOS


I was trying to build existing Dlang project on my home Mac. But I am getting this error. I haven't find anything about it.

$ dub build
Running pre-generate commands for vibe-d:tls...
Performing "debug" build using dmd for x86_64.
tinyendian 0.2.0: target for configuration "library" is up to date.
dyaml 0.8.0: building configuration "library"...
/Library/D/dmd/src/phobos/std/uni.d(935,32): Error: object._d_arraysetlengthTImpl not found. The current runtime does not support resizing arrays, or the runtime is corrupt.
/Library/D/dmd/src/phobos/std/uni.d(968,32): Error: object._d_arraysetlengthTImpl not found. The current runtime does not support resizing arrays, or the runtime is corrupt.
/Library/D/dmd/src/phobos/std/uni.d(4064,18): Error: template instance std.uni.MultiArray!(BitPacked!(uint, 13LU), BitPacked!(bool, 1LU)).MultiArray.length!0LU error instantiating
/Library/D/dmd/src/phobos/std/uni.d(4312,37):        instantiated from here: TrieBuilder!(bool, dchar, 1114112, sliceBits!(8LU, 21LU), sliceBits!(0LU, 8LU))
/Library/D/dmd/src/phobos/std/regex/internal/ir.d(26,14):        instantiated from here: CodepointSetTrie!(13, 8)
/Library/D/dmd/src/phobos/std/uni.d(935,32): Error: object._d_arraysetlengthTImpl not found. The current runtime does not support resizing arrays, or the runtime is corrupt.
/Library/D/dmd/src/phobos/std/uni.d(968,32): Error: object._d_arraysetlengthTImpl not found. The current runtime does not support resizing arrays, or the runtime is corrupt.
/Library/D/dmd/src/phobos/std/uni.d(4064,18): Error: template instance std.uni.MultiArray!(BitPacked!(uint, 13LU), BitPacked!(bool, 1LU)).MultiArray.length!1LU error instantiating
/Library/D/dmd/src/phobos/std/uni.d(4312,37):        instantiated from here: TrieBuilder!(bool, dchar, 1114112, sliceBits!(8LU, 21LU), sliceBits!(0LU, 8LU))
/Library/D/dmd/src/phobos/std/regex/internal/ir.d(26,14):        instantiated from here: CodepointSetTrie!(13, 8)
dmd failed with exit code 1.


Can somebody pls help?
I am using these:
MacOS 10.15.4
DMD64 v2.091.1
DUB 1.20.1


Solution

  • Thx to Adam D. Ruppe.

    It looks like there was a problem with previously installed version of dmd. Solved by:

    • brew uninstall dub
    • brew uninstall dmd
    • delete /Library/D directory
    • brew install dmd
    • brew install dub