From 72ce2495b6d8e0e3632c578ffd6136fb78916693 Mon Sep 17 00:00:00 2001 From: Nick Logan Date: Sun, 20 Jun 2021 13:23:28 -0500 Subject: [PATCH 1/3] Delete precomp files when rebuilding When updating a native library that an existing precompiled raku module uses there will still be references to the old (now non- existing) native library. This change works around the issue by deleting the precomp files as part of its build step. --- Build.pm6 | 10 ++++++++++ META6.json | 1 + 2 files changed, 11 insertions(+) diff --git a/Build.pm6 b/Build.pm6 index 5e5fbe5..257b2c7 100644 --- a/Build.pm6 +++ b/Build.pm6 @@ -1,3 +1,5 @@ +use PathTools; + unit class Build; method build($cwd --> Bool) { @@ -22,5 +24,13 @@ method build($cwd --> Bool) { my $json = Rakudo::Internals::JSON.to-json: %libraries, :pretty, :sorted-keys; "resources/libraries.json".IO.spurt: $json; + + # DO NOT COPY THIS SOLUTION + # Delete precomp files when building in case the openssl libs have since been updated + # (ideally this type of stale precomp would get picked up by raku) + # see: https://github.com/sergot/openssl/issues/82#issuecomment-864523511 + try rm($cwd.IO.child('.precomp').absolute, :r, :f, :d); + try rm($cwd.IO.child('lib/.precomp').absolute, :r, :f, :d); + return True; } diff --git a/META6.json b/META6.json index cfd5044..bb25308 100644 --- a/META6.json +++ b/META6.json @@ -4,6 +4,7 @@ "version" : "0.1.24", "author" : "github:sergot", "description" : "OpenSSL bindings", + "build-depends" : ["PathTools"], "depends" : [], "provides" : { "OpenSSL" : "lib/OpenSSL.pm6", From dcf88a825c65b2727b385452abec5af79811c162 Mon Sep 17 00:00:00 2001 From: Nick Logan Date: Sun, 20 Jun 2021 16:14:52 -0500 Subject: [PATCH 2/3] Use JSON::Fast to handle json Since this distribution is no longer dependency free it makes sense to use JSON::Fast instead of relying on rakudo specific implementation details. --- Build.pm6 | 3 ++- META6.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Build.pm6 b/Build.pm6 index 257b2c7..3e8ca16 100644 --- a/Build.pm6 +++ b/Build.pm6 @@ -1,4 +1,5 @@ use PathTools; +use JSON::Fast; unit class Build; @@ -22,7 +23,7 @@ method build($cwd --> Bool) { ; } - my $json = Rakudo::Internals::JSON.to-json: %libraries, :pretty, :sorted-keys; + my $json = to-json(%libraries, :pretty, :sorted-keys); "resources/libraries.json".IO.spurt: $json; # DO NOT COPY THIS SOLUTION diff --git a/META6.json b/META6.json index bb25308..02c8be1 100644 --- a/META6.json +++ b/META6.json @@ -4,7 +4,7 @@ "version" : "0.1.24", "author" : "github:sergot", "description" : "OpenSSL bindings", - "build-depends" : ["PathTools"], + "build-depends" : ["PathTools","JSON::Fast"], "depends" : [], "provides" : { "OpenSSL" : "lib/OpenSSL.pm6", From b59d6c677a3a91673a09f95e53a5a2f222a0d8f3 Mon Sep 17 00:00:00 2001 From: Nick Logan Date: Tue, 22 Jun 2021 16:08:04 -0500 Subject: [PATCH 3/3] Update appveyor to use zef to install deps / build --- appveyor.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8b08593..ec0be42 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,12 +13,14 @@ install: - SET PATH=%APPVEYOR_BUILD_FOLDER%\..\rakudo\install\bin;%PATH% - SET PATH=%APPVEYOR_BUILD_FOLDER%\..\rakudo\install\share\perl6\site\bin;%PATH% - cd %APPVEYOR_BUILD_FOLDER% + - git clone https://github.com/ugexe/zef %APPVEYOR_BUILD_FOLDER%\..\zef + - raku -I %APPVEYOR_BUILD_FOLDER%\..\zef %APPVEYOR_BUILD_FOLDER%\..\zef\bin\zef --deps-only install . + - raku -I %APPVEYOR_BUILD_FOLDER%\..\zef %APPVEYOR_BUILD_FOLDER%\..\zef\bin\zef build . build: off test_script: - SET NETWORK_TESTING=1 - - perl6 -I. -e "require(q[Build.pm6]); ::(q[Build]).new.build(q[.])" - - prove -v -e "perl6 -I." t/ + - prove -v -e "raku -I." t/ shallow_clone: true