Change Log: 2.091.0
Download D nightlies
To be released
This changelog has been automatically generated from all commits in master since the last release.
- The full-text messages are assembled from the changelog/ directories of the respective repositories: dmd, druntime, phobos, tools, dlang.org, installer, and dub.
- See the DLang-Bot documentation for details on referencing Bugzilla. The DAutoTest PR preview doesn't include the Bugzilla changelog.
- The pending changelog can be generated locally by setting up dlang.org and running the pending_changelog target:
make -f posix.mak pending_changelog
Compiler changes
Runtime changes
Library changes
Dub changes
List of all upcoming bug fixes and enhancements in D 2.091.0.
Compiler changes
- Can now extract delegate from lazy parameter
The underlying delegate of the lazy parameter may be extracted using the & operator:
void test(lazy int dg) { int delegate() dg_ = &dg; assert(dg_() == 7); assert(dg == dg_()); } void main() { int a = 7; test(a); }
Previously this caused a compile error.
Runtime changes
- core.memory.GC.inFinalizer was added
A new function exposing information about the state of the GC was added. It returns true if the current thread is executing destructors (finalizers) of objects allocated on the GC heap that are either:
- no longer being referenced
- to whose finalizers an explicit call to GC.runFinalizers was made (usually as part of shared library unloading).
Destructors of objects allocated on the GC heap presently have several limitations or oddities:
- As destructors of all unreachable objects are ran in indeterministic order, there's no guarantee that object members are alive during the object's finalization
- Allocation during finalization is disallowed
- In contrast to stack allocated objects, partially constructed objects (object whose constructor threw an exception) may be finalized
core.memory.GC.inFinalizer can be used to efficiently guard against programming errors such as the above, or to detect whether certain objects were left to be destroyed by the GC.
- Platform dependent execinfo introspection added
A new module (core.internal.execinfo) has been added for platform dependent execinfo detection. On every POSIX system which provides an execinfo implementation as part of its C runtime the appropriate implementation- dependent execinfo module will be imported automatically.
Besides that, there is an opportunity for using external execinfo implementations built as separated libraries and linking DRuntime with them.
IMPORTANT: On platforms with C runtime not providing execinfo functionality one should decide whether an external lib (e.g. libexecinfo) will be used, or not. If not, DRuntime should be built normally without any additional version ID, but with external lib exactly one of the following version IDs should be chosen at compile time. That means, the selected external format cannot be changed later without rebuilding DRuntime.
It could be really important to keep this in mind when someone is packaging DRuntime for such OSs (e.g. ones using musl libc) and provide packages with and without execinfo support (with the specific external library as dependency) or in the case of source based packages, make this build option selectable (e.g. portage).
Version ID Backtrace format ExtExecinfo_BSDFmt 0x00000000 <_D6module4funcAFZv+0x78> at module ExtExecinfo_DarwinFmt 1 module 0x00000000 D6module4funcAFZv + 0 ExtExecinfo_GNUFmt module(_D6module4funcAFZv) [0x00000000] or module(_D6module4funcAFZv+0x78) [0x00000000] or module(_D6module4funcAFZv-0x78) [0x00000000] ExtExecinfo_SolarisFmt object'symbol+offset [pc] These formats above cover most of the "classic" backtrace outputs but as a new important format emerges, it can be easily added.
- Added intrinsic toPrec to round to a specific float precision
The intrinsic core.math.toPrec forces rounding of it floating point argument to the precision of float, double, or real.
Some floating point algorithms, such as Kahan-Babuska-Neumaier Summation, require rounding to specific precisions. Rounding to precision after every operation, however, loses overall precision in the general case and is a runtime performance problem.
Adding these functions guarantee the rounding at required points in the code, and document where in the algorithm the requirement exists.
- Unittest default mode
Switched the default for unittests to only run the tests by default. Use --DRT-testmode=run-main for the original behavior (run unittests then main).
The feature to control unit testing was added in 2.078.0, and the switch above will work for all versions since then.
Library changes
- Deprecated std.array.Appender.toString was removed
The overload accepting a callable was deprecated since 2.079 and has now been removed. Use the overload accepting an output range instead.
- Deprecated std.functional.binaryReverseArgs was removed
This specialisation of reverseArgs accepting exactly two arguments was deprecated since 2.079 and has now been removed. Use reverseArgs instead.
- Deprecated std.bitmanip.BitArray.toString was removed
The overload accepting a callable was deprecated since 2.079 and has now been removed. Use the overload accepting an output range instead.
- Deprecated module std.experimental.all was removed
All symbols contained in Phobos can now be used with import std
- Added get!(T) getter to std.json
This getter will try to return underlying json type as T if possible. It is convenient for automatic integer conversion like this:
import std.json; string s = `{ "a": 123 }`; auto json = parseJSON(s); // This will throw with json["a"].floating assert(json["a"].get!double == 123.0);
Dub changes
- Builds dynamicLibrary targets as dynamic libraries instead of static libraries.
Dub will no longer build dynamicLibrary targetType's as staticLibrary.
Except for x86_omf. This has been disabled due to numerous issues that will lead this to not doing what is expected of it.
No compiler or linker flags have been added at this time, you will need to specify the relevant flag to get the compiler to link dynamically against Phobos.
- The $DUB_BUILD_PATH variable was added
The $DUB_BUILD_PATH variable is now defined inside the postBuildCommands section. It contains the absolute path in which the package was built, and can be used to copy by-products of the build process to their intended locations.
For example, if an executable exports symbols, you will want to make the resulting import library and symbols export file available somewhere. That can be done with a dub.json section like this:
"postBuildCommands-windows": [ "copy /y $DUB_BUILD_PATH\\$DUB_TARGET_NAME.lib $PACKAGE_DIR\\lib" "copy /y $DUB_BUILD_PATH\\$DUB_TARGET_NAME.exp $PACKAGE_DIR\\lib" ],
- Command environment variable substitution changed
Now users can use the documented predefined variables inside custom command directives without the need for a wrapper shell script.
Before this would have failed:
"preBuildCommands": ["$DC -run foo.d"]
unless DC was defined as environment variable outside DUB.It was before possible to run a script that used the $DC environment variable or on POSIX escape the $ with $$DC to make the shell substitute the variable. These workarounds are no longer needed now.
API change: none of the different command directives are no longer substituted with the process environment variables. You now access the raw commands as provided by the user in the recipe. dub describe has been adjusted and now also processes the predefined environment variables as well as the process environment variables.
List of all bug fixes and enhancements in D 2.091.0:
DMD Compiler regressions
- Bugzilla 10100: Identifiers with double underscores and allMembers
- Bugzilla 15812: static struct inside extern(C++) class cannot be used as key to associative array
- Bugzilla 16709: [Reg 2.068] Error: common.to at common.d conflicts with common.to at common.d
- Bugzilla 17098: Takes hours to -O compile then fails with Internal error: backend/cgreg.c 405
- Bugzilla 17145: [REG2.066.0] Tuple expansion error in local enum declaration
- Bugzilla 20391: [REG 2.089] DMD compile times increased by 40% because ENABLE_RELEASE=0 in build
- Bugzilla 20488: AA.length in multiple modules causes opDispatch failure
- Bugzilla 20518: simple import ICE regression
DMD Compiler bugs
- Bugzilla 9937: CTFE floats don't overflow correctly
- Bugzilla 11847: sub-pkg not available as qualified name
- Bugzilla 17257: Wrong recursive template destructor reflection
- Bugzilla 18147: Debug information limited in size
- Bugzilla 19479: Garbage .init in string mixins in static foreach in mixin templates
- Bugzilla 19504: pragma(mangle) ignored for C++ destructors
- Bugzilla 19515: POSIX,C++: Template argument pack wrongly mangled
- Bugzilla 19542: Forward reference segfault with string namespace C++ syntax
- Bugzilla 20362: dmd fails to infer scope parameter for delegate
- Bugzilla 20375: std.typecons.RefCounted does not work with checkaction-context
- Bugzilla 20421: Exceptions don't work when linking through lld-link
- Bugzilla 20474: Deprecation warnings inside deprecated function template
- Bugzilla 20507: Debug statements affect inference of templated functions attributes
- Bugzilla 20514: obj-c info incorrectly placed in __objc_const section
- Bugzilla 20530: is(<...> == module/package) does not work with string mixins
- Bugzilla 20537: traits isPackage/isModule and is(package/module) fail on single level package.d import
- Bugzilla 20538: malformed enum definition compiles
- Bugzilla 20545: Segfault/Assertion failure when parsing invalid AA literal
- Bugzilla 20547: Wrong error message when trying to "new" an associative array
- Bugzilla 20549: Initialization with a tuple of a module symbol referencing itself could crash dmd
- Bugzilla 20551: In @safe code and using delegates, it's possible to escape references to function frame
- Bugzilla 20559: Reference type + alias this + AA + AA.clear causes SEGV
- Bugzilla 20592: [GCC ASM] [ICE] dmd/iasmgcc.d(332): Assertion failure
- Bugzilla 20613: String switch in -betterC fails for 7+ labels
DMD Compiler enhancements
- Bugzilla 18665: Deprecate Undocumented Operator Overloads
- Bugzilla 20569: [DIP1000] allow taking the address of a scope struct field if it has no indirections
Phobos regressions
- Bugzilla 7006: std.math.pow (integral, integral) crashes on negative exponents
- Bugzilla 19738: std.range.choose assignment breaks @safe-ty
- Bugzilla 20511: Can't format JSONValue to OutputRange due to @safe
Phobos bugs
- Bugzilla 5232: [patch] std.conv.to & std.conv.roundTo report invalid overflows for very large numbers
- Bugzilla 5628: std.math unittest disabled - roundoff error in pow() on SSE2
- Bugzilla 7446: [TDPL] Trivial asynchronous file copy example crashes with OwnerTerminated
- Bugzilla 8388: std.traits.MemberFunctionsTuple doesn't work with constructors or destructors
- Bugzilla 12461: Typedef and opOpAssign
- Bugzilla 15891: Compiler error when std.algorithm.cache after 2 layers of std.algorithm.map
- Bugzilla 17427: std.concurrency internal errors on uninitialised mailbox
- Bugzilla 17441: std.traits.moduleName gives wrong answer for modules imported under a different name in a mixin
- Bugzilla 20232: WhiteHole is unusable with @safe interface functions
- Bugzilla 20259: [Function Socket.bind] Doesn't inform what Exception it throws
- Bugzilla 20493: Incorrect result of BigInt * BigInt
- Bugzilla 20495: std.range.choose range is not safe when calling save
- Bugzilla 20521: Checking for and getting empty variables on Wine / XP fails
- Bugzilla 20527: std.json CTFE cannot read integer
- Bugzilla 20540: (White|Black)Hole does not work with return|scope functions
- Bugzilla 20542: std.math.nextafter(NaN, y) and nextafter(x, NaN) should return NaN
- Bugzilla 20544: socket.remoteAddress throws out of memory error with unix domain socket peer
- Bugzilla 20585: std.stdio.File open() failure leaves File in invalid state
- Bugzilla 20639: Some BitArray methods should be const/pure/nothrow/...
Phobos enhancements
- Bugzilla 20146: Allow casting from std.bigint.BigInt to built-in floating point types
- Bugzilla 20480: make std.getopt ready for DIP 1000
- Bugzilla 20548: Use bit vector instead of bool[] in RandomCover when choices cannot be packed in a single word
- Bugzilla 20566: std.sformat should avoid allocating memory when printing floating point values
Druntime regressions
- Bugzilla 19322: A lot of memory is consumed and not freed to the system when Exception is formatted with stacktrace in debug
- Bugzilla 19902: hasElaborateCopyConstructor doesn't know about copy constructors
- Bugzilla 20447: [REG 2.089] importing core.thread exposes unistd, hiding object.dup
Druntime bugs
- Bugzilla 15322: version(Unicode) should affect only default aliases
- Bugzilla 16658: Win32API: default IE ver. set to 4.0 is too old
- Bugzilla 19489: Null function call results in no stack trace
- Bugzilla 19909: core.stdc.errno missing POSIX error code on Windows
- Bugzilla 20459: Runtime arg parsing should stop at '--'
- Bugzilla 20468: emplace doesn't forward constructor arguments' (l/r)valueness
- Bugzilla 20476: chainTogether leaks exception with -dip1008
- Bugzilla 20497: thread with limited stackspace crashes depending on size of TLS
- Bugzilla 20512: Return type of memchr should be inout(void)* rather than void*
- Bugzilla 20513: Return type of wmemchr should be inout(wchar_t)* rather than wchar_t*
- Bugzilla 20591: ldc doesn't print files' directories when printing stack trace
- Bugzilla 20629: atomicStore does not compile for struct using -m64
Druntime enhancements
- Bugzilla 19218: object.destroy should check for classes for static arrays
- Bugzilla 20550: Use fixed seeds for treaps in GC
- Bugzilla 20567: GC should not start threads for parallel marking in simple programs
- Bugzilla 20577: Add missing symbols related to Windows UAC
dlang.org bugs
- Bugzilla 19325: The 'body' keyword is still not deprecated
- Bugzilla 20500: running examples on the home page only displays '1 unittests passed'
Installer enhancements
- Bugzilla 20489: Installer deleting files after install
Contributors to this release (56)
A huge thanks goes to all the awesome people who made this release possible.
- Adam D. Ruppe
- aG0aep6G
- Ahmet Sait
- Alexandru Militaru
- Andrei Alexandrescu
- Asakusa Yakumo
- Atila Neves
- Bastiaan Veelo
- Ben Jones
- Bernhard Seckinger
- Boris Carvajal
- Daniel Kozák
- Dennis Katsonis
- dkorpel
- Don Clugston
- Dragos Carp
- drug007
- dukc
- Etienne Cimon
- Hiroki Noda
- Iain Buclaw
- Jacob Carlborg
- Jiyuan Zhang
- Johan Engelen
- John Colvin
- Jonathan Marler
- Julian Fondren
- Kazuya Takahashi
- Lance Bachmeier
- Manish Khurana
- Manu Evans
- Marco de Wild
- Mark
- Martin Kinkelin
- Martin Nowak
- Mathias Lang
- Mathis Beer
- Moonchild
- MoonlightSentinel
- Nathan Sashihara
- Nicholas Wilson
- Paul Backus
- Petar Kirov
- Rainer Schuetze
- Rasmus Thomsen
- Razvan Nitu
- Robert Schadek
- Sebastiaan Koppe
- Sebastian Wilzbach
- skoppe
- Stefan Koch
- Steven Schveighoffer
- Vladimir Panteleev
- Walter Bright
- Yazan Dabain
- سليمان السهمي (Suleyman Sahmi)