Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/devel' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
cooldome committed Mar 15, 2020
2 parents ae5ac8c + 6e0c06f commit 2ccb00d
Show file tree
Hide file tree
Showing 133 changed files with 2,509 additions and 1,363 deletions.
7 changes: 6 additions & 1 deletion .builds/freebsd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
image: freebsd/latest
# see https://man.sr.ht/builds.sr.ht/compatibility.md#freebsd
# these are all broken, pending https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244549
# image: freebsd/latest
# image: freebsd/current
# image: freebsd/12.x
image: freebsd/11.x
packages:
- databases/sqlite3
- devel/boehm-gc-threaded
Expand Down
56 changes: 7 additions & 49 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,12 @@ language: c
dist: xenial

matrix:
fast_finish: true

include:
- os: linux
env:
- NIM_COMPILE_TO_CPP=false
- CPU=amd64

- os: linux
env:
- NIM_COMPILE_TO_CPP=false
- CPU=i386
addons:
apt:
packages:
- gcc-multilib
- g++-multilib
- libcurl4-openssl-dev:i386
- libgc-dev:i386
- libglib2.0-dev:i386
- libpulse-dev:i386
- libsdl1.2-dev:i386
- libsfml-dev:i386

- os: osx
env:
- NIM_COMPILE_TO_CPP=false
- CPU=amd64

- os: osx
env:
- NIM_COMPILE_TO_CPP=true
- CPU=amd64

# To allow failures for a failing configuration, use something like:
# allow_failures:
# - env: NIM_COMPILE_TO_CPP=true
# - os: osx

addons:
apt:
# update the list above if more deps are introduced
Expand All @@ -53,18 +20,6 @@ addons:
- libsfml-dev
- libc6-dbg
- valgrind
homebrew:
packages:
- boehmgc
- make
- sfml
update: true

install:
- if [[ $CPU = i386 ]]; then echo -e "#!/bin/bash\n$(which gcc) -m32 \"\$@\"" > bin/gcc; fi
- if [[ $CPU = i386 ]]; then chmod 755 bin/gcc; fi
- if [[ $CPU = i386 ]]; then echo -e "#!/bin/bash\n$(which g++) -m32 \"\$@\"" > bin/g++; fi
- if [[ $CPU = i386 ]]; then chmod 755 bin/g++; fi

before_script:
- git clone --depth 1 https://github.com/nim-lang/csources.git
Expand All @@ -75,11 +30,17 @@ script:
- echo "travis_fold:start:nim_c_koch"
- nim c koch
- echo "travis_fold:end:nim_c_koch"
- ./koch runCI
- echo "travis_fold:start:koch_boot"
- ./koch boot
- echo "travis_fold:end:koch_boot"
- echo "travis_fold:start:koch_doc"
- ./koch doc
- echo "travis_fold:end:koch_doc"

before_deploy:
# Make https://nim-lang.github.io/Nim work the same as https://nim-lang.github.io/Nim/overview.html
- cp -f ./doc/html/overview.html ./doc/html/index.html

deploy: # https://nim-lang.github.io/Nim
provider: pages
# local-dir *has* to be a relative path from the repo root.
Expand All @@ -89,6 +50,3 @@ deploy: # https://nim-lang.github.io/Nim
keep-history: false
on:
branch: devel

# Extract failed tests
after_failure: nim c -r tools/ci_testresults.nim
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
vmImage: 'ubuntu-16.04'
CPU: i386
OSX_amd64:
vmImage: 'macOS-10.14'
vmImage: 'macOS-10.15'
CPU: amd64
OSX_amd64_cpp:
vmImage: 'macOS-10.14'
vmImage: 'macOS-10.15'
CPU: amd64
NIM_COMPILE_TO_CPP: true
Windows_amd64:
Expand Down
43 changes: 38 additions & 5 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
and shouldn't be conflated with `"."`; use -d:nimOldRelativePathBehavior to restore the old
behavior
- `joinPath(a,b)` now honors trailing slashes in `b` (or `a` if `b` = "")
- `times.parse` now only uses input to compute its result, and not `now`:
`parse("2020", "YYYY", utc())` is now `2020-01-01T00:00:00Z` instead of
`2020-03-02T00:00:00Z` if run on 03-02; it also doesn't crash anymore when
used on 29th, 30th, 31st of each month.

### Breaking changes in the compiler

Expand All @@ -40,6 +44,10 @@
- The `{.dynlib.}` pragma is now required for exporting symbols when making
shared objects on POSIX and macOS, which make it consistent with the behavior
on Windows.
- The compiler is now more strict about type conversions concerning proc
types: Type conversions cannot be used to hide `.raise` effects or side
effects, instead a `cast` must be used. With the flag `--useVersion:1.0` the
old behaviour is emulated.


## Library additions
Expand All @@ -58,7 +66,7 @@
- Added `sugar.collect` that does comprehension for seq/set/table collections.
- Added `sugar.capture` for capturing some local loop variables when creating a closure.
This is an enhanced version of `closureScope`.
- Added `typetraits.lenTuple` to get number of elements of a tuple/type tuple,
- Added `typetraits.tupleLen` to get number of elements of a tuple/type tuple,
and `typetraits.get` to get the ith element of a type tuple.
- Added `typetraits.genericParams` to return a tuple of generic params from a generic instantiation
- Added `os.normalizePathEnd` for additional path sanitization.
Expand All @@ -69,7 +77,8 @@
- Added `minIndex`, `maxIndex` and `unzip` to the `sequtils` module.
- Added `os.isRelativeTo` to tell whether a path is relative to another
- Added `resetOutputFormatters` to `unittest`

- Added `expectIdent` to the `macros` module.
- Added `os.isValidFilename` that returns `true` if `filename` argument is valid for crossplatform use.

- Added a `with` macro for easy function chaining that's available
everywhere, there is no need to concern your APIs with returning the first argument
Expand All @@ -78,15 +87,25 @@

```nim
type
Foo = object
col, pos: string
proc setColor(f: var Foo; r, g, b: int) = f.col = $(r, g, b)
proc setPosition(f: var Foo; x, y: float) = f.pos = $(x, y)
var f: Foo
with(f, setColor(2, 3, 4), setPosition(0.0, 1.0))
echo f
```

- Added `times.isLeapDay`
- Added a new module, `std / compilesettings` for querying the compiler about
diverse configuration settings.

## Library changes

- `asynchttpserver` added an iterator that allows the request body to be read in
chunks of data when new server "stream" option is set to true.
- `asyncdispatch.drain` now properly takes into account `selector.hasPendingOperations`
and only returns once all pending async operations are guaranteed to have completed.
- `asyncdispatch.drain` now consistently uses the passed timeout value for all
Expand All @@ -104,6 +123,9 @@
serve no purpose whatsoever.
- `httpclient.newHttpClient` and `httpclient.newAsyncHttpClient` added `headers`
argument to set initial HTTP Headers, instead of a hardcoded empty `newHttpHeader()`.
- `parseutils.parseUntil` has now a different behaviour if the `until` parameter is
empty. This was required for intuitive behaviour of the strscans module
(see bug #13605).


## Language additions
Expand All @@ -114,7 +136,6 @@
- `=sink` type bound operator is now optional. Compiler can now use combination
of `=destroy` and `copyMem` to move objects efficiently.


## Language changes

- Unsigned integer operators have been fixed to allow promotion of the first operand.
Expand All @@ -125,6 +146,7 @@

### Tool changes

- Fix Nimpretty must not accept negative indentation argument because breaks file.


### Compiler changes
Expand All @@ -136,6 +158,17 @@
- The Nim compiler now supports a new pragma called ``.localPassc`` to
pass specific compiler options to the C(++) backend for the C(++) file
that was produced from the current Nim module.
- The compiler now inferes "sink parameters". To disable this for a specific routine,
annotate it with `.nosinks`. To disable it for a section of code, use
`{.push sinkInference: off.}`...`{.pop.}`.
- The compiler now supports a new switch `--panics:on` that turns runtime
errors like `IndexError` or `OverflowError` into fatal errors that **cannot**
be caught via Nim's `try` statement. `--panics:on` can improve the
runtime efficiency and code size of your program significantly.
- The compiler now warns about inheriting directly from `system.Exception` as
this is **very bad** style. You should inherit from `ValueError`, `IOError`,
`OSError` or from a different specific exception type that inherits from
`CatchableError` and cannot be confused with a `Defect`.


## Bugfixes
Expand Down
Loading

0 comments on commit 2ccb00d

Please sign in to comment.