Skip to content

Tags: sociomantic-tsunami/ocean

Tags

v6.2.0

Toggle v6.2.0's commit message
v6.2.0: Deprecation cleanup, change in FormatterSink, new `LogLevel`

## Notable changes

### Fixes for forward compatibility with new DMD releases

* `ocean.net.server.connection.IConnectionHandler`, `ocean.text.entities.model.MarkupEntityCodec`,
  `ocean.io.Stdout`, ocean.core.SmartUnion`

Those modules have been changed to clean up errors with new releases,
namely pokemon-style catch which is now an error,
working around a visibility bug (`public alias` to `private template` instance doesn't work),
and an upcoming improvement to DMD about discarding without side effect.

### Two extra levels are now available to the Logger: `Debug` and `Verbose`

* `ocean.util.log.ILogger`, `ocean.util.log.Logger`

Those new levels should help developers to have more fine-grained log messages.
Previously, only `Trace` was available for development output, the next level, `Info`,
being for informative messages to the users.
`Debug` itself is the lowest (most verbose) level, followed by the pre-existing `Trace` level,
followed by `Verbose`. The other log levels (`Info`, `Warn`, `Error`, `Fatal`) follow,
and are unchanged.

In addition to the `enum` values, convenience function were added to `Logger`:
`Logger.dbg` and `Logger.verbose`. The former name is an abbreviation,
as `debug` is a keyword in D.

### `FormatterSink` now takes its `char[]` argument as `in`, not `const`

* `ocean.text.convert.Formatter`, `ocean.util.log.Appender`

This change shouldn't have any effect for users that do not use `-preview=in`.
For `-preview=in` users, it allows a more consistent usage of delegates,
as `void delegate(const char[])` is not covariant with `void delegate(in char[])`,
notably when `Throwable.toString` is involved.

## Deprecations

### `creal` / `ireal` functions in `ocean.math` are deprecated

* `ocean.math.IEEE`, `ocean.math.Math`, `ocean.meta.traits.Basic`

Upstream deprecated support for `creal` and `ireal` types in v2.097.0.
Functions in `ocean.math.{IEEE,Math}` that used them are now deprecated.
Templates `isComplexType` / `isImaginaryType` used for introspection are deprecated as well.

v6.1.0

Toggle v6.1.0's commit message
v6.1.0: Forward compatibility with DMD, ocean.stdc.string deprecated

## Notable changes

This release contains some minor fixes that help with newer D releases.
Notably, all uses of `body` have been replaced by `do`,
reducing the friction of upgrading to DMD v2.096.0.

## Deprecations

### Module `ocean.stdc.string` has been deprecated

* `ocean.stdc.string`

This module exposed C functions that have now been fully upstreamed,
hence the `core` modules should be imported directly.

v6.0.0

Toggle v6.0.0's commit message
v6.0.0: Major clean up, updated upstream support

v5.4.1...v6.x.x

This release remove all the code deprecated during v5.x.x's lifetime,
support for Ubuntu xenial as it is about to reach EOL
(the minimum supported version is now Bionic), and support for DMD
older than v2.092.0 (including dmd-transitional).

# Migration instructions

### Removed the deprecated `init` method

`ocean.core.BitArray`

Use the `initialize` method instead.

### Templates `Const`, `Immut` and `Inout` have been removed

* `ocean.transition`, `ocean.meta.types.Qualifiers`

Those templates were used during the transition to D2, but are obsolete now.
However, due to [a DMD bug](https://issues.dlang.org/show_bug.cgi?id=20190)
they could not be deprecated. Instead, usage in downstream project was cleared,
and they were directly removed. Any usage can be replaced by the equivalent keyword
(`Immut!(T)` => `immutable(T)`, `Inout!(T)` => `inout(T)`, `Const!(T)` => `const(T)`).

### Deprecated modules have been removed

* `ocean/core/Time.d`, `ocean/core/Traits.d`,
  `ocean/stdc/posix/arpa/inet.d`, `ocean/stdc/posix/net/if_.d`,
  `ocean/stdc/posix/netinet/in_.d`, `ocean/stdc/posix/netinet/tcp.d`,
  `ocean/stdc/posix/stdlib.d`, `ocean/stdc/posix/sys/ipc.d`,
  `ocean/stdc/posix/sys/mman.d`, `ocean/stdc/posix/sys/select.d`,
  `ocean/stdc/posix/sys/shm.d`, `ocean/stdc/posix/sys/stat.d`,
  `ocean/stdc/posix/sys/statvfs.d`, `ocean/stdc/posix/sys/types.d`,
  `ocean/stdc/posix/sys/uio.d`, `ocean/stdc/posix/sys/utsname.d`,
  `ocean/stdc/posix/sys/wait.d`,
  `ocean/time/chrono/Hebrew.d`, `ocean/time/chrono/Hijri.d`,
  `ocean/time/chrono/Japanese.d`, `ocean/time/chrono/Korean.d`,
  `ocean/time/chrono/Taiwan.d`, `ocean/time/chrono/ThaiBuddhist.d`,
  `ocean/util/log/model/ILogger.d`

Those modules are either available via druntime, have been moved,
or are unused and unsupported. Refer to their deprecation notices
for specific instructions.

v5.4.1

Toggle v5.4.1's commit message
v5.4.1: Merge v5.1.5 bugfix for isUTF8StringType

This release is a merge of v5.1.4 .. v5.1.5 into v5.4.x.

v5.3.1

Toggle v5.3.1's commit message
v5.3.1: Merge v5.1.5 bugfix for isUTF8StringType

This release is a merge of v5.1.4 .. v5.1.5 into v5.3.x.

v5.2.2

Toggle v5.2.2's commit message
v5.2.2: Merge v5.1.5 bugfix for isUTF8StringType

This release is a merge of v5.1.4 .. v5.1.5 into v5.2.x.

v5.1.5

Toggle v5.1.5's commit message
v5.1.5: Fix isUTF8StringType to work with static arrays

## Bug Fixes

### Fix function to check for UTF-8 string type

`ocean.meta.traits.Arrays`

The function `ocean.meta.traits.Arrays.isUTF8StringType()` is suggested to
replace the deprecated `ocean.core.Traits.isStringType()` but it failed to
check for static arrays and now it is fixed to support both basic kind of
arrays.

See #778

v5.4.0

Toggle v5.4.0's commit message
v5.4.0

https://github.com/sociomantic-tsunami/ocean/milestone/121

Migrations
----------

### Replacement of IEBtree protected operators

* `ocean.util.container.ebtree.IEBTree`

The `opAddAssign` and `opSubAssign` operators have been replaced with
`increaseNodeCount` and `decreaseNodeCount`.
These are protected member functions used only in the implementation of
the EBTree classes, so no impact on user code is expected.

Bug fixes
---------

### Missing versions added to `ocean.LibFeatures`

* `ocean.LibFeatures`

This module was supposed to provide means for library writers depending
on Ocean to conditionally support a feature. However the module hasn't been
updated for a long time, and versions `4.2` to `4.8` were missing in the `v4`
suite, while no `v5` version (so `5.0` - `5.3`) were present.
This release adds all the missing features as well as the current (`5.4`).

### `SmartUnion` will no longer produce conflicting `opCall`

* `ocean.core.SmartUnion`

Before this change, `SmartUnion` would generate duplicated `static opCall`
for initialization. However those `opCall` were not callable,
as the call would be ambiguous.
After this change, those `opCall` won't be generated anymore,
and only the `set` and `get` methods will be available on fields
which don't have a unique type in the `union`.

New features
------------

### The Formatter now pretty-print enums

`enum` members are now correctly printed by the Formatter.
For example `enum Foo { A, B}` will print either `Foo.A` or `Foo.B`
instead of `0` and `1`, previously.
If a value that is not a member of an `enum` is casted to it,
such as `cast(Foo) 42`, the Formatter will print `cast(Foo) 42`.
Note that the type will be printed qualified, e.g. passing a `const`
value will print `const(Foo).A`, for example.

### Support for streaming pkzip files

* `ocean.io.compress.ZipStream`

The new class `ZipStreamDecompressor` supports streaming of both gzip and
well-behaved single-file pkzip archives. Streaming of pkzip archives is
supported only when the archive contains a single file, and does not use
any of the exotic features allowed by the pkzip format.

Deprecations
------------

### Most calendar types have been deprecated

* `ocean.time.chrono.Hebrew`, `ocean.time.chrono.Hijri`,
  `ocean.time.chrono.Japanese`, `ocean.time.chrono.Korean`,
  `ocean.time.chrono.Taiwan`, `ocean.time.chrono.ThaiBuddhist`

Those modules were not used, badly supported, and not up to
any coding convention.

### `ocean.core.Time` has been deprecated

* `ocean.core.Time`

This module has been completely deprecated and should be replaced by usages of `core.time`.
The sole function in this module, `seconds`, was mostly used as argument to `Thread.sleep`.
It can be replaced by `seconds` from `core.time` if the argument is an integer,
or `msecs`, `usecs`, `hnsecs` or `nsecs` depending on the expected precision.

### Module `ocean.stdc.posix.netinet.tcp` is deprecated

`ocean.stdc.posix.netinet.tcp`

This module was just a thin wrapper around `core.sys.posix.netinet.tcp`,
which should now be imported directly.

### Module `ocean.core.Traits` have been deprecated

* `ocean.core.Traits`

All symbols in this module were deprecated in v5.0.0,
but the module itself wasn't marked as deprecated before.

### Most modules in `ocean.stdc.posix.sys` are deprecated

* `ocean.stdc.posix.sys.ipc`, `ocean.stdc.posix.sys.mman`,
  `ocean.stdc.posix.sys.select`, `ocean.stdc.posix.sys.shm`,
  `ocean.stdc.posix.sys.stat`, `ocean.stdc.posix.sys.statvfs`,
  `ocean.stdc.posix.sys.uio`,
  `ocean.stdc.posix.sys.utsname`, `ocean.stdc.posix.sys.wait`

Those modules where just thin wrapper, publicly importing their
`core.sys.posix.sys` counterpart and can be trivially replaced.
The only two remaining modules are `ocean.stdc.posix.sys.un`,
which a `create` method and a different definition (but binary compatible)
for the `sockaddr_un` struct, and `ocean.stdc.posix.sys.socket`,
as it contains definitions not available as of DMD 2.091.0.

### Exposed declaration of `pthread_getattr_np` had been deprecated

* `ocean.util.aio.internal.ThreadWorker`

This module inadvertently exposed the `extern (C)` declaration for the
non-standard function `pthread_getattr_np`.
Users can import `core.thread` instead to get the declaration.

### C bindings in `ocean.sys.TimerFD` have been deprecated

* `ocean.sys.TimerFD`

This module exposed the functions `timerfd_create`, `timerfd_gettime`, `timerfd_settime`,
as well as the constants `CLOCK_MONOTONIC`, `TFD_TIMER_ABSTIME`, `TFD_CLOEXEC`, `TFD_NONBLOCK`.
Those have now been deprecated, as they are part of druntime.
`CLOCK_MONOTONIC` is part of `core.sys.posix.time`, and the other functions / constants
can be found in `core.sys.linux.timerfd` since 2.069.
The rest of the module, which provides wrapper types around this functionality, is not deprecated.