Skip to content

Use Resource::Wrangler for handling resource paths #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

ab5tract
Copy link

@ab5tract ab5tract commented May 5, 2025

This simplifies the code and removes the necessity to worry over the details of using temporary files for accessing resources.

This simplifies the code and removes the necessity to worry over
the details of using temporary files for accessing resources.
META6.json Outdated
@@ -5,7 +5,8 @@
],
"build-depends": [
"PathTools",
"JSON::Fast"
"JSON::Fast",
"Resource::Wrangler"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make this a full dependency: Resource::Wrangler:ver<1.0.2+>:authzef:ab5tract

META6.json Outdated
@@ -45,5 +46,5 @@
],
"test-depends": [
],
"version": "0.2.4"
"version": "0.2.5"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an App::Mi6 enabled module: on release this will automatically updated.

@@ -1,5 +1,7 @@
unit module OpenSSL::NativeLib;

use Resource::Wrangler;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also full dependency please :-)

@lizmat
Copy link
Collaborator

lizmat commented May 5, 2025

To allow a release, the Changes file needs an update.

META6.json Outdated
@@ -5,7 +5,8 @@
],
"build-depends": [
"PathTools",
"JSON::Fast"
"JSON::Fast",
"Resource::Wrangler"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a regular runtime dependency

@ugexe
Copy link
Member

ugexe commented May 5, 2025

As you can see from the CI this isn't working on Windows

Copy link
Member

@ugexe ugexe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comments

}

$dll-resource.absolute
load-resource-to-path($resource-name).absolute
Copy link
Member

@ugexe ugexe May 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🙃

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, on Windows $*TMPDIR is already underneath a user's folder.

@ab5tract ab5tract force-pushed the use-resource-wrangler branch 2 times, most recently from 8b560df to c9f7ba5 Compare May 5, 2025 21:06
@ab5tract ab5tract force-pushed the use-resource-wrangler branch from c9f7ba5 to 61b175e Compare May 5, 2025 21:26
@ab5tract ab5tract closed this May 5, 2025
@ab5tract
Copy link
Author

ab5tract commented May 5, 2025

Closing as the current implementation of load-resource-to-path will not work for the use case of persisted files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants