Use Resource::Wrangler for handling resource paths#109
Use Resource::Wrangler for handling resource paths#109
Conversation
This simplifies the code and removes the necessity to worry over the details of using temporary files for accessing resources.
META6.json
Outdated
| "PathTools", | ||
| "JSON::Fast" | ||
| "JSON::Fast", | ||
| "Resource::Wrangler" |
There was a problem hiding this comment.
Could you make this a full dependency: Resource::Wrangler:ver<1.0.2+>:authzef:ab5tract
META6.json
Outdated
| "test-depends": [ | ||
| ], | ||
| "version": "0.2.4" | ||
| "version": "0.2.5" |
There was a problem hiding this comment.
This is an App::Mi6 enabled module: on release this will automatically updated.
| @@ -1,5 +1,7 @@ | |||
| unit module OpenSSL::NativeLib; | |||
|
|
|||
| use Resource::Wrangler; | |||
There was a problem hiding this comment.
Also full dependency please :-)
|
To allow a release, the Changes file needs an update. |
META6.json
Outdated
| "PathTools", | ||
| "JSON::Fast" | ||
| "JSON::Fast", | ||
| "Resource::Wrangler" |
There was a problem hiding this comment.
This is a regular runtime dependency
|
As you can see from the CI this isn't working on Windows |
lib/OpenSSL/NativeLib.rakumod
Outdated
| } | ||
|
|
||
| $dll-resource.absolute | ||
| load-resource-to-path($resource-name).absolute |
There was a problem hiding this comment.
I'm not sure Resource::Wrangler is ideal to use here if it indeed needs to generate a unique path part every time it is run since that means on Windows we'd constantly be copying the OpenSSL libraries at runtime. In my original code above it would probably have been better to $*HOME as the prefix instead of $*TMPDIR to avoid security issues, but either way it has the advantage of putting the file in a deterministic spot so it is ideally only ever copied once.
There was a problem hiding this comment.
Both $prefix and $filename are available as optional parameters to the load-resource-to-path sub, so it is still a viable option here.
But for now I'm just trying to understand why the related tests are failing 🙃
There was a problem hiding this comment.
FWIW, on Windows $*TMPDIR is already underneath a user's folder.
8b560df to
c9f7ba5
Compare
c9f7ba5 to
61b175e
Compare
|
Closing as the current implementation of |
This simplifies the code and removes the necessity to worry over the details of using temporary files for accessing resources.