-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
p11-kit: Set proper proxy_module variable for pkg-config #22595
Open
mlt
wants to merge
1
commit into
msys2:master
Choose a base branch
from
mlt:p11-kit-proxy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- p11-kit-0.25.5/p11-kit/p11-kit-1.pc.in.orig 2023-10-24 07:58:49.000000000 -0500 | ||
+++ p11-kit-0.25.5/p11-kit/p11-kit-1.pc.in 2024-11-19 12:57:54.924556600 -0600 | ||
@@ -9,7 +9,7 @@ | ||
p11_module_configs=@p11_package_config_modules@ | ||
p11_module_path=@p11_module_path@ | ||
p11_trust_paths=@with_trust_paths@ | ||
-proxy_module=@libdir@/p11-kit-proxy@p11_shlext@ | ||
+proxy_module=libp11-kit-0.dll | ||
|
||
# This is for compatibility. Other packages were using this to determine | ||
# the directory they should install their module configs to, so override |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this be more correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was pondering about this. It does look good but I think it is impractical. If let be, applications that depend on it will likely compile the path in (
C:/msys64/ucrt64/bin/libp11-kit-0.dll
) thus making msys2 installation not so portable. Of course, one may patch up the application, but what is the point of having pkg-config then?Here is somewhat related (portability) issue #22187 . It looks like MSYS2 build farm uses
D:/a/MSYS64
prefix. However, for end user MSYS2 typically installs intoC:/MSYS64
. That impliesproxy_module
will be broken out of the gate for libp11 without more patching.Also speaking of pkg-config, while building libp11, I stumbled on this
I'm sure there is a reason why pkg-config expands prefix Windows style, but it causes pain as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, hm. Hardcoding absolute path in binaries on Windows is a no-no in general, independent of pkg-config. Everything else works just as on Linux.
I'd say the real fix is to make libp11 relocatable, but I see that this here would be easier for now, hm... so guess this is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that libp11 calls pkg-config incorrectly in configure.ac in multiple places and doesn't provide the configured prefix to it. That would be even wrong on Linux if installing into a different prefix there (which is rarely used there though..)
Every call to pkg-config that gets used as an install path needs to be passed
--define-variable=prefix="${prefix}"
so the paths get relocated to the install prefix.That doesn't fix the hardcode issue, but fixes the wrong install paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern is whether there are any security (or other) implications by allowing to load everything with same name on the PATH. I think here it is okayish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, by not passing an absolute path it will even load from the current working dir before looking at PATH (with it using plain LoadLibrary), unless the exe is in the same dir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is acceptable as one can just set
PKCS11_MODULE_PATH
environment variable in the first place.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last but not least. Would it be better to use
sed
for a single line edits instead of a patch? Are patches the only acceptable norm?Is there any easy way to infer
-0
besides reading dlname fromlibp11-kit.la
? I mean how stable is it? I understand it comes somewhere from libtool but I'm clueless at this point what could make it-1
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually it is
SOVERSION
IIRC