diff --git a/.appveyor.yml b/.appveyor.yml index d3c752c292..940521a255 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,73 +1,74 @@ -version: "{build}" - -image: Visual Studio 2015 - -branches: - only: - - master - - release - -environment: - matrix: - - llvm: 3.9.1 - - llvm: 3.8.1 - - llvm: 3.7.1 - -configuration: - - release - - debug - -clone_depth: 100 - -clone_folder: C:\projects\ponyc - -install: - - ps: | - $package_commit = git rev-parse --short --verify "HEAD^{commit}" - $package_version = (Get-Content "VERSION") - $package_iteration = "$package_iteration${env:appveyor_build_number}.$package_commit" - Update-AppveyorBuild -Version "ponyc-${env:appveyor_repo_branch}-$package_version-$package_iteration" - - cd C:\projects\ponyc - - python -x waf configure - - python -x waf build --config %configuration% --llvm %llvm% - - ps: | - $ponydir = "${env:appveyor_build_version}-win64" - cd C:\projects\ponyc - md "$ponydir" - md "${ponydir}\ponyc" - md "${ponydir}\ponyc\bin" - $builddir = "C:\projects\ponyc\build\${env:configuration}-llvm-${env:llvm}" - Write-Output "Build dir is ${builddir}" - copy $builddir\ponyc.* "${ponydir}\ponyc\bin" - copy $builddir\ponyrt.* "${ponydir}\ponyc\bin" - copy $builddir\*.lib "${ponydir}\ponyc\bin" - copy -recurse packages "${ponydir}\packages" - 7z a -tzip "C:\projects\ponyc\${ponydir}.zip" "${ponydir}" - -artifacts: - - path: 'ponyc-*.zip' - -deploy: - # On branche `release`, deploy (and publish) artifacts - # to the ponyc-win projects on Bintray. - - provider: BinTray - username: pony-buildbot-2 - api_key: - secure: 4KgdDQLp2kX816XH27d5xdJBPlKGhYXN6ttdHTSt5qe1MVIF+/VResUstg0zuJ6m - subject: pony-language - repo: ponyc-win - package: ponyc-release - version: $(appveyor_build_version) - on: - branch: release - llvm: 3.9.1 - configuration: release - publish: true - -build: - none - -test_script: - - ps: | - cd C:\projects\ponyc - python -x waf test --config $env:configuration --llvm $env:llvm +version: "{build}" + +image: Visual Studio 2015 + +branches: + only: + - master + - release + +environment: + matrix: + - llvm: 3.9.1 + - llvm: 3.8.1 + - llvm: 3.7.1 + +configuration: + - release + - debug + +clone_depth: 100 +skip_tags: true + +clone_folder: C:\projects\ponyc + +install: + - ps: | + $package_commit = git rev-parse --short --verify "HEAD^{commit}" + $package_version = (Get-Content "VERSION") + $package_iteration = "$package_iteration${env:appveyor_build_number}.$package_commit" + Update-AppveyorBuild -Version "ponyc-${env:appveyor_repo_branch}-$package_version-$package_iteration" + - cd C:\projects\ponyc + - python -x waf configure + - python -x waf build --config %configuration% --llvm %llvm% + - ps: | + $ponydir = "${env:appveyor_build_version}-win64" + cd C:\projects\ponyc + md "$ponydir" + md "${ponydir}\ponyc" + md "${ponydir}\ponyc\bin" + $builddir = "C:\projects\ponyc\build\${env:configuration}-llvm-${env:llvm}" + Write-Output "Build dir is ${builddir}" + copy $builddir\ponyc.* "${ponydir}\ponyc\bin" + copy $builddir\ponyrt.* "${ponydir}\ponyc\bin" + copy $builddir\*.lib "${ponydir}\ponyc\bin" + copy -recurse packages "${ponydir}\packages" + 7z a -tzip "C:\projects\ponyc\${ponydir}.zip" "${ponydir}" + +artifacts: + - path: 'ponyc-*.zip' + +deploy: + # On branche `release`, deploy (and publish) artifacts + # to the ponyc-win projects on Bintray. + - provider: BinTray + username: pony-buildbot-2 + api_key: + secure: 4KgdDQLp2kX816XH27d5xdJBPlKGhYXN6ttdHTSt5qe1MVIF+/VResUstg0zuJ6m + subject: pony-language + repo: ponyc-win + package: ponyc-release + version: $(appveyor_build_version) + on: + branch: release + llvm: 3.9.1 + configuration: release + publish: true + +build: + none + +test_script: + - ps: | + cd C:\projects\ponyc + python -x waf test --config $env:configuration --llvm $env:llvm diff --git a/.gitattributes b/.gitattributes index 0afffcecf9..ac48bc73b0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,9 +1,15 @@ [attr]pony text eol=lf whitespace=tab-in-indent,trailing-space,tabwidth=2 +[attr]win text eol=crlf whitespace=tab-in-indent,trailing-space,tabwidth=2 *.c pony *.cc pony *.h pony *.pony pony +*.yml pony +.sh pony +.bash pony + +.bat win pony.g export-ignore .gitattributes export-ignore diff --git a/.travis.yml b/.travis.yml index 9ba8e70ac4..06139b82ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -230,7 +230,7 @@ after_success: PACKAGE_CONFLICTS="ponyc-release"; fi; PACKAGE_ITERATION="${PACKAGE_ITERATION}${TRAVIS_BUILD_NUMBER}.`git rev-parse --short --verify HEAD^{commit}`"; - make verbose=1 config=release package_name="$PACKAGE_NAME" package_conflicts="$PACKAGE_CONFLICTS" package_base_version="`cat VERSION`" package_iteration="$PACKAGE_ITERATION" deploy && export UPLOAD=yes; + make verbose=1 arch= config=release package_name="$PACKAGE_NAME" package_conflicts="$PACKAGE_CONFLICTS" package_base_version="`cat VERSION`" package_iteration="$PACKAGE_ITERATION" deploy && export UPLOAD=yes; fi; # For a release release build with the latest stable LLVM, upload docs. diff --git a/CHANGELOG.md b/CHANGELOG.md index e7eae7d60d..9a103ba4c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to the Pony compiler and standard library will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a CHANGELOG](http://keepachangelog.com/). +## [0.11.1] - 2017-03-14 + +### Fixed + +- Fix AVX/AVX2 issues with prebuilt ponyc (PR #1663) +- Fix linking with '--as-needed' (sensitive to linking order) (PR #1654) +- Fix FreeBSD 11 compilation + + ## [0.11.0] - 2017-03-11 ### Fixed @@ -10,7 +19,7 @@ All notable changes to the Pony compiler and standard library will be documented - Fix type parameters not being visible to a lambda type in a type alias (PR #1633) - Remove the check for union types on match error (PR #1630) - TCPListener: unsubscribe asio before socket close (PR #1626) -- Fix buffer overlow in case method docstring (PR #1615) +- Fix buffer overflow in case method docstring (PR #1615) - Fix capability checking for gencap-constrained type parameters. (PR #1593) - Fix error in ANTLR grammar regarding duplicate '-~'. (#1602) (PR #1604) - Escape special characters in ANLTR strings. (#1600) (PR #1601) @@ -32,9 +41,6 @@ All notable changes to the Pony compiler and standard library will be documented - Compiler crash due to incorrect subtype assignment (issue #1474) - Incorrect code generation when sending certain types of messages (issue #1594) -### Added - -- Close over free variables in lambdas and object literals (PR #1648) - Add assert_no_error test condition to PonyTest (PR #1605) - Expose `st_dev` and `st_ino` fields of stat structure (PR #1589) - Packed structures (RFC 32) (PR #1536) @@ -46,9 +52,6 @@ All notable changes to the Pony compiler and standard library will be documented - Equality comparison for NetAddress (PR #1569) - Host address comparison for NetAddress (PR #1569) -### Changed - -- Rename IPAddress to NetAddress (PR #1559) - Remove delegates (RFC 31) (PR #1534) - Upgrade to LLVM 3.9.1 (PR #1498) - Deprecate LLVM 3.6.2 support (PR #1511) (PR #1502) (PR ##1512) @@ -199,14 +202,8 @@ All notable changes to the Pony compiler and standard library will be documented - Fix is_null_terminated reading arbitrary memory (issue #1425) (PR #1429) - Set null terminator in String.from_iso_array (issue #1435) (PR #1436) -### Added - -- Added String.split_by, which uses a string delimiter (issue #1399) (PR #1434) - Extra DTrace/SystemTap probes concerning scheduling. -### Changed - -- Behaviour calls return None instead of their receiver (RFC 28) (PR #1460) - Update from_array to prevent a copy (issue #1097) (PR #1423) ## [0.9.0] - 2016-11-11 @@ -221,17 +218,11 @@ All notable changes to the Pony compiler and standard library will be documented - Performance problem in the scheduler queue when running with many threads (issue #1404) - Invalid name mangling in generated C headers (issue #1377) -### Added - -- Method chaining (RFC #25) (PR #1411) - Iter class methods `all`, `any`, `collect`, `count`, `find`, `last`, `nth`, `run`, `skip`, `skip_while`, `take`, `take_while` (issue #1370) - Output of `ponyc --version` shows C compiler used to build pony (issue #1245) - Makefile detects `llvmconfig39` in addition to `llvm-config-3.9` (#1379) - LLVM 3.9 support -### Changed - -- Changed lambda literal syntax to be more concise (issue #1391) (PR #1400) ## [0.8.0] - 2016-10-27 @@ -239,14 +230,8 @@ All notable changes to the Pony compiler and standard library will be documented - Link the correct version of `libponyrt` when compiling with `--pic` on Linux (issue #1359) -### Added - -- Runtime function `pony_send_next`. This function can help optimise some message sending scenarios. - Floating point `min_normalised`. The function returns the smallest normalised positive number, as `min_value` used to do (issue #1351) -### Changed - -- Floating point `min_value` now returns the smallest negative number instead of the smallest normalised positive number (issue #1351) ## [0.7.0] - 2016-10-22 @@ -254,14 +239,8 @@ All notable changes to the Pony compiler and standard library will be documented - Concatenate docstrings from case methods (issue #575). -### Added - -- TCP read and write backpressure hooks in `TCPConnection` (issue #1311) - Allow TCP notifiers to cause connections to yield while receiving (issue #1343) -### Changed - -- `break` without a value now generates its value from the `else` branch of a loop instead of being an implicit `break None`. - The `for` loop will now break out of the loop instead of continuing with the following iterations if `Iterator.next` errors. ## [0.6.0] - 2016-10-20 @@ -272,13 +251,7 @@ All notable changes to the Pony compiler and standard library will be documented - Restrict mutable tuple recovery to maintain reference capability security (issue #1123) - Crash in the runtime scheduler queues -### Added - -- DTrace and SystemTap support - `use=dtrace` -### Changed - -- Replaces `use=telemetry` by DTrace/SystemTap scripts - `String.cstring()` now always returns a null-terminated string (which may result in a copy) while `cpointer()` (also available on `Array` objects) returns a pointer to the underlying array as-is @@ -299,15 +272,9 @@ All notable changes to the Pony compiler and standard library will be documented - Security issues in `ProcessMonitor` (issue #1180) - `SSLConnection` bugs due to missing `sentv` notify method (issue #1282) -### Added - -- `Iter` class (issue #1267) - read_until method on buffered.Reader (RFC 0013) - `format` package (issue #1285) -### Changed - -- `Stringable` interface no longer involves formatting (issue #1285) - Remove unused error types from ProcessError (issue #1293) - HTML documentation for expanded union types now adds line breaks to improve readability (issue #1263) @@ -317,9 +284,6 @@ All notable changes to the Pony compiler and standard library will be documented - Unexpected message ordering in `ProcessManager` (issue #1265) -### Added - -- TCP writev performance improvement by avoiding throwing errors ## [0.3.3] - 2016-09-23 @@ -329,16 +293,10 @@ All notable changes to the Pony compiler and standard library will be documented - Stop generating `llvm.invariant.load` for fields of `val` references. - Embedded fields construction through tuples. -### Added - -- Improved error handling for `files` package. - ProcessMonitor.expect - ProcessNotify.created - ProcessNotify.expect -### Changed - -- On Linux and FreeBSD, ponyc now uses $CC as the linker if the environment variable is defined. ## [0.3.2] - 2016-09-18 @@ -347,9 +305,6 @@ All notable changes to the Pony compiler and standard library will be documented - The `ponyc` version is now consistently set from the VERSION file. - Stop generating `llvm.invariant.load` intrinsic for "let" references, as these don't necessarily match the semantics of that intrinsic. -### Changed - -- The `setversion` and `release` commands have been removed from `Makefile`. - LTO is again enabled by default on OSX - make now builds a `release` rather than `debug` build by default @@ -365,14 +320,8 @@ All notable changes to the Pony compiler and standard library will be documented - Race condition in scheduler queues on weakly-ordered architectures. - Issue #1212 by reverting commit e56075d46d7d9e1d8c5e8be7ed0506ad2de98734 -### Added - -- `--ponypinasio` runtime option for pinning asio thread to a cpu core. - `--ponynopin` runtime option for not pinning any threads at all. -### Changed - -- Path.base now provides option to omit the file extension from the result. - Map.upsert returns value for upserted key rather than `this`. - `ponyc --version` now includes llvm version in its output. - LTO is now disabled by default on OSX. @@ -429,9 +378,6 @@ All notable changes to the Pony compiler and standard library will be documented - Assertion failure from type-checking in invalid programs. - Make the offset parameter of String.rfind inclusive of the given index. -### Added - -- 32-bit ARM port. - 32-bit X86 port. - Embedded fields. - C-style structs. @@ -481,9 +427,6 @@ All notable changes to the Pony compiler and standard library will be documented - `Sort` primitive - PonyBench package -### Changed - -- Interfaces are invariant if they are structurally equivalent. - Improved type checking with configuration management. - Improved realloc behaviour after heap_alloc_large. - Set-based upper bounds for generic constraints. @@ -514,9 +457,6 @@ All notable changes to the Pony compiler and standard library will be documented ## [0.2.0] - 2015-10-05 -### Added - -- Platform indicators for LP64, LLP64, ILP32. - Compile and link with LTO. - Use Pointer[None] for void* in FFI. - Root authority capability in Env. @@ -528,9 +468,6 @@ All notable changes to the Pony compiler and standard library will be documented - collections/Ring - Promises package -### Changed - -- Renamed some builtin types. - abs() now returns an unsigned integer. - Improved memory allocation speed. - Reduced memory pressure. @@ -548,13 +485,7 @@ All notable changes to the Pony compiler and standard library will be documented ## [0.1.7] - 2015-06-18 -### Added - -- Pass Pony function pointers to C FFI. - -### Changed -- The pony runtime now uses the same option parser as ponyc. A pony program exits if bad runtime args are provided. - Output directory now created if it doesn't already exist. - Improvements to automatic documentation generator. - Union type for String.compare result. @@ -565,9 +496,6 @@ All notable changes to the Pony compiler and standard library will be documented ## [0.1.6] - 2015-06-15 -### Added - -- Automatic documentation generator in the compiler. - FreeBSD 10.1 support, thanks to Ben Laurie. - Allow method calls on union types when the signatures are compatible. - Subtyping of polymorphic methods. @@ -575,9 +503,6 @@ All notable changes to the Pony compiler and standard library will be documented - collections.Flags - lambda sugar. -### Changed - -- Separated the FFI '&' operator from the identityof operator. - Operators on Set and Map are now persistent. - use "file:..." becomes use "package:..." - Allow "s at the end of triple-quoted strings. @@ -600,14 +525,8 @@ All notable changes to the Pony compiler and standard library will be documented ## [0.1.4] - 2015-05-14 -### Changed - -- When using a package without a package identifier (eg. `use "foo"` as opposed to `use f = "foo"`), a `Main` type in the package will not be imported. This allows all packages to include unit tests that are run from their included `Main` actor without causing name conflicts. - The `for` sugar now wraps the `next()` call in a try expression that does a `continue` if an error is raised. -### Added - -- ANSI terminal handling on all platforms, including Windows. - The lexer now allows underscore characters in numeric literals. This allows long numeric literals to be broken up for human readability. - "Did you mean?" support when the compiler doesn't recognise a name but something similar is in scope. - Garbage collection and cycle detection parameters can now be set from the command line. diff --git a/Dockerfile b/Dockerfile index 2ae3923a06..7b8b4e13f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,21 @@ FROM ubuntu:16.04 +ENV LLVM_VERSION 3.9.1 + RUN apt-get update \ - && apt-get install -y make g++ git wget xz-utils \ - zlib1g-dev libncurses5-dev libssl-dev \ - libpcre2-dev \ + && apt-get install -y \ + g++ \ + git \ + libncurses5-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + xz-utils \ + zlib1g-dev \ && rm -rf /var/lib/apt/lists/* \ - && wget http://llvm.org/releases/3.9.1/clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz \ - && tar xf clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz \ - && cp -r clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04/* /usr/local \ - && rm -rf /clang* + && wget -O - http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-16.04.tar.xz \ + | tar xJf - --strip-components 1 -C /usr/local/ clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-16.04 WORKDIR /src/ponyc COPY Makefile LICENSE VERSION /src/ponyc/ @@ -17,11 +24,10 @@ COPY lib /src/ponyc/lib COPY test /src/ponyc/test COPY packages /src/ponyc/packages -RUN make \ +RUN make -arch= \ && make install \ && rm -rf /src/ponyc/build -RUN mkdir /src/main WORKDIR /src/main CMD ponyc diff --git a/Makefile b/Makefile index a5e666f698..1478285ad2 100644 --- a/Makefile +++ b/Makefile @@ -332,7 +332,7 @@ endif llvm.libs := $(shell $(LLVM_CONFIG) --libs) -lz -lncurses ifeq ($(OSTYPE), freebsd) - llvm.libs += -lpthread + llvm.libs += -lpthread -lexecinfo endif prebuilt := llvm @@ -427,6 +427,11 @@ ifeq ($(OSTYPE),linux) libponyrt.benchmarks.links += libpthread libdl endif +ifeq ($(OSTYPE),freebsd) + libponyc.benchmarks.links += libpthread + libponyrt.benchmarks.links += libpthread +endif + ifneq (, $(DTRACE)) $(shell $(DTRACE) -h -s $(PONY_SOURCE_DIR)/common/dtrace_probes.d -o $(PONY_SOURCE_DIR)/common/dtrace_probes.h) endif @@ -560,8 +565,8 @@ define CONFIGURE_LINKER linker := $(CXX) endif - $(foreach lk,$($(1).links),$(eval $(call CONFIGURE_LIBS,$(lk)))) $(eval $(call CONFIGURE_LINKER_WHOLE,$(1))) + $(foreach lk,$($(1).links),$(eval $(call CONFIGURE_LIBS,$(lk)))) linkcmd += $(libs) $($(1).linkoptions) endef diff --git a/README.md b/README.md index 67a1b933f9..2deaf6fbc3 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,9 @@ docker run -v /path/to/my-code:/src/main ponylang/ponyc ./main If you're using `docker-machine` instead of native docker, make sure you aren't using [an incompatible version of Virtualbox](#virtualbox). +### Docker and AVX2 Support + +By default, the Pony Docker image is compiled without support for AVX CPU instructions. For optimal performance, you should build your Pony installation from source. ## Linux using an RPM package (via Bintray) @@ -79,6 +82,10 @@ Or, for master builds: yum install ponyc-master ``` +### RPM and AVX2 Support + +By default, the Pony RPM package is compiled without support for AVX CPU instructions. For optimal performance, you should build your Pony installation from source. + ## Linux using a DEB package (via Bintray) For Ubuntu or Debian Linux, the `master` and `release` branches are packaged and available on Bintray ([pony-language/ponyc-debian](https://bintray.com/pony-language/ponyc-debian)). @@ -97,6 +104,10 @@ Or, for master builds: sudo apt-get install ponyc-master ``` +### DEB and AVX2 Support + +By default, the Pony DEB package is compiled without support for AVX CPU instructions. For optimal performance, you should build your Pony installation from source. + ## Arch Linux ```bash @@ -128,15 +139,12 @@ $ brew install ponyc ## Windows using ZIP (via Bintray) -For Windows, the `master` and `release` branches are packaged and available on Bintray ([pony-language/ponyc-win](https://bintray.com/pony-language/ponyc-win)): +Windows users will need to install: -```powershell -Invoke-WebRequest -Uri https://dl.bintray.com/pony-language/ponyc-win/ponyc-VERSION.zip -UseBasicParsing -OutFile ponyc-VERSION.zip -7z x .\ponyc-VERSION.zip -.\ponyc-VERSION\ponyc\bin\ponyc.exe --version -``` +- Visual Studio 2015 (available [here](https://www.visualstudio.com/vs/community/)) or the Visual C++ Build Tools 2015 (available [here](http://landinghub.visualstudio.com/visual-cpp-build-tools)), and +- Windows 10 SDK (available [here](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk)). -Windows users will need to install Visual Studio 2015 (or the Visual C++ Build Tools 2015) and the Windows 10 SDK in order to build programs with ponyc. It can be downloaded from Microsoft ([Visual Studio](https://www.visualstudio.com/vs/community/), [Visual C++ Build Tools 2015](http://landinghub.visualstudio.com/visual-cpp-build-tools), [SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk)). +Once you have installed the prerequisites, you can download the latest ponyc release from [bintray](https://dl.bintray.com/pony-language/ponyc-win/). # Building ponyc from source @@ -382,9 +390,8 @@ Pony binaries can trigger illegal instruction errors under VirtualBox 4.x, for a Use VirtualBox 5.x to avoid possible problems. -## AVX2 Support -The Pony prebuilt binaries trigger illegal instruction errors under CPUs without [AVX2](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2) support. +You can learn more about [AVX2](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2) support. ## Building Pony on Non-x86 platforms diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index 513e38922b..559008e8f7 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -89,19 +89,14 @@ The pattern for releases is similar as what we previously saw. In the case of RP `0.3.1-1885.8a8ee28` -where the +where the `1885` is the Travis build number and the `8a8ee28` is the abbreviated SHA for the commit we built from. -`8a8ee28` - -is the sha for the commit we built from. - -For windows, version look something like: +For windows, the versions look something like: `ponyc-release-0.3.1-1526.8a8ee28` -where the +where the `1526` is the AppVeyor build number and the `8a8ee28` is the abbreviated SHA for the commit we built from. -`8a8ee28` ### Wait on Homebrew @@ -111,20 +106,20 @@ Note that its often quite quick to get everything through Homebrew's CI and merg ### Update the GitHub issue as needed -At this point we are basically waiting on Travis, Appveyor and Homebrew. As each finishes, leave a note on the GitHub issue for this release letting everyone know where we stand status wise. For example: "Release 0.3.1 is now available via Homebrew" +At this point we are basically waiting on Travis, Appveyor and Homebrew. As each finishes, leave a note on the GitHub issue for this release letting everyone know where we stand status wise. For example: "Release 0.3.1 is now available via Homebrew". ### Inform #ponylang -Once Travis, Appveyor and Homebrew are all finished, drop a note in the #ponylang IRC channel letting everyone know that the release is out and include a link the release notes so everyone can see the CHANGELOG. +Once Travis, Appveyor and Homebrew are all finished, drop a note in the #ponylang IRC channel (on freenode) letting everyone know that the release is out and include a link the release notes so everyone can see the CHANGELOG. If this is an "emergency release" that is designed to get a high priority bug fix out, be sure to note that everyone is advised to update ASAP. If the high priority bug only affects certain platforms, adjust the "update ASAP" note accordingly. ### Inform pony-user -Once Travis, Appveyor and Homebrew are all finished, send an email to the pony user mailing list letting everyone know that the release is out and include a link the release notes so everyone can see the CHANGELOG. +Once Travis, Appveyor and Homebrew are all finished, send an email to the [pony user](https://pony.groups.io/g/user) mailing list letting everyone know that the release is out and include a link the release notes so everyone can see the CHANGELOG. If this is an "emergency release" that is designed to get a high priority bug fix out, be sure to note that everyone is advised to update ASAP. If the high priority bug only affects certain platforms, adjust the "update ASAP" note accordingly. ### Close the GitHub issue -Close the GitHub issue for this release +Close the GitHub issue for this release. diff --git a/VERSION b/VERSION index d9df1bbc0c..af88ba8248 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.11.0 +0.11.1 diff --git a/packages/collections/persistent/_bits.pony b/packages/collections/persistent/_bits.pony new file mode 100644 index 0000000000..df2d84dbdc --- /dev/null +++ b/packages/collections/persistent/_bits.pony @@ -0,0 +1,12 @@ +primitive _Bits + fun set_bit(bm: U32, i: U32): U32 => + bm or (U32(1) <<~ i) + + fun clear_bit(bm: U32, i: U32): U32 => + bm and (not (U32(1) <<~ i)) + + fun has_bit(bm: U32, i: U32): Bool => + (bm and (U32(1) <<~ i)) != 0 + + fun mask(hash: U32, l: U8): U32 => + (hash >> (U32(5) *~ l.u32_unsafe())) and 0x01f diff --git a/packages/collections/persistent/_map_node.pony b/packages/collections/persistent/_map_node.pony index a7a69816f1..da7eb00b15 100644 --- a/packages/collections/persistent/_map_node.pony +++ b/packages/collections/persistent/_map_node.pony @@ -34,8 +34,8 @@ class val _MapNode[K: (mut.Hashable val & Equatable[K]), V: Any #share] _level = l fun val apply(hash: U32, key: K): V ? => - let idx = _mask(hash, _level) - let i = _array_index(_nodemap, _datamap, idx) + let idx = _Bits.mask(hash, _level) + let i = _compressed_index(_nodemap, _datamap, idx) if i == -1 then error end match _entries(i.usize_unsafe()) | (_, let v: V) => v @@ -49,15 +49,15 @@ class val _MapNode[K: (mut.Hashable val & Equatable[K]), V: Any #share] end fun val update(hash: U32, leaf: _MapLeaf[K, V]): (_MapNode[K, V], Bool) ? => - let idx = _mask(hash, _level) - let i = _array_index(_nodemap, _datamap, idx) + let idx = _Bits.mask(hash, _level) + let i = _compressed_index(_nodemap, _datamap, idx) if i == -1 then let es = recover _entries.clone() end - let dm = _set_bit(_datamap, idx) - let i' = _array_index(_nodemap, dm, idx) + let dm = _Bits.set_bit(_datamap, idx) + let i' = _compressed_index(_nodemap, dm, idx) es.insert(i'.usize_unsafe(), leaf) (create(consume es, _nodemap, dm, _level), true) - elseif _has_bit(_nodemap, idx) then + elseif _Bits.has_bit(_nodemap, idx) then if _level == 6 then // insert into collision node let es = recover _entries.clone() end @@ -95,9 +95,9 @@ class val _MapNode[K: (mut.Hashable val & Equatable[K]), V: Any #share] cn.push(old) cn.push(leaf) let es = recover _entries.clone() end - let dm = _clear_bit(_datamap, idx) - let nm = _set_bit(_nodemap, idx) - let i' = _array_index(nm, dm, idx) + let dm = _Bits.clear_bit(_datamap, idx) + let nm = _Bits.set_bit(_nodemap, idx) + let i' = _compressed_index(nm, dm, idx) es.delete(i.usize_unsafe()) es.insert(i'.usize_unsafe(), consume cn) (create(consume es, nm, dm, _level), true) @@ -107,9 +107,9 @@ class val _MapNode[K: (mut.Hashable val & Equatable[K]), V: Any #share] (sn, _) = sn.update(old._1.hash().u32(), old) as (_MapNode[K, V], Bool) (sn, _) = sn.update(hash, leaf) as (_MapNode[K, V], Bool) let es = recover _entries.clone() end - let nm = _set_bit(_nodemap, idx) - let dm = _clear_bit(_datamap, idx) - let i' = _array_index(nm, dm, idx) + let nm = _Bits.set_bit(_nodemap, idx) + let dm = _Bits.clear_bit(_datamap, idx) + let i' = _compressed_index(nm, dm, idx) es.delete(i.usize_unsafe()) es.insert(i'.usize_unsafe(), sn) (create(consume es, nm, dm, _level), true) @@ -117,13 +117,13 @@ class val _MapNode[K: (mut.Hashable val & Equatable[K]), V: Any #share] end fun val remove(hash: U32, key: K): _MapNode[K, V] ? => - let idx = _mask(hash, _level) - let i = _array_index(_nodemap, _datamap, idx) + let idx = _Bits.mask(hash, _level) + let i = _compressed_index(_nodemap, _datamap, idx) if i == -1 then error end - if _has_bit(_datamap, idx) then + if _Bits.has_bit(_datamap, idx) then var es = recover _entries.clone() end es.delete(i.usize()) - create(consume es, _nodemap, _clear_bit(_datamap, idx), _level) + create(consume es, _nodemap, _Bits.clear_bit(_datamap, idx), _level) else if _level == 6 then let es = recover _entries.clone() end @@ -143,10 +143,10 @@ class val _MapNode[K: (mut.Hashable val & Equatable[K]), V: Any #share] let es = recover _entries.clone() end if (_nodemap.popcount() == 0) and (_datamap.popcount() == 1) then for si in mut.Range[U32](0, 32) do - if _has_bit(_datamap, si) then + if _Bits.has_bit(_datamap, si) then es(i.usize_unsafe()) = sn._entries(si.usize_unsafe()) - return create(consume es, _clear_bit(_nodemap, idx), - _set_bit(_datamap, idx), _level) + return create(consume es, _Bits.clear_bit(_nodemap, idx), + _Bits.set_bit(_datamap, idx), _level) end end end @@ -155,20 +155,11 @@ class val _MapNode[K: (mut.Hashable val & Equatable[K]), V: Any #share] end end - fun _set_bit(bm: U32, i: U32): U32 => bm or (U32(1) <<~ i) - - fun _clear_bit(bm: U32, i: U32): U32 => bm and (not (U32(1) <<~ i)) - - fun _has_bit(bm: U32, i: U32): Bool => (bm and (U32(1) <<~ i)) != 0 - - fun _mask(hash: U32, l: U8): U32 => - (hash >> (U32(5) *~ l.u32_unsafe())) and 0x01f - - fun _array_index(nm: U32, dm: U32, idx: U32): U32 => + fun _compressed_index(nm: U32, dm: U32, idx: U32): U32 => let msk = not(0xffff_ffff << idx) let np = msk and nm let dp = msk and dm let i = (np + dp).popcount() - if _has_bit(nm, idx) or _has_bit(dm, idx) then i else -1 end + if _Bits.has_bit(nm, idx) or _Bits.has_bit(dm, idx) then i else -1 end fun entries(): Array[_MapEntry[K, V]] val => _entries diff --git a/packages/collections/persistent/map.pony b/packages/collections/persistent/map.pony index 64174fbc8b..45cdb46e1f 100644 --- a/packages/collections/persistent/map.pony +++ b/packages/collections/persistent/map.pony @@ -73,7 +73,7 @@ class val Map[K: (mut.Hashable val & Equatable[K]), V: Any #share] """ Try to remove the provided key from the Map. """ - _create(_root.remove(k.hash().u32(), k), _size-1) + _create(_root.remove(k.hash().u32(), k), _size - 1) fun val get_or_else(k: K, alt: val->V): val->V => """ diff --git a/release.sh b/release.sh index 8f1e2cb40f..a06a878786 100644 --- a/release.sh +++ b/release.sh @@ -43,7 +43,7 @@ remove_empty_sections() { local first_word=`echo $str_after | head -n1 | cut -d " " -f1` if [ $first_word != "-" ]; then echo "Removing empty CHANGELOG section: $section" - $SED -i "0,/### $section/{//d;}" CHANGELOG.md + $SED -i "/### $section/ {N; N; d;}" CHANGELOG.md fi done } diff --git a/src/libponyrt/platform/ponyassert.c b/src/libponyrt/platform/ponyassert.c index b4d953d11a..c66f93bc52 100644 --- a/src/libponyrt/platform/ponyassert.c +++ b/src/libponyrt/platform/ponyassert.c @@ -18,6 +18,12 @@ static PONY_ATOMIC(bool) assert_guard = false; #ifdef PLATFORM_IS_POSIX_BASED +#ifdef PLATFORM_IS_FREEBSD +typedef size_t stack_depth_t; +#else +typedef int stack_depth_t; +#endif + void ponyint_assert_fail(const char* expr, const char* file, size_t line, const char* func) { @@ -33,12 +39,12 @@ void ponyint_assert_fail(const char* expr, const char* file, size_t line, func, expr); void* addrs[256]; - int depth = backtrace(addrs, 256); + stack_depth_t depth = backtrace(addrs, 256); char** strings = backtrace_symbols(addrs, depth); fputs("Backtrace:\n", stderr); - for(int i = 0; i < depth; i++) + for(stack_depth_t i = 0; i < depth; i++) printf(" %s\n", strings[i]); free(strings);