ponyc: 0.42.0 -> 0.44.0

* Fix MacOS version mismatch warnings when linking pony programs.
* Fix calculation of "is prime" for numbers > 1321.
* Prevent non-opaque structs from being used as behaviour parameters.
* Update to LLVM 12.0.1.
* Added FileMode.u32.
* Changes to Promises Library.
* Remove zlib from libponyc as a dependency.
* Fix compile-time crash related to Pony-specific Optimizations.
* Update FilePath constructors to allow a non-partial way to create a FilePath.

Updated googlebenchmark dependency to 1.5.4
Updated googletest to 1.10.0

Replaced a fetchurl call with a fetchFromGitHub call.
This commit is contained in:
Redvers Davies 2021-10-01 14:56:49 -04:00
parent 1066137385
commit 38aaa7d05c
3 changed files with 32 additions and 40 deletions

View File

@ -1,15 +1,15 @@
{ lib, stdenv, fetchFromGitHub, fetchurl, makeWrapper, pcre2, coreutils, which, openssl, libxml2, cmake, z3, substituteAll,
{ lib, stdenv, fetchFromGitHub, fetchurl, makeWrapper, pcre2, coreutils, which, openssl, libxml2, cmake, z3, substituteAll, python3,
cc ? stdenv.cc, lto ? !stdenv.isDarwin }:
stdenv.mkDerivation (rec {
pname = "ponyc";
version = "0.42.0";
version = "0.44.0";
src = fetchFromGitHub {
owner = "ponylang";
repo = pname;
rev = version;
sha256 = "1s8glmzz0g5lj1fjwwy4m3n660smiq5wl9r1lg686wqh42hcgnsy";
sha256 = "0bzdkrrh6lvfqc61kdxvgz573dj32wwzhzwil53jvynhfcwp38ld";
# Due to a bug in LLVM 9.x, ponyc has to include its own vendored patched
# LLVM. (The submodule is a specific tag in the LLVM source tree).
@ -26,22 +26,23 @@ stdenv.mkDerivation (rec {
ponygbenchmark = fetchFromGitHub {
owner = "google";
repo = "benchmark";
rev = "v1.5.2";
sha256 = "13rxagpzw6bal6ajlmrxlh9kgfvcixn6j734b2bvfqz7lch8n0pa";
rev = "v1.5.4";
sha256 = "1dbjdjzkpbsq3jl9ksyg8mw759vkac8qzq1557m73ldnavbhz48x";
};
nativeBuildInputs = [ cmake makeWrapper which ];
nativeBuildInputs = [ cmake makeWrapper which python3 ];
buildInputs = [ libxml2 z3 ];
# Sandbox disallows network access, so disabling problematic networking tests
patches = [
./disable-tests.patch
./fix-libstdcpp-path.patch
(substituteAll {
src = ./make-safe-for-sandbox.patch;
googletest = fetchurl {
url = "https://github.com/google/googletest/archive/release-1.8.1.tar.gz";
sha256 = "17147961i01fl099ygxjx4asvjanwdd446nwbq9v8156h98zxwcv";
googletest = fetchFromGitHub {
owner = "google";
repo = "googletest";
rev = "release-1.10.0";
sha256 = "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz";
};
})
];
@ -57,9 +58,7 @@ stdenv.mkDerivation (rec {
postPatch = ''
# Patching Vendor LLVM
patchShebangs --host build/build_libs/gbenchmark-prefix/src/benchmark/tools/*.py
patch -d lib/llvm/src/ -p1 < lib/llvm/patches/2020-09-01-is-trivially-copyable.diff
patch -d lib/llvm/src/ -p1 < lib/llvm/patches/2020-01-07-01-c-exports.diff
patch -d lib/llvm/src/ -p1 < lib/llvm/patches/2019-12-23-01-jit-eh-frames.diff
patch -d lib/llvm/src/ -p1 < lib/llvm/patches/2020-07-28-01-c-exports.diff
substituteInPlace packages/process/_test.pony \
--replace '"/bin/' '"${coreutils}/bin/' \
--replace '=/bin' "${coreutils}/bin"

View File

@ -1,14 +0,0 @@
diff --git a/src/libponyc/CMakeLists.txt b/src/libponyc/CMakeLists.txt
index bf2c385e..11d0d619 100644
--- a/src/libponyc/CMakeLists.txt
+++ b/src/libponyc/CMakeLists.txt
@@ -136,7 +136,7 @@ elseif(${CMAKE_HOST_SYSTEM_NAME} MATCHES "DragonFly")
else()
# add a rule to generate the standalone library if needed
add_custom_command(OUTPUT libponyc-standalone.a
- COMMAND cp `find /usr/lib/ -name 'libstdc++.a' -print -quit` libstdcpp.a
+ COMMAND cp `${CMAKE_CXX_COMPILER} --print-file-name='libstdc++.a'` libstdcpp.a
COMMAND echo "create libponyc-standalone.a" > standalone.mri
COMMAND echo "addlib ${PROJECT_SOURCE_DIR}/../../build/libs/lib/libblake2.a" >> standalone.mri
COMMAND echo "addlib libstdcpp.a" >> standalone.mri

View File

@ -1,28 +1,28 @@
--- a/lib/CMakeLists.txt.orig 2021-07-07 13:40:20.209410160 -0400
+++ a/lib/CMakeLists.txt 2021-07-07 13:43:11.886969662 -0400
--- a/lib/CMakeLists.txt.orig 2021-10-01 13:04:00.867762912 -0400
+++ a/lib/CMakeLists.txt 2021-10-01 13:06:21.220023453 -0400
@@ -15,12 +15,12 @@
endif()
ExternalProject_Add(gbenchmark
- URL ${PONYC_GBENCHMARK_URL}
+ SOURCE_DIR gbenchmark-prefix/src/benchmark
+ SOURCE_DIR gbenchmark-prefix/src/benchmark
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${PONYC_LIBS_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBENCHMARK_ENABLE_GTEST_TESTS=OFF -DCMAKE_CXX_FLAGS=-fpic --no-warn-unused-cli
)
ExternalProject_Add(googletest
- URL https://github.com/google/googletest/archive/release-1.8.1.tar.gz
+ URL @googletest@
- URL https://github.com/google/googletest/archive/release-1.10.0.tar.gz
+ URL @googletest@
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${PONYC_LIBS_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_CXX_FLAGS=-fpic -Dgtest_force_shared_crt=ON --no-warn-unused-cli
)
@@ -33,75 +33,6 @@
@@ -33,82 +33,6 @@
COMPONENT library
)
-find_package(Git)
-
-set(LLVM_DESIRED_HASH "c1a0a213378a458fbea1a5c77b315c7dce08fd05")
-set(PATCHES_DESIRED_HASH "9063f83d727bf042a1232420e168c1ea192bf6a2960d35e57123245b630eb923")
-set(LLVM_DESIRED_HASH "fed41342a82f5a3a9201819a82bf7a48313e296b")
-set(PATCHES_DESIRED_HASH "3a655193262fd9b2e87340e096efcbd96726a07fe6dd42a263f3a4fc2dc0192e")
-
-if(GIT_FOUND)
- if(EXISTS "${PROJECT_SOURCE_DIR}/../.git")
@ -56,12 +56,19 @@
- file(GLOB PONY_LLVM_PATCHES "${PROJECT_SOURCE_DIR}/llvm/patches/*.diff")
-
- # check to see if the patch hashes match
- message("Checking patches ${PONY_LLVM_PATCHES}")
- set(PATCHES_ACTUAL_HASH "")
- foreach (PATCH ${PONY_LLVM_PATCHES})
- file(SHA256 ${PATCH} patch_file_hash)
- string(CONCAT PATCHES_ACTUAL_HASH patch_file_hash)
- file(STRINGS ${PATCH} patch_file NEWLINE_CONSUME)
- string(REPLACE "\n" " " patch_file ${patch_file})
- string(SHA256 patch_file_hash ${patch_file})
- # message("${PATCH}: '${patch_file_hash}'")
- string(CONCAT PATCHES_ACTUAL_HASH ${PATCHES_ACTUAL_HASH} ${patch_file_hash})
- # message("concat is '${PATCHES_ACTUAL_HASH}'")
- endforeach()
- string(SHA256 PATCHES_ACTUAL_HASH ${PATCHES_ACTUAL_HASH})
- # message("Desired hash ${PATCHES_DESIRED_HASH}")
- # message("Actual hash ${PATCHES_ACTUAL_HASH}")
- if(NOT PATCHES_ACTUAL_HASH EQUAL "${PATCHES_DESIRED_HASH}")
- message(FATAL_ERROR "Patch hash actual ${PATCHES_ACTUAL_HASH} does not match desired ${PATCHES_DESIRED_HASH}")
- endif()
@ -88,6 +95,6 @@
- message(FATAL_ERROR "Git not found!")
-endif()
-
if (NOT DEFINED LLVM_TARGETS_TO_BUILD)
set(LLVM_TARGETS_TO_BUILD X86)
endif()
message("Building targets: ${LLVM_TARGETS_TO_BUILD}")
set(LLVM_ENABLE_BINDINGS OFF)