Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid messing up changelog history on each subsequent release #14025

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 80 additions & 80 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
# v1.4.0 - yyyy-mm-dd



## Standard library additions and changes

- `uri` adds Data URI Base64, implements RFC-2397.
- Add [DOM Parser](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser)
to the `dom` module for the JavaScript target.
- The default hash for `Ordinal` has changed to something more bit-scrambling.
`import hashes; proc hash(x: myInt): Hash = hashIdentity(x)` recovers the old
one in an instantiation context while `-d:nimIntHash1` recovers it globally.
- `deques.peekFirst` and `deques.peekLast` now have `var Deque[T] -> var T` overloads.
- File handles created from high-level abstractions in the stdlib will no longer
be inherited by child processes. In particular, these modules are affected:
`system`, `nativesockets`, `net` and `selectors`.

For `net` and `nativesockets`, an `inheritable` flag has been added to all
`proc`s that create sockets, allowing the user to control whether the
resulting socket is inheritable. This flag is provided to ease the writing of
multi-process servers, where sockets inheritance is desired.

For a transistion period, define `nimInheritHandles` to enable file handle
inheritance by default. This flag does **not** affect the `selectors` module
due to the differing semantics between operating systems.

`system.setInheritable` and `nativesockets.setInheritable` is also introduced
for setting file handle or socket inheritance. Not all platform have these
`proc`s defined.

- The file descriptors created for internal bookkeeping by `ioselector_kqueue`
and `ioselector_epoll` will no longer be leaked to child processes.

- `relativePath(rel, abs)` and `relativePath(abs, rel)` used to silently give wrong results
(see #13222); instead they now use `getCurrentDir` to resolve those cases,
and this can now throw in edge cases where `getCurrentDir` throws.
`relativePath` also now works for js with `-d:nodejs`.


## Language changes
- In newruntime it is now allowed to assign discriminator field without restrictions as long as case object doesn't have custom destructor. Discriminator value doesn't have to be a constant either. If you have custom destructor for case object and you do want to freely assign discriminator fields, it is recommended to refactor object into 2 objects like this:
```nim
type
MyObj = object
case kind: bool
of true: y: ptr UncheckedArray[float]
of false: z: seq[int]

proc `=destroy`(x: MyObj) =
if x.kind and x.y != nil:
deallocShared(x.y)
x.y = nil
```
Refactor into:
```nim
type
MySubObj = object
val: ptr UncheckedArray[float]
MyObj = object
case kind: bool
of true: y: MySubObj
of false: z: seq[int]

proc `=destroy`(x: MySubObj) =
if x.val != nil:
deallocShared(x.val)
x.val = nil
```

- getImpl() on enum type symbols now returns field syms instead of idents. This helps
with writing typed macros. Old behavior for backwards compatiblity can be restored
with command line switch `--useVersion:1.0`.

## Compiler changes

- Specific warnings can now be turned into errors via `--warningAsError[X]:on|off`.
- The `define` and `undef` pragmas have been de-deprecated.

## Tool changes

## Changelogs for past and upcoming releases
* 1.4.0 [source](changelogs/changelog_1_4_0.md). Upcoming release.
* 1.2.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2020-04-03-version-120-released.md)
[url](https://nim-lang.org/blog//2020/04/03/version-120-released.html)
* 1.0.6: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2020-01-24-version-106-released.md)
[url](https://nim-lang.org/blog//2020/01/24/version-106-released.html)
* 1.0.4: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2019-11-26-version-104-released.md)
[url](https://nim-lang.org/blog//2019/11/26/version-104-released.html)
* 1.0.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2019-10-23-version-102-released.md)
[url](https://nim-lang.org/blog//2019/10/23/version-102-released.html)
* 1.0.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2019-09-23-version-100-released.md)
[url](https://nim-lang.org/blog//2019/09/23/version-100-released.html)
* 0.20.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2019-07-17-version-0202-released.md)
[url](https://nim-lang.org/blog//2019/07/17/version-0202-released.html)
* 0.20.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2019-06-06-version-0200-released.md)
[url](https://nim-lang.org/blog//2019/06/06/version-0200-released.html)
* 0.19.6: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2019-05-13-version-0196-released.md)
[url](https://nim-lang.org/blog//2019/05/13/version-0196-released.html)
* 0.19.4: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2019-02-01-version-0194-released.md)
[url](https://nim-lang.org/blog//2019/02/01/version-0194-released.html)
* 0.19.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2018-12-31-version-0192-released.md)
[url](https://nim-lang.org/blog//2018/12/31/version-0192-released.html)
* 0.19.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2018-09-26-version-0190-released.md)
[url](https://nim-lang.org/blog/2018/09/26/version-0190-released.html)
* 0.18.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2018-03-01-version-0180-released.md)
[url](https://nim-lang.org/blog/2018/03/01/version-0180-released.html)
* 0.17.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2017-09-07-version-0172-released.md)
[url](https://nim-lang.org/blog/2017/09/07/version-0172-released.html)
* 0.17.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2017-05-17-version-0170-released.md)
[url](https://nim-lang.org/blog/2017/05/17/version-0170-released.html)
* 0.16.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2017-01-08-version-0160-released.md)
[url](https://nim-lang.org/blog/2017/01/08/version-0160-released.html)
* 0.15.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-10-23-version-0152-released.md)
[url](https://nim-lang.org/blog/2016/10/23/version-0152-released.html)
* 0.15.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-09-30-version-0150-released.md)
[url](https://nim-lang.org/blog/2016/09/30/version-0150-released.html)
* 0.14.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-06-09-version-0142-released.md)
[url](https://nim-lang.org/blog/2016/06/09/version-0142-released.html)
* 0.14.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-06-07-version-0140-released.md)
[url](https://nim-lang.org/blog/2016/06/07/version-0140-released.html)
* 0.13.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-01-18-version-0130-released.md)
[url](https://nim-lang.org/blog/2016/01/18/version-0130-released.html)
* 0.12.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2015-10-27-version-0120-released.md)
[url](https://nim-lang.org/blog/2015/10/27/version-0120-released.html)
* 0.11.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2015-05-04-version-0112-released.md)
[url](https://nim-lang.org/blog/2015/05/04/version-0112-released.html)
* 0.11.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2015-04-30-version-0110-released.md)
[url](https://nim-lang.org/blog/2015/04/30/version-0110-released.html)
* 0.10.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2014-12-29-version-0102-released.md)
[url](https://nim-lang.org/blog/2014/12/29/version-0102-released.html)
* 0.9.6: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2014-10-19-version-096-released.md)
[url](https://nim-lang.org/blog/2014/10/19/version-096-released.html)
* 0.9.4: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2014-04-21-version-094-released.md)
[url](https://nim-lang.org/blog/2014/04/21/version-094-released.html)
* 0.9.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2013-05-20-version-092-released.md)
[url](https://nim-lang.org/blog/2013/05/20/version-092-released.html)
* 0.9.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2012-09-23-version-090-released.md)
[url](https://nim-lang.org/blog/2012/09/23/version-090-released.html)
* 0.8.14: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2012-02-09-version-0814-released.md)
[url](https://nim-lang.org/blog/2012/02/09/version-0814-released.html)
* 0.8.12: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2011-07-10-version-0812-released.md)
[url](https://nim-lang.org/blog/2011/07/10/version-0812-released.html)
* 0.8.10: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2010-10-20-version-0810-released.md)
[url](https://nim-lang.org/blog/2010/10/20/version-0810-released.html)
* 0.8.8: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2010-03-14-version-088-released.md)
[url](https://nim-lang.org/blog/2010/03/14/version-088-released.html)
* 0.8.6: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2009-12-21-version-086-released.md)
[url](https://nim-lang.org/blog/2009/12/21/version-086-released.html)

## Changelog source files
* Changelogs from 0.8.6 to 0.17.2 are version controlled in the [nim website](https://github.com/nim-lang/website/tree/master/jekyll/_posts).
* Changelogs since 0.18.0 are version controlled in [changelogs/](changelogs/).
* Any updates to past changelogs should be done in [changelogs/](changelogs/) first, and backported to the nim website.

## Creating a new release changelog
After a release, supposing next version will be 1.4.0:
* Run `cp changelogs/changelog_X_XX_X.md changelogs/changelog_1_4_0.md`
* Update `current changelog` entry in this file
* Update `system.NimMinor,NimMinor,NimPatch` to (1, 4, 0)
* Copy the changelog to [nim website](https://github.com/nim-lang/website/tree/master/jekyll/_posts).
File renamed without changes.
80 changes: 80 additions & 0 deletions changelogs/changelog_1_4_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# v1.4.0 - yyyy-mm-dd



## Standard library additions and changes

- `uri` adds Data URI Base64, implements RFC-2397.
- Add [DOM Parser](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser)
to the `dom` module for the JavaScript target.
- The default hash for `Ordinal` has changed to something more bit-scrambling.
`import hashes; proc hash(x: myInt): Hash = hashIdentity(x)` recovers the old
one in an instantiation context while `-d:nimIntHash1` recovers it globally.
- `deques.peekFirst` and `deques.peekLast` now have `var Deque[T] -> var T` overloads.
- File handles created from high-level abstractions in the stdlib will no longer
be inherited by child processes. In particular, these modules are affected:
`system`, `nativesockets`, `net` and `selectors`.

For `net` and `nativesockets`, an `inheritable` flag has been added to all
`proc`s that create sockets, allowing the user to control whether the
resulting socket is inheritable. This flag is provided to ease the writing of
multi-process servers, where sockets inheritance is desired.

For a transistion period, define `nimInheritHandles` to enable file handle
inheritance by default. This flag does **not** affect the `selectors` module
due to the differing semantics between operating systems.

`system.setInheritable` and `nativesockets.setInheritable` is also introduced
for setting file handle or socket inheritance. Not all platform have these
`proc`s defined.

- The file descriptors created for internal bookkeeping by `ioselector_kqueue`
and `ioselector_epoll` will no longer be leaked to child processes.

- `relativePath(rel, abs)` and `relativePath(abs, rel)` used to silently give wrong results
(see #13222); instead they now use `getCurrentDir` to resolve those cases,
and this can now throw in edge cases where `getCurrentDir` throws.
`relativePath` also now works for js with `-d:nodejs`.


## Language changes
- In newruntime it is now allowed to assign discriminator field without restrictions as long as case object doesn't have custom destructor. Discriminator value doesn't have to be a constant either. If you have custom destructor for case object and you do want to freely assign discriminator fields, it is recommended to refactor object into 2 objects like this:
```nim
type
MyObj = object
case kind: bool
of true: y: ptr UncheckedArray[float]
of false: z: seq[int]

proc `=destroy`(x: MyObj) =
if x.kind and x.y != nil:
deallocShared(x.y)
x.y = nil
```
Refactor into:
```nim
type
MySubObj = object
val: ptr UncheckedArray[float]
MyObj = object
case kind: bool
of true: y: MySubObj
of false: z: seq[int]

proc `=destroy`(x: MySubObj) =
if x.val != nil:
deallocShared(x.val)
x.val = nil
```

- getImpl() on enum type symbols now returns field syms instead of idents. This helps
with writing typed macros. Old behavior for backwards compatiblity can be restored
with command line switch `--useVersion:1.0`.

## Compiler changes

- Specific warnings can now be turned into errors via `--warningAsError[X]:on|off`.
- The `define` and `undef` pragmas have been de-deprecated.

## Tool changes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't I see File renamed without changes. here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was explained in PR msg.
see https://patch-diff.githubusercontent.com/raw/nim-lang/Nim/pull/14025.patch

---
 changelog.md => changelogs/changelog_1_4_0.md |  0
 changelogs/changelog_X_XX_X.md                |  3 +--
 changelogs/readme.md                          | 27 +++++++++++++++----
 3 files changed, 23 insertions(+), 7 deletions(-)
 rename changelog.md => changelogs/changelog_1_4_0.md (100%)

3 changes: 1 addition & 2 deletions changelogs/changelog_X_XX_X.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# v1.xx.x - yyyy-mm-dd
timotheecour marked this conversation as resolved.
Show resolved Hide resolved

This is an example file.
The changes should go to changelog.md!
This is an example file. See instructions in $nim/changelogs/readme.md


## Standard library additions and changes
Expand Down
61 changes: 0 additions & 61 deletions changelogs/readme.md

This file was deleted.

2 changes: 1 addition & 1 deletion compiler/semtypes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType =
e.typ = result
e.position = int(counter)
let symNode = newSymNode(e)
if optNimV1Emulation notin c.config.options and identToReplace != nil:
if optNimV1Emulation notin c.config.globalOptions and identToReplace != nil:
identToReplace[] = symNode
if e.position == 0: hasNull = true
if result.sym != nil and sfExported in result.sym.flags:
Expand Down