1
6
Fork
You've already forked deploy
1

Fix compatibility with ClozureCL. #11

Merged
shinmera merged 2 commits from master into master 2019年11月19日 08:08:58 +01:00
Contributor
Copy link

Hello.
I've tried using deploy with ClozureCL and got the following error:

Error: The value #<SHLIB liballegro_audio.so.5.2 #x3020024F40CD> is not of the expected type (OR PATHNAME STREAM STRING).

with the following backtrace (truncated for clarity):

 (7FF883E25A20) : 0 (PATHNAME #<SHLIB liballegro_audio.so.5.2 #x3020024F403D>) 341
 (7FF883E25A38) : 1 (MERGE-PATHNAMES #P"liballegro_audio.so.5.2" #<SHLIB liballegro_audio.so.5.2 #x3020024F403D> :NEWEST) 285
 (7FF883E25A90) : 2 (FUNCALL #'#<#<STANDARD-METHOD DEPLOY:FIND-SOURCE-FILE (DEPLOY:LIBRARY)>> #<LIBRARY LIBALLEGRO-AUDIO>) 229

Upon investingating I found out that cffi:foreign-library-handle returns the PATHNAME object in SBCL, but under CCL it returns SHLIB object. I've tried replacing the call to cffi:foreign-library-handle with cffi:foreign-library-pathname, and it seemingly does the right thing - I was able to build my project using both SBCL and CCL.

Hello. I've tried using deploy with ClozureCL and got the following error: ``` Error: The value #<SHLIB liballegro_audio.so.5.2 #x3020024F40CD> is not of the expected type (OR PATHNAME STREAM STRING). ``` with the following backtrace (truncated for clarity): ``` (7FF883E25A20) : 0 (PATHNAME #<SHLIB liballegro_audio.so.5.2 #x3020024F403D>) 341 (7FF883E25A38) : 1 (MERGE-PATHNAMES #P"liballegro_audio.so.5.2" #<SHLIB liballegro_audio.so.5.2 #x3020024F403D> :NEWEST) 285 (7FF883E25A90) : 2 (FUNCALL #'#<#<STANDARD-METHOD DEPLOY:FIND-SOURCE-FILE (DEPLOY:LIBRARY)>> #<LIBRARY LIBALLEGRO-AUDIO>) 229 ``` Upon investingating I found out that `cffi:foreign-library-handle` returns the PATHNAME object in SBCL, but under CCL it returns SHLIB object. I've tried replacing the call to `cffi:foreign-library-handle` with `cffi:foreign-library-pathname`, and it seemingly does the right thing - I was able to build my project using both SBCL and CCL.
Shinmera commented 2019年11月18日 13:34:37 +01:00 (Migrated from github.com)
Copy link

I believe the reason I used handle is because pathname is not always populated, specifically in cases where the library is coming from the system linker, rather than from CFFI's own resolution mechanism.

I'm not sure what the best fix would be in this case. Probably a mechanism that tries pathname, then falls back on implementation-dependent resolution based on the handle. For CCL there might be a function to get the pathname out of an SHLIB.

I believe the reason I used handle is because pathname is not always populated, specifically in cases where the library is coming from the system linker, rather than from CFFI's own resolution mechanism. I'm not sure what the best fix would be in this case. Probably a mechanism that tries pathname, then falls back on implementation-dependent resolution based on the handle. For CCL there might be a function to get the pathname out of an SHLIB.
Author
Contributor
Copy link

Oh, all right, thanks for clarification.

For CCL there might be a function to get the pathname out of an SHLIB.

I'll search for one and change this PR using conditional macro for CCL later then.

Oh, all right, thanks for clarification. > For CCL there might be a function to get the pathname out of an SHLIB. I'll search for one and change this PR using conditional macro for CCL later then.
Author
Contributor
Copy link

I've pushed commit that properly converts SHLIB to PATHNAME when on ClozureCL. Looks better?

I've pushed commit that properly converts SHLIB to PATHNAME when on ClozureCL. Looks better?
Shinmera commented 2019年11月19日 08:03:40 +01:00 (Migrated from github.com)
Copy link

If it works for you, then yes, looks alright.

If it works for you, then yes, looks alright.
Author
Contributor
Copy link

Sure, I've tested it with both SBCL and CCL.
Thanks!

Sure, I've tested it with both SBCL and CCL. Thanks!
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
shinmera/deploy!11
Reference in a new issue
shinmera/deploy
No description provided.
Delete branch "master"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?