etcimon / botan

Block & stream ciphers, public key crypto, hashing, KDF, MAC, PKCS, TLS, ASN.1, BER/DER, etc.
Other
85 stars 22 forks source link

Botan fails to build with D 2.084 #49

Closed p-mitana closed 1 year ago

p-mitana commented 5 years ago

Botan fails to build with DMD 2.084.

Performing "debug" build using /usr/bin/dmd for x86_64.
botan-math 1.0.3: target for configuration "regular" is up to date.
memutils 0.4.11: target for configuration "secure" is up to date.
botan 1.12.10: building configuration "full"...
Enhanced memory security is enabled.
Memory debugger enabled
../../../.dub/packages/botan-1.12.10/botan/source/botan/cert/x509/ocsp.d(261,8): Deprecation: Symbol `core.sync.mutex.Mutex` is not visible from module `ocsp` because it is privately imported in module `concurrency`
/usr/include/dmd/druntime/import/object.d(518,9): Error: union `object.destroy!(true, RTSS).destroy.UntypedInit` has forward references
../../../.dub/packages/memutils-0.4.11/memutils/source/memutils/utils.d(163,56): Error: template instance `object.destroy!(true, RTSS)` error instantiating
../../../.dub/packages/memutils-0.4.11/memutils/source/memutils/vector.d(74,24):        instantiated from here: `freeArray!(RTSS, ThreadMem)`
../../../.dub/packages/botan-1.12.10/botan/source/botan/constructs/tss.d(43,12):        instantiated from here: `Vector!(RTSS, ThreadMem)`
../../../.dub/packages/memutils-0.4.11/memutils/source/memutils/refcounted.d(13,2): Error: mixin `memutils.refcounted.RefCounted!(Vector!(RTSS, ThreadMem), ThreadMem).RefCounted.Embed!(m_object, false)` error instantiating
../../../.dub/packages/memutils-0.4.11/memutils/source/memutils/vector.d(299,12): Error: template instance `memutils.refcounted.RefCounted!(Vector!(RTSS, ThreadMem), ThreadMem)` error instantiating
../../../.dub/packages/botan-1.12.10/botan/source/botan/constructs/tss.d(43,12):        instantiated from here: `Vector!(RTSS, ThreadMem)`
../../../.dub/packages/botan-1.12.10/botan/source/botan/test.d(80,8): Deprecation: struct `std.datetime.StopWatch` is deprecated - Use std.datetime.stopwatch.StopWatch.
../../../.dub/packages/botan-1.12.10/botan/source/botan/test.d(80,8): Deprecation: struct `std.datetime.StopWatch` is deprecated - Use std.datetime.stopwatch.StopWatch.
../../../.dub/packages/botan-1.12.10/botan/source/botan/test.d(81,11): Deprecation: struct `std.datetime.StopWatch` is deprecated - Use std.datetime.stopwatch.StopWatch.
/usr/bin/dmd failed with exit code 1.

Note: I forgot to mention: Botan does build successfully for with DMD 2.083.1 or earlier.

bausshf commented 5 years ago

It seems like an issue with the version of memutils that Botan uses.

Perhaps it should use a later version like 0.4.13

p-mitana commented 5 years ago

Nope. From Botan's dub.json:

"memutils": { "version": "~>0.4.8" },

So the latest 0.4.x will be used - and there's no 0.5 currently. I have run dub upgrade, what changed memutils' version to 0.4.13 and am still getting exactly the same error.

Note that memutils itself builds successfully.

bausshf commented 5 years ago

Going to assume that memutils have made breaking changes then which Botan has not updated to.

Try an earlier memutils version and force it to that and see when the change happen.

That way you'll be able to tell exactly what commit etc. made the change.

I will do it myself later if you haven't by then.

p-mitana commented 5 years ago

Downgraded to memutils 0.4.8, as oldest accepted by dub.json. Still the same error.

bausshf commented 5 years ago

Try downgrading Botan then.

Wait... Looking here: https://ci.appveyor.com/project/etcimon/botan

It looks like it's a problem with LDC.

Are you perhaps compiling using LDC?


Edit again:

Okay it does seem like a DMD problem.

It was introduced sometime after dmd-2.074.0

p-mitana commented 5 years ago

From the top of this ticket ;)

Botan fails to build with DMD 2.084

I have tried neither GDC nor LDC. What I forgot to mention in the ticket (but mentioned in the thead on D forum) is that Botan builds successfully with DMD 2.083.1.

So if it is DMD's problem, it must have been introduced exactly in DMD 2.084.

bausshf commented 5 years ago

So if it is DMD's problem, it must have been introduced exactly in DMD 2.084.

I think I found it:

https://dlang.org/changelog/2.084.0.html#destroy_noinit

p-mitana commented 5 years ago

OK. I'll report an issue in DMD, as braking changes should not happen without the deprecation period. I'll also leave this issue here for now.

bausshf commented 5 years ago

Here is the commit: https://github.com/dlang/druntime/commit/6a99ed19ab7a0fb9b6326b6fb1b52fca50fcbd17

sam0x17 commented 5 years ago

so what is the current status of this? Are we waiting on an update to DMD? What version of DMD should we use in the mean time?

p-mitana commented 5 years ago

I have actually decided to move to openssl. For me it looks like the Botan's development has stopped more then half a year ago.

sam0x17 commented 5 years ago

:(

aberba commented 4 years ago

This sucks