using dub and -checkaction=context

Steven Schveighoffer schveiguy at gmail.com
Sun Jan 17 15:41:45 UTC 2021


I'm trying to run unittests using `dub test`, and I wanted to use the 
new -checkaction=context feature to avoid having to instrument my 
unittests to print out the string comparison failure that's happening.

But I tried adding this to my dub.sdl file:

dflags "-checkaction=context" platform="dmd"

But now I get linker errors:

/home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/source/vibe/appmain.d:(.text._D3std8typecons__T10RefCountedTSQBe9container5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCg7PayloadVEQEtQEs24RefCountedAutoInitializei0ZQFm6__dtorMFNaNbNiZv[_D3std8typecons__T10RefCountedTSQBe9container5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCg7PayloadVEQEtQEs24RefCountedAutoInitializei0ZQFm6__dtorMFNaNbNiZv]+0x5c): 
undefined reference to 
`_D4core8internal7dassert__T14_d_assert_failVAyaa1_3eTmTiZQBeFNaNbNiNfKxmxiZQBf'
/home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/.dub/build/epoll-$DFLAGS-linux.posix-x86_64-dmd_2093-6D60905058E56B7C24E84CCDF9B29FD3/libvibe_core.a(sync_1456_5e95.o): 
In function 
`_D4vibe4core4sync__T22RecursiveTaskMutexImplVbi0ZQBd6unlockMFNeZ9__lambda1MFNbNfZv':
/home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/source/vibe/core/sync.d:(.text._D4vibe4core4sync__T22RecursiveTaskMutexImplVbi0ZQBd6unlockMFNeZ9__lambda1MFNbNfZv[_D4vibe4core4sync__T22RecursiveTaskMutexImplVbi0ZQBd6unlockMFNeZ9__lambda1MFNbNfZv]+0xb7): 
undefined reference to 
`_D4core8internal7dassert__T14_d_assert_failVAyaa1_3eTmTiZQBeFNaNbNiNfKxmxiZQBf'
/home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/.dub/build/epoll-$DFLAGS-linux.posix-x86_64-dmd_2093-6D60905058E56B7C24E84CCDF9B29FD3/libvibe_core.a(sync_145a_5e95.o): 
In function 
`_D4vibe4core4sync__T22RecursiveTaskMutexImplVbi1ZQBd6unlockMFNeZ9__lambda1MFNbNfZv':
/home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/source/vibe/core/sync.d:(.text._D4vibe4core4sync__T22RecursiveTaskMutexImplVbi1ZQBd6unlockMFNeZ9__lambda1MFNbNfZv[_D4vibe4core4sync__T22RecursiveTaskMutexImplVbi1ZQBd6unlockMFNeZ9__lambda1MFNbNfZv]+0xb7): 
undefined reference to 
`_D4core8internal7dassert__T14_d_assert_failVAyaa1_3eTmTiZQBeFNaNbNiNfKxmxiZQBf'
/home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/.dub/build/epoll-$DFLAGS-linux.posix-x86_64-dmd_2093-6D60905058E56B7C24E84CCDF9B29FD3/libvibe_core.a(typecons_91_11ed.o): 
In function 
`_D3std8typecons__T10RefCountedTSQBe9container10binaryheap__T10BinaryHeapTSQCuQBq5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCgS_DQCeQCcQCaQBy3ascFNfKQCzKQDdZbZQEt4DataVEQHjQHi24RefCountedAutoInitializei0ZQIc6__dtorMFNaNbNiZv':
/home/steves/.dvm/compilers/dmd-2.093.1/linux/bin/../../src/phobos/std/typecons.d:(.text._D3std8typecons__T10RefCountedTSQBe9container10binaryheap__T10BinaryHeapTSQCuQBq5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCgS_DQCeQCcQCaQBy3ascFNfKQCzKQDdZbZQEt4DataVEQHjQHi24RefCountedAutoInitializei0ZQIc6__dtorMFNaNbNiZv[_D3std8typecons__T10RefCountedTSQBe9container10binaryheap__T10BinaryHeapTSQCuQBq5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCgS_DQCeQCcQCaQBy3ascFNfKQCzKQDdZbZQEt4DataVEQHjQHi24RefCountedAutoInitializei0ZQIc6__dtorMFNaNbNiZv]+0x5c): 
undefined reference to 
`_D4core8internal7dassert__T14_d_assert_failVAyaa1_3eTmTiZQBeFNaNbNiNfKxmxiZQBf'

How am I supposed to do this? I tried setting DFLAGS and LDFLAGS and 
still linker errors. What am I doing wrong?

-Steve


More information about the Digitalmars-d-learn mailing list