Use bundled OpenSSL until pkgsrc provides the required 1.1.x.
### Notable Changes
- Assert
- Calling `assert.fail()` with more than one argument is deprecated.
- Calling `assert.ok()` with no arguments will now throw.
- Calling `assert.ifError()` will now throw with any argument other
than `undefined` or `null`. Previously the method would throw with
any truthy value.
- The `assert.rejects()` and `assert.doesNotReject()` methods have
been added for working with async functions.
- Async_hooks
- Older experimental async_hooks APIs have been removed.
- Buffer
- Uses of `new Buffer()` and `Buffer()` outside of the
`node_modules` directory will now emit a runtime deprecation
warning.
- `Buffer.isEncoding()` now returns `undefined` for falsy values,
including an empty string.
- `Buffer.fill()` will throw if an attempt is made to fill with an
empty `Buffer`.
- Child Process
- Undefined properties of env are ignored.
- Console
- The `console.table()` method has been added.
- Crypto
- The `crypto.createCipher()` and `crypto.createDecipher()` methods
have been deprecated. Please use `crypto.createCipheriv()` and
`crypto.createDecipheriv()` instead.
- The `decipher.finaltol()` method has been deprecated.
- The `crypto.DEFAULT_ENCODING` property has been deprecated.
- The `ECDH.convertKey()` method has been added.
- The `crypto.fips` property has been deprecated.
- Dependencies
- V8 has been updated to 6.6.
- OpenSSL has been updated to 1.1.0h.
- EventEmitter
- The `EventEmitter.prototype.off()` method has been added as an
alias for `EventEmitter.prototype.removeListener()`.
- File System
- The `fs/promises` API provides experimental promisified versions
of the `fs` functions.
- Invalid path errors are now thrown synchronously.
- The `fs.readFile()` method now partitions reads to avoid thread
pool exhaustion.
- HTTP
- Processing of HTTP Status codes `100`, `102-199` has been
improved.
- Multi-byte characters in URL paths are now forbidden.
- N-API
- The n-api is no longer experimental.
- Net
- The `'close'` event will be emitted after `'end'`.
- Perf_hooks
- The `PerformanceObserver` class is now an `AsyncResource` and can
be monitored using `async_hooks`.
- Trace events are now emitted for performance events.
- The `performance` API has been simplified.
- Performance milestone marks will be emitted as trace events.
- Process
- Using non-string values for `process.env` is deprecated.
- The `process.assert()` method is deprecated.
- REPL
- REPL now experimentally supports top-level await when using the
`--experimental-repl-await` flag.
- The previously deprecated "magic mode" has been removed.
- The previously deprecated `NODE_REPL_HISTORY_FILE` environment
variable has been removed.
- Proxy objects are shown as Proxy objects when inspected.
- Streams
- The `'readable'` event is now always deferred with nextTick.
- A new `pipeline()` method has been provided for building
end-to-data stream pipelines.
- Experimental support for async for-await has been added to
`stream.Readable`.
- Timers
- The `enroll()` and `unenroll()` methods have been deprecated.
- TLS
- The `tls.convertNPNProtocols()` method has been deprecated.
- Support for NPN (next protocol negotiation) has been dropped.
- The `ecdhCurve` default is now `'auto'`.
- Trace Events
- A new `trace_events` top-level module allows trace event
categories to be enabled/disabled at runtime.
- URL
- The WHATWG URL API is now a global.
- Util
- `util.types.is[…]` type checks have been added.
- Support for bigint formatting has been added to `util.inspect()`.
#### Deprecations:
The following APIs have been deprecated in Node.js 10.0.0
- Passing more than one argument to `assert.fail()` will emit a
runtime deprecation warning.
- Previously deprecated legacy async_hooks APIs have reached
end-of-life and have been removed.
- Using `require()` to access several of Node.js' own internal
dependencies will emit a runtime deprecation.
- The `crypto.createCipher()` and `crypto.createDecipher()` methods
have been deprecated in documentation.
- Using the `Decipher.finaltol()` method will emit a runtime
deprecation warning.
- Using the `crypto.DEFAULT_ENCODING` property will emit a runtime
deprecation warning.
- Use by native addons of the `MakeCallback()` variant that passes a
`Domain` will emit a runtime deprecation warning.
- Previously deprecated internal getters/setters on `net.Server` has
reached end-of-life and have been removed.
- Use of non-string values for `process.env` has been deprecated in
documentation.
- Use of `process.assert()` will emit a runtime deprecation warning.
- Previously deprecated `NODE_REPL_HISTORY_FILE` environment variable
has reached end-of-life and has been removed.
- Use of the `timers.enroll()` and `timers.unenroll()` methods will
emit a runtime deprecation warning.
- Use of the `tls.convertNPNProtocols()` method will emit a runtime
deprecation warning. Support for NPN has been removed from Node.js.
- The `crypto.fips` property has been deprecated in documentation.
The previous MAP_32BIT workaround was insufficient, SpiderMonkey still makes
certain assumptions about memory layout, requiring that the high 17 bits are
clear. This was most noticeable with couchdb's couchjs process that would
reliably segfault.
Instead, apply a mixture of Debian and upstream patches to implement their
ia64 workaround on SunOS/x86_64, utilising both a fixed mmap range and
disabling static strings to workaround this issue.
Tested with the couchdb test suite which now runs to completion.
Bump PKGREVISION.
Vala 0.40.4
===========
* Various improvements and bug fixes:
- girparser: Add support for NoAccessorMethod metadata
* Bindings:
- glib-2.0: Mark str parameter of Variant.take_string() as owned
- gstreamer: Update from 1.15+ git master
- gtk+-*.0: Set NoAccessorMethod on Gtk.Radio*.group properties
(Regression in gtk+-3.0)
- gtk+-4.0: Update to 3.93.0+fc6018f1
- json-glib-1.0: Mark return-type of gvariant_deserialize*() as nullable
- webkit2gtk-4.0: Update to 2.20.1
5.26.2:
Security
[CVE-2018-6797] heap-buffer-overflow (WRITE of size 1) in S_regatom (regcomp.c)
A crafted regular expression could cause a heap buffer write overflow, with control over the bytes written.
[CVE-2018-6798] Heap-buffer-overflow in Perl__byte_dump_string (utf8.c)
Matching a crafted locale dependent regular expression could cause a heap buffer read overflow and potentially information disclosure.
[CVE-2018-6913] heap-buffer-overflow in S_pack_rec
pack() could cause a heap buffer write overflow with a large item count.
Assertion failure in Perl__core_swash_init (utf8.c)
Control characters in a supposed Unicode property name could cause perl to crash. This has been fixed.
Updated Modules and Pragmata
Module::CoreList has been upgraded from version 5.20170922_26 to 5.20180414_26.
PerlIO::via has been upgraded from version 0.16 to 0.17.
Term::ReadLine has been upgraded from version 1.16 to 1.17.
Unicode::UCD has been upgraded from version 0.68 to 0.69.
Selected Bug Fixes
The readpipe() built-in function now checks at compile time that it has only one parameter expression, and puts it in scalar context, thus ensuring that it doesn't corrupt the stack at runtime.
Fixed a use after free bug in pp_list introduced in Perl 5.27.1.
Parsing a sub definition could cause a use after free if the sub keyword was followed by whitespace including newlines (and comments).
The tokenizer now correctly adjusts a parse pointer when skipping whitespace in an ${identifier} construct.
Accesses to ${^LAST_FH} no longer assert after using any of a variety of I/O operations on a non-glob.
sort now performs correct reference counting when aliasing $a and $b, thus avoiding premature destruction and leakage of scalars if they are re-aliased during execution of the sort comparator.
Some convoluted kinds of regexp no longer cause an arithmetic overflow when compiled.
Fixed a duplicate symbol failure with -flto -mieee-fp builds. pp.c defined _LIB_VERSION which -lieee already defines.
A NULL pointer dereference in the S_regmatch() function has been fixed.
Failures while compiling code within other constructs, such as with string interpolation and the right part of s///e now cause compilation to abort earlier.
SpiderMonkey makes assumptions about memory layout that break in a 64-bit SunOS
environment, so limit mmap() to the lower 32-bit address space. Provides a
workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=577056
Vala 0.40.3
===========
* Various bug fixes:
- vala: Fix return-type of BasicBlock.get_successors()
* Bindings:
- gstreamer: Update from 1.15+ git master
- gtk+-3.0: Fix regression of StatusIcon.position_menu() [#891629]
- gtk+-4.0: Update to 3.93.0+ff738269
- libgsf-1: Update to 1.14.42+ [#794777]
Vala 0.40.2
===========
* Various bug fixes:
- gdbus: Fix missing declaration of _fd_list for async methods [#794566]
* Bindings:
- glib-2.0: Use g_value_*et_schar instead of deprecated g_value_*et_char
- gobject-2.0: Add ParamSpecGType
- gtk+-*.0: Hide dedicated constructors of compact classes bound as structs
[#794733]
Vala 0.40.1
===========
* Various bug fixes:
- codegen: Don't add target fields for captured delegates without target
- codegen: Don't add length fields for captured fixed-length array variables
- valadoc: Bump VALA_0_xx defines and glib_minor to match 0.40 series
* Bindings:
- Add libgeoclue-2.0 bindings [#794376]
- gobject-2.0: Cherry-pick some changes from 0.42
- gdk-3.0,gtk+-3.0: Update to 3.22.29
- gtk+-4.0: Update to 3.93.0+433517fd
- gtk+-*.0: Fix iter parameter of TextView.backward*/forward*/move_visually()
[#794345]
- gstreamer-1.0: Update to 1.13.91 and add gstreamer-webrtc-1.0 bindings
- libgsf-1: Switch to GIR and update to 1.14.42
- linux: Add various symbols
- posix: Add various symbols
- posix: Include sys/sysmacros.h for major(), minor() and makedev() [#794651]
- webkit-1.0: Update to 2.4.11
- webkit2gtk-4.0: Update to 2.20.0
- Update GIR-based bindings
Vala 0.40.0
===========
* Various bug fixes:
- compiler: Fix critical when vala is called without run args [#793657]
* Bindings:
- alsa: Add the major part of the ALSA Sequencer API [#763127]
- gstreamer-1.0: Update to 1.13.90
- gtk+-4.0: Update to 3.93.0+527d265b
- linux: Add various symbols
- posix: Add various symbols [#663633]
- Update GIR-based bindings
Vala 0.39.92
============
* Highlights
- Add support for feature test macros [#793444]
e.g. [CCode (feature_test_macro = "_GNU_SOURCE")]
* Various bug fixes:
- codegen:
+ Use pointers when accessing constant multi-dimensional arrays [#604371]
+ Add valid support for const multi-dimensional arrays [#604371]
+ Don't append fixed-length of array fields in initializers
+ Add source_reference to some store_local/_field() calls
- Properly handle array-initializers inside struct-initializers [#622178]
- The rank of an array-initializer should match the target's rank [#744923]
- Make SemanticAnalyzer.check_arguments() independent of context
- Check with same rules for dbus compatibility as in GBusModule [#793859]
- Fix recursive declaration in generic base type [#688732]
- Prevent WITH_CGRAPH conditional having an impact on generated sources
- Update manual from wiki.gnome.org
* Bindings:
- glib-2.0, posix: Add feature test macro _GNU_SOURCE for pow10(3),
pow10f(3), exp10(3) and exp10f(3) [#614788]
- gstreamer-1.0: Update from 1.13.1+ git master
- linux: Add dup3 [#729803]
- linux: Add feature_test_macros to non-POSIX file control constants and dup3
- posix: Fix sig*set and sigprocmask parameters to be out/ref [#727425]
- posix: Add feature_test_macro _GNU_SOURCE to sighandler_t [#761975]
- libgnome-menu-3.0: Add deps file
- Update GIR-based bindings
Vala 0.39.91
============
* Various bug fixes:
- Fix GDestroyNotify of delegate parameters in delegate declaration [#639059]
- Avoid critical when connecting dynamic signals
- valac: Always use the given "pkg-config" and respect PKG_CONFIG envar
- compiler: Prefix headers for set_cheader_override() if includedir is given
[#793299]
- vala: Issue a warning on DBus methods which are not throwing an Error
- Don't warn about unused internal methods which are meant to be visible
on DBus [#593902]
- Don't install vapicheck [#793370]
* Bindings:
- glib-2.0: Add KeyFile.get_locale_for_key()
- gstreamer-1.0: Update from 1.13+ git master
- gtk+-4.0: Update to 3.93.0+d07b14f4
- purple: Update to 2.12.0
- Update GIR-based bindings
Vala 0.39.7
===========
* Regression fix:
- codegen: Don't try to infer error argument on async begin methods [#793158]
This was a regression introduced by [#614294]
Vala 0.39.6
===========
* Highlights
- Add --abi-stability option for ABI stability of libraries
It ensures that the order of class/interface members in Vala sources will
be preserved in generated C source (instance/type structs) [#789069]
* Various bug fixes:
- girparser:
+ Set NoAccessorMethod for non-readable and construct-only properties
+ Ignore conflicting closure/destroy indexes
+ Don't accept methods as property-accessor which throw errors [#792998]
- codegen:
+ Infer error parameter from abstract/virtual base methods [#614294]
+ Internally generated delegates don't require a typedef [#787521]
+ Fix return-type for cancelled async creation methods of classes [#792942]
+ Use G_PARAM_STATIC_STRINGS
- vala: Variadic constructors without a real first parameter are not allowed
- libvaladoc: Keep bootstrap-support with valac >= 0.16.1
* Bindings:
- gtk+-3.0: Fix cheader_filename of Plug and Socket
- gtk+-4.0: Update to 3.93.0+4d36a0bf
- gtk+-4.0: Only override type of "event" parameters
- posix: Add ctime(3) and fix binding of struct hostent and gethostbyname(3)
Vala 0.39.5
===========
* Various bug fixes:
- libvaladoc: Allow @link tags to be split over multiple lines [#646982]
- libvaladoc: Add support for single line documentation comments [#736483]
- girparser: Improve instance method detection [#732460]
- codegen: Add support for abstract/virtual methods and properties in
compact classes [#741465]
- vala: Fix parameter type inference of overridden async methods [#792660]
- codewriter: Don't use string.replace() to apply header_to_override [#731322]
* Bindings:
- gio-unix-2.0: Update to 2.55.1
- gtk+-4.0: Update to 3.93.0+60d3378d
- libwnck-3.0: Update to 3.24.1
- webkit2gtk-4.0: Update to 2.19.5
- webkit2gtk-web-extension-4.0: Fix DOM.EventTarget interface
Vala 0.39.4
===========
* Various improvements and bug fixes:
- codegen
+ Only add property-enum and GParamSpec-array for GObject classes
+ Use g_enum/flags_to_string while targeting glib >= 2.54
+ Add destroy param when invoking delegate returned by delegate [#792077]
- Don't write trailing space in function declarations/definitions [#688447]
- vala: Add pkgdatadir and pkglibdir to pkg-config file
- gidlparser: Update type qualifiers
* Bindings:
- gtk+-2.0/3.0: Don't hide user_data in Clipboard.set_with_data() [#792237]
- gtk+-3.0: Update to 3.22.26+6f26d0dc
- gtk+-4.0: Update to 3.93.0+6aeae2c8
Vala 0.39.3
===========
* Various bug fixes:
- Fix chain-up regression with real non-null struct parameters [#791785]
- Release taken references to CodeContext after using it [#712694] and keep
custom invocations of parse_file() possible [#791936]
- parser: Accept comma-separated list in case-statements of switchs [#614015]
* Bindings:
- Remove bindings which are shipped upstream for some years
+ gedit 3 [#776021], libgnome-keyring [#776022],
gtksourceview-3.0 [#776023], libgdata [#776024], librsvg-2.0 [#776025]
- glib-2.0: Add GLib.OPTION_REMAINING and GLib.OptionFlags.NONE
- gstreamer-1.0: Update from 1.13+ git master
- gtk+-2.0: Mark MessageDialog constructor parameter, message_format, as
nullable [#791570]
- gtk+-4.0: Update to 3.93.0+6aeae2c8
- webkit2gtk-4.0: Update to 2.19.3
Vala 0.39.2
===========
* Various bug fixes:
- vala: Don't transform an explicit "null" into valid format-string [#791215]
- codegen: Don't create null-safe destroy-wrapper for GenericType [#791283]
- Improve error message for missing type-parameter on enclosing type [#587905]
* GIR parser:
- Allow change of parameter names
- Handle metadata for fields inside a transparent union
- Accept setters with boolean return-type as valid property-accessor
- Don't mark simple-type out-parameters with '?' as nullable
* Valadoc
- libvaladoc: Actually resolve "percnt;" to '%'
* Bindings:
- glib-2.0: Fix potential null pointer dereference in string.joinv() [#791257]
- gobject-2.0: Add missing GType constants for fundamentals [#791023]
- gstreamer-1.0: Update from 1.13+ git master
- gtk+-3.0: Switch to GIR [#730746]
- gtk+-4.0: Update to 3.93.0+6af4947e
- posix: Move signal constants to an enum and add few missing ones [#790958]
Vala 0.39.1
===========
* Highlights
- Report warning if property-type is not compatible with GLib.Object [#693932]
- Allow to pass compatible delegates to signal.connect() [#787521]
- Allow unscoped enum values where possible
- Avoid use of temp-var for some callables returning ValueType
and to access in/ref parameters [#789071]
- Reformat generated source declarations and definitions for better
readability [#688447]
* Various bug fixes:
- Use array_length_cexpr to support fixed-arrays for return-values [#784691]
- Properly parse arguments for vala interpeter-mode [#663070]
- Enforce name-length >= 3 for structs using GType [#764041]
- Report error for missing type-parameter on enclosing type [#587905]
- Add boolean "use_inplace" ccode-attribute for methods [#750840]
- Improve handling of unowned/owned keyword occurrences
- Methods need to throw compatible error if target delegate throws one
- Discover invalid member access to instance field [#790903]
- Improve error output of mismatching overriding methods
* Valadoc
- Acknowledge possible properties in structs [#784705]
- Fix fatal typo in GtkdocRenderer.visit_symbol_link() [#790266]
* Bindings:
- glib-2.0: Use type-id/marshaller-type for (u)int16/(u)short from (u)int32
[#693932]
- glib-2.0: Add optional 'unparsed' parameter to *.try_parse () [#774124]
- gobject-2.0: Add some missing symbols
- gstreamer-1.0: Bind GST_TIME_ARGS, GST_STIME_ARGS macros [#750840]
- gstreamer-1.0: Bind GST_DEBUG_BIN_TO_DOT_FILE/*_WITH_TS [#785215]
- gstreamer-1.0: Update from 1.13+ git master
- gtk+-3.0: Update to 3.22.26+9ce824d3
- gtk+-4.0: Split Gsk.RenderNode into several classes
- gtk+-4.0: Update to 3.93.0+2d797dd8
- webkit2gtk-4.0: Update to 2.19.2
- deps: Updated ICU to 61.1
- fs: Emit 'ready' event for ReadStream and WriteStream
- n-api: Bump version of n-api supported
- net: Emit 'ready' event for Socket
Upstream changes:
Version 2.78.5, April 3, 2018
Within a bound yabasic-programs the name is correctly set (as returned by peeking "program_name")
Introduced new string-peeks "program_name" and "program_file_name"
Bugfixes regarding bound programs and libraries
Version 2.78.4, March 2118, 2018
Fixed a problem with bound yabasic-programs, that include more than three libraries
Introduced new peek "secondsrunning"
Changelog:
Version 1.25.0 (2018-03-29)
Language
Stabilised #[repr(align(x))]. RFC 1358
You can now use nested groups of imports. e.g. use std::{fs::File, io::Read, path::{Path, PathBuf}};
You can now have | at the start of a match arm. e.g.
enum Foo { A, B, C }
fn main() {
let x = Foo::A;
match x {
| Foo::A
| Foo::B => println!("AB"),
| Foo::C => println!("C"),
}
}
Compiler
Upgraded to LLVM 6.
Added -C lto=val option.
Added i586-unknown-linux-musl target
Libraries
Impl Send for process::Command on Unix.
Impl PartialEq and Eq for ParseCharError.
UnsafeCell::into_inner is now safe.
Implement libstd for CloudABI.
Float::{from_bits, to_bits} is now available in libcore.
Implement AsRef<Path> for Component
Implemented Write for Cursor<&mut Vec<u8>>
Moved Duration to libcore.
Stabilized APIs
Location::column
ptr::NonNull
The following functions can now be used in a constant expression. eg. static MINUTE: Duration = Duration::from_secs(60);
Duration::new
Duration::from_secs
Duration::from_millis
Cargo
cargo new no longer removes rust or rs prefixs/suffixs.
cargo new now defaults to creating a binary crate, instead of a library crate.
Misc
Rust by example is now shipped with new releases
Compatibility Notes
Deprecated net::lookup_host.
rustdoc has switched to pulldown as the default markdown renderer.
The borrow checker was sometimes incorrectly permitting overlapping borrows around indexing operations (see #47349). This has been fixed (which also enabled some correct code that used to cause errors (e.g. #33903 and #46095).
Removed deprecated unstable attribute #[simd].
- No code changes
nodejs 9.10.0
Fixes for the following CVEs are included in this release:
- CVE-2018-7158
- CVE-2018-7159
- CVE-2018-7160
Notable Changes
- Fix for inspector DNS rebinding vulnerability (CVE-2018-7160): A
malicious website could use a DNS rebinding attack to trick a web
browser to bypass same-origin-policy checks and allow HTTP connections
to localhost or to hosts on the local network, potentially to an open
inspector port as a debugger, therefore gaining full code execution
access. The inspector now only allows connections that have a browser
Host value of localhost or localhost6.
- Fix for 'path' module regular expression denial of service
(CVE-2018-7158): A regular expression used for parsing POSIX paths
could be used to cause a denial of service if an attacker were able to
have a specially crafted path string passed through one of the
impacted 'path' module functions.
- Reject spaces in HTTP Content-Length header values (CVE-2018-7159):
The Node.js HTTP parser allowed for spaces inside Content-Length
header values. Such values now lead to rejected connections in the
same way as non-numeric values.
- Update root certificates: 5 additional root certificates have been
added to the Node.js binary and 30 have been removed.
- cluster: Add support for NODE_OPTIONS="--inspect"
- crypto: Expose the public key of a certificate
- n-api: Add napi_fatal_exception to trigger an uncaughtException in
JavaScript
- path: Fix regression in posix.normalize
- stream: Improve stream creation performance
nodejs 9.9.0
assert:
- From now on all error messages produced by assert in strict mode will
produce a error diff.
- From now on it is possible to use a validation object in throws instead
of the other possibilities.
crypto:
- allow passing null as IV unless required
fs:
- support as and as+ flags in stringToFlags()
tls:
- expose Finished messages in TLSSocket
tty:
- Add getColorDepth function to determine if terminal supports colors.
util:
- add util.inspect compact option
Fixes for the following CVEs are included in this release:
- CVE-2018-7158
- CVE-2018-7159
- CVE-2018-7160
Notable Changes
- Fix for inspector DNS rebinding vulnerability (CVE-2018-7160): A
malicious website could use a DNS rebinding attack to trick a web
browser to bypass same-origin-policy checks and allow HTTP connections
to localhost or to hosts on the local network, potentially to an open
inspector port as a debugger, therefore gaining full code execution
access. The inspector now only allows connections that have a browser
Host value of localhost or localhost6.
- Fix for 'path' module regular expression denial of service
(CVE-2018-7158): A regular expression used for parsing POSIX paths
could be used to cause a denial of service if an attacker were able to
have a specially crafted path string passed through one of the
impacted 'path' module functions.
- Reject spaces in HTTP Content-Length header values (CVE-2018-7159):
The Node.js HTTP parser allowed for spaces inside Content-Length
header values. Such values now lead to rejected connections in the
same way as non-numeric values.
- Update root certificates: 5 additional root certificates have been
added to the Node.js binary and 30 have been removed.
Fixes for the following CVEs are included in this release:
- CVE-2018-7158
- CVE-2018-7159
- CVE-2018-7160
Notable Changes
- Fix for inspector DNS rebinding vulnerability (CVE-2018-7160): A
malicious website could use a DNS rebinding attack to trick a web
browser to bypass same-origin-policy checks and allow HTTP connections
to localhost or to hosts on the local network, potentially to an open
inspector port as a debugger, therefore gaining full code execution
access. The inspector now only allows connections that have a browser
Host value of localhost or localhost6.
- Fix for 'path' module regular expression denial of service
(CVE-2018-7158): A regular expression used for parsing POSIX paths
could be used to cause a denial of service if an attacker were able to
have a specially crafted path string passed through one of the
impacted 'path' module functions.
- Reject spaces in HTTP Content-Length header values (CVE-2018-7159):
The Node.js HTTP parser allowed for spaces inside Content-Length
header values. Such values now lead to rejected connections in the
same way as non-numeric values.
- Update root certificates: 5 additional root certificates have been
added to the Node.js binary and 30 have been removed.
Changelog:
0.18.0:
Changes affecting backwards compatibility
Breaking changes in the standard library
The [] proc for strings now raises an IndexError exception when the specified slice is out of bounds. See issue #6223 for more details. You can use substr(str, start, finish) to get the old behaviour back, see this commit for an example.
strutils.split and strutils.rsplit with an empty string and a separator now returns that empty string. See issue #4377.
Arrays of char cannot be converted to cstring anymore, pointers to arrays of char can! This means $ for arrays can finally exist in system.nim and do the right thing. This means $myArrayOfChar changed its behaviour! Compile with -d:nimNoArrayToString to see where to fix your code.
reExtended is no longer default for the re constructor in the re module.
The behavior of $ has been changed for all standard library collections. The collection-to-string implementations now perform proper quoting and escaping of strings and chars.
newAsyncSocket taking an AsyncFD now runs setBlocking(false) on the fd.
mod and bitwise and do not produce range subtypes anymore. This turned out to be more harmful than helpful and the language is simpler without this special typing rule.
formatFloat/formatBiggestFloat now support formatting floats with zero precision digits. The previous precision = 0 behavior (default formatting) is now available via precision = -1.
Moved from stdlib into Nimble packages:
basic2d deprecated: use glm, arraymancer, neo, or another package instead
basic3d deprecated: use glm, arraymancer, neo, or another package instead
gentabs
libuv
polynumeric
pdcurses
romans
libsvm
joyent_http_parser
Proc toCountTable now produces a CountTable with values correspoding to the number of occurrences of the key in the input. It used to produce a table with all values set to 1.
Counting occurrences in a sequence used to be:
let mySeq = @[1, 2, 1, 3, 1, 4]
var myCounter = initCountTable[int]()
for item in mySeq:
myCounter.inc item
Now, you can simply do:
let
mySeq = @[1, 2, 1, 3, 1, 4]
myCounter = mySeq.toCountTable()
If you use --dynlibOverride:ssl with OpenSSL 1.0.x, you now have to define openssl10 symbol (-d:openssl10). By default OpenSSL 1.1.x is assumed.
newNativeSocket is now named createNativeSocket.
newAsyncNativeSocket is now named createAsyncNativeSocket and it no longer raises an OS error but returns an osInvalidSocket when creation fails.
The securehash module is now deprecated. Instead import std / sha1.
The readPasswordFromStdin proc has been moved from the rdstdin to the terminal module, thus it does not depend on linenoise anymore.
Breaking changes in the compiler
\n is now only the single line feed character like in most other programming languages. The new platform specific newline escape sequence is written as \p. This change only affects the Windows platform.
The overloading rules changed slightly so that constrained generics are preferred over unconstrained generics. (Bug #6526)
We changed how array accesses “from backwards” like a[^1] or a[0..^1] are implemented. These are now implemented purely in system.nim without compiler support. There is a new “heterogenous” slice type system.HSlice that takes 2 generic parameters which can be BackwardsIndex indices. BackwardsIndex is produced by system.^. This means if you overload [] or []= you need to ensure they also work with system.BackwardsIndex (if applicable for the accessors).
The parsing rules of if expressions were changed so that multiple statements are allowed in the branches. We found few code examples that now fail because of this change, but here is one:
t[ti] = if exp_negative: '-' else: '+'; inc(ti)
This now needs to be written as:
t[ti] = (if exp_negative: '-' else: '+'); inc(ti)
The experimental overloading of the dot . operators now take an untyped parameter as the field name, it used to be a static[string]. You can use when defined(nimNewDot) to make your code work with both old and new Nim versions. See special-operators for more information.
yield (or await which is mapped to yield) never worked reliably in an array, seq or object constructor and is now prevented at compile-time.
Library additions
Added sequtils.mapLiterals for easier construction of array and tuple literals.
Added system.runnableExamples to make examples in Nim’s documentation easier to write and test. The examples are tested as the last step of nim doc.
Implemented getIoHandler proc in the asyncdispatch module that allows you to retrieve the underlying IO Completion Port or Selector[AsyncData] object in the specified dispatcher.
For string formatting / interpolation a new module called strformat has been added to the stdlib.
The ReadyKey type in the selectors module now contains an errorCode field to help distinguish between Event.Error events.
Implemented an accept proc that works on a SocketHandle in nativesockets.
Added algorithm.rotateLeft.
Added typetraits.$ as an alias for typetraits.name.
Added system.getStackTraceEntries that allows you to access the stack trace in a structured manner without string parsing.
Added parseutils.parseSaturatedNatural.
Added macros.unpackVarargs.
Added support for asynchronous programming for the JavaScript backend using the asyncjs module.
Added true color support for some terminals. Example:
import colors, terminal
const Nim = "Efficient and expressive programming."
var
fg = colYellow
bg = colBlue
int = 1.0
enableTrueColors()
for i in 1..15:
styledEcho bgColor, bg, fgColor, fg, Nim, resetStyle
int -= 0.01
fg = intensity(fg, int)
setForegroundColor colRed
setBackgroundColor colGreen
styledEcho "Red on Green.", resetStyle
Library changes
echo now works with strings that contain \0 (the binary zero is not shown) and nil strings are equal to empty strings.
JSON: Deprecated getBVal, getFNum, and getNum in favour of getBool, getFloat, getBiggestInt. A new getInt procedure was also added.
rationals.toRational now uses an algorithm based on continued fractions. This means its results are more precise and it can’t run into an infinite loop anymore.
os.getEnv now takes an optional default parameter that tells getEnv what to return if the environment variable does not exist.
The random procs in random.nim have all been deprecated. Instead use the new rand procs. The module now exports the state of the random number generator as type Rand so multiple threads can easily use their own random number generators that do not require locking. For more information about this rename see issue #6934
writeStackTrace is now proclaimed to have no IO effect (even though it does) so that it is more useful for debugging purposes.
db_mysql module: DbConn is now a distinct type that doesn’t expose the details of the underlying PMySQL type.
parseopt2 is now deprecated, use parseopt instead.
Language additions
It is now possible to forward declare object types so that mutually recursive types can be created across module boundaries. See package level objects for more information.
Added support for casting between integers of same bitsize in VM (compile time and nimscript). This allows to, among other things, reinterpret signed integers as unsigned.
Custom pragmas are now supported using pragma pragma, please see language manual for details.
Standard library modules can now also be imported via the std pseudo-directory. This is useful in order to distinguish between standard library and nimble package imports:
import std / [strutils, os, osproc]
import someNimblePackage / [strutils, os]
Language changes
The unary < is now deprecated, for .. < use ..< for other usages use the pred proc.
Bodies of for loops now get their own scope:
# now compiles:
for i in 0..4:
let i = i + 1
echo i
To make Nim even more robust the system iterators .. and countup now only accept a single generic type T. This means the following code doesn’t die with an “out of range” error anymore:
var b = 5.Natural
var a = -5
for i in a..b:
echo i
atomic and generic are no longer keywords in Nim. generic used to be an alias for concept, atomic was not used for anything.
The memory manager now uses a variant of the TLSF algorithm that has much better memory fragmentation behaviour. According to http://www.gii.upv.es/tlsf/ the maximum fragmentation measured is lower than 25%. As a nice bonus alloc and dealloc became O(1) operations.
The compiler is now more consistent in its treatment of ambiguous symbols: Types that shadow procs and vice versa are marked as ambiguous (bug #6693).
codegenDecl pragma now works for the JavaScript backend. It returns an empty string for function return type placeholders.
Extra semantic checks for procs with noreturn pragma: return type is not allowed, statements after call to noreturn procs are no longer allowed.
Noreturn proc calls and raising exceptions branches are now skipped during common type deduction in if and case expressions. The following code snippets now compile:
import strutils
let str = "Y"
let a = case str:
of "Y": true
of "N": false
else: raise newException(ValueError, "Invalid boolean")
let b = case str:
of nil, "": raise newException(ValueError, "Invalid boolean")
elif str.startsWith("Y"): true
elif str.startsWith("N"): false
else: false
let c = if str == "Y": true
elif str == "N": false
else:
echo "invalid bool"
quit("this is the end")
Pragmas now support call syntax, for example: {.exportc"myname".} and {.exportc("myname").}
The deprecated pragma now supports a user-definable warning message for procs.
proc bar {.deprecated: "use foo instead".} =
return
bar()
Tool changes
The nim doc command is now an alias for nim doc2, the second version of the documentation generator. The old version 1 can still be accessed via the new nim doc0 command.
Nim’s rst2html command now supports the testing of code snippets via an RST extension that we called :test:::
.. code-block:: nim
:test:
# shows how the 'if' statement works
if true: echo "yes"
0.17.0:
Changes affecting backwards compatibility
There are now two different HTTP response types, Response and AsyncResponse. AsyncResponse’s body accessor returns a Future[string]!
Due to this change you may need to add another await in your code.
httpclient.request now respects the maxRedirects option. Previously redirects were handled only by get and post procs.
The IO routines now raise EOFError for the “end of file” condition. EOFError is a subtype of IOError and so it’s easier to distinguish between “error during read” and “error due to EOF”.
A hash procedure has been added for cstring type in hashes module. Previously, hash of a cstring would be calculated as a hash of the pointer. Now the hash is calculated from the contents of the string, assuming cstring is a null-terminated string. Equal string and cstring values produce an equal hash value.
Macros accepting varargs arguments will now receive a node having the nkArgList node kind. Previous code expecting the node kind to be nkBracket may have to be updated.
memfiles.open now closes file handles/fds by default. Passing allowRemap=true to memfiles.open recovers the old behavior. The old behavior is only needed to call mapMem on the resulting MemFile.
posix.nim: For better C++ interop the field sa_sigaction*: proc (x: cint, y: var SigInfo, z: pointer) {.noconv.} was changed to sa_sigaction*: proc (x: cint, y: ptr SigInfo, z: pointer) {.noconv.}.
The compiler doesn’t infer effects for .base methods anymore. This means you need to annotate them with .gcsafe or similar to clearly declare upfront every implementation needs to fullfill these contracts.
system.getAst templateCall(x, y) now typechecks the templateCall properly. You need to patch your code accordingly.
macros.getType and macros.getTypeImpl for an enum will now return an AST that is the same as what is used to define an enum. Previously the AST returned had a repeated EnumTy node and was missing the initial pragma node (which is currently empty for an enum).
macros.getTypeImpl now correctly returns the implementation for a symbol of type tyGenericBody.
If the dispatcher parameter’s value used in multi method is nil, a NilError exception is raised. The old behavior was that the method would be a nop then.
posix.nim: the family of ntohs procs now takes unsigned integers instead of signed integers.
In Nim identifiers en-dash (Unicode point U+2013) is not an alias for the underscore anymore. Use underscores instead.
When the requiresInit pragma is applied to a record type, future versions of Nim will also require you to initialize all the fields of the type during object construction. For now, only a warning will be produced.
The Object construction syntax now performs a number of additional safety checks. When fields within case objects are initialiazed, the compiler will now demand that the respective discriminator field has a matching known compile-time value.
On posix, the results of waitForExit, peekExitCode, execCmd will return 128 + signal number if the application terminates via signal.
ospaths.getConfigDir now conforms to the XDG Base Directory specification on non-Windows OSs. It returns the value of the XDG_CONFIG_DIR environment variable if it is set, and returns the default configuration directory, “~/.config/”, otherwise.
Renamed the line info node parameter for newNimNode procedure.
The parsing rules of do changed.
foo bar do:
baz
Used to be parsed as:
foo(bar(do:
baz))
Now it is parsed as:
foo(bar, do:
baz)
Library Additions
Added system.onThreadDestruction.
Added dial procedure to networking modules: net, asyncdispatch, asyncnet. It merges socket creation, address resolution, and connection into single step. When using dial, you don’t have to worry about the IPv4 vs IPv6 problem. httpclient now supports IPv6.
Added to macro which allows JSON to be unmarshalled into a type.
import json
type
Person = object
name: string
age: int
let data = """
{
"name": "Amy",
"age": 4
}
"""
let node = parseJson(data)
let obj = node.to(Person)
echo(obj)
Tool Additions
The finish tool can now download MingW for you should it not find a working MingW installation.
Compiler Additions
The name mangling rules used by the C code generator changed. Most of the time local variables and parameters are not mangled at all anymore. This improves the debugging experience.
The compiler produces explicit name mangling files when --debugger:native is enabled. Debuggers can read these .ndi files in order to improve debugging Nim code.
Language Additions
The try statement’s except branches now support the binding of a caught exception to a variable:
try:
raise newException(Exception, "Hello World")
except Exception as exc:
echo(exc.msg)
This replaces the getCurrentException and getCurrentExceptionMsg() procedures, although these procedures will remain in the stdlib for the foreseeable future. This new language feature is actually implemented using these procedures.
In the near future we will be converting all exception types to refs to remove the need for the newException template.
A new pragma .used can be used for symbols to prevent the “declared but not used” warning. More details can be found here.
The popular “colon block of statements” syntax is now also supported for let and var statements and assignments:
template ve(value, effect): untyped =
effect
value
let x = ve(4):
echo "welcome to Nim!"
This is particularly useful for DSLs that help in tree construction.
Language changes
The .procvar annotation is not required anymore. That doesn’t mean you can pass system.$ to map just yet though.