Skip to content
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

pandoc-lua can't require binary packages when installed with Conda #10069

Open
iandol opened this issue Aug 8, 2024 · 5 comments
Open

pandoc-lua can't require binary packages when installed with Conda #10069

iandol opened this issue Aug 8, 2024 · 5 comments

Comments

@iandol
Copy link
Contributor

iandol commented Aug 8, 2024

Explain the problem.

This is a weird issue. I've been trying to switch to more isolated workflow, using local environments of tools, and in this case used a conda manager pixi to install lua luarocks and pandoc local to a working folder. I used luarocks to install a lua debugging package mobdebug. Given a minimal test.lua script:

md = require("mobdebug")

print("Hello World")

Run with lua it is ok:

ζ lua test.lua 
Hello World

but run with pandoc-lua, a mapping process and mapped file (non-platform) have different Team IDs error occurs:

ζ ➪ pandoc-lua test.lua
Error running Lua:
error loading module 'socket.core' from file '/Users/ian/Code/dotpandoc/.pixi/envs/default/lib/lua/5.4/socket/core.so':
	dlopen(/Users/ian/Code/dotpandoc/.pixi/envs/default/lib/lua/5.4/socket/core.so, 0x0006): tried: '/Users/ian/Code/dotpandoc/.pixi/envs/default/lib/lua/5.4/socket/core.so' (code signature in <605C052E-EA8E-36D3-9CC1-598BA8D1AC1E> '/Users/ian/Code/dotpandoc/.pixi/envs/default/lib/lua/5.4/socket/core.so' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '/System/Volumes/Preboot/Cryptexes/OS/Users/ian/Code/dotpandoc/.pixi/envs/default/lib/lua/5.4/socket/core.so' (no such file), '/Users/ian/Code/dotpandoc/.pixi/envs/default/lib/lua/5.4/socket/core.so' (code signature in <605C052E-EA8E-36D3-9CC1-598BA8D1AC1E> '/Users/ian/Code/dotpandoc/.pixi/envs/default/lib/lua/5.4/socket/core.so' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs)
stack traceback:
	[C]: in function 'require'
	...de/dotpandoc/.pixi/envs/default/share/lua/5.4/socket.lua:12: in main chunk
	[C]: in function 'require'
	.../dotpandoc/.pixi/envs/default/share/lua/5.4/mobdebug.lua:99: in main chunk
	[C]: in function 'require'
	test.lua:2: in main chunk

This error only occurs for compiled libraries, pure lua code requires are ok. Something in the way pandoc is compiled increases the security level of the bundled lua. I thought I'd report this edge case for visibility than imagining it could be fixed.

Pandoc version?
V3.3 on macOS 14.6

@iandol iandol added the bug label Aug 8, 2024
@tarleb
Copy link
Collaborator

tarleb commented Aug 8, 2024

See also #6850. A PR to clear that up in the docs would be greatly appreciated.

@iandol
Copy link
Contributor Author

iandol commented Aug 14, 2024

Thanks @tarleb -- this is quite a messy issue to document, the current reference to this in the docs is only for the statically-linked linux build, and my issue was on a conda-built binary for macOS. I wonder if a note right at the top under Installing pandoc for statically-linked builds in general then referenced by each OS?

@iandol
Copy link
Contributor Author

iandol commented Aug 14, 2024

I also wonder whether it is worth mentioning the fact that Conda can be used to install pandoc is worth adding to that doc as well?

@tarleb
Copy link
Collaborator

tarleb commented Aug 14, 2024

Adding Conda as another install option would be good, I think 👍

I wonder if a note right at the top under Installing pandoc for statically-linked builds in general then referenced by each OS?

Good idea. Would you have time to create a PR?

@iandol
Copy link
Contributor Author

iandol commented Aug 15, 2024

Yes, I can do this.

iandol added a commit to iandol/pandoc that referenced this issue Aug 19, 2024
See jgm#10069 -- the static linked pandoc on other OSes also have a limitation to use binary lua packages. So added this point at the top of the document. In addition conda-forge is cross-platform way to install pandoc and other tools, added to Windows, macOS and Linux sections. I wrapped at 75 characters, is that right?
iandol added a commit to iandol/pandoc that referenced this issue Aug 19, 2024
See jgm#10069 -- the static linked pandoc on other OSes also
have a limitation to use binary lua packages. So added
this point at the top of the document. In addition
conda-forge is cross-platform way to install pandoc
and other tools, added to Windows, macOS and
Linux sections.

I wrapped at 75 characters, is that right?

Update INSTALL.md

fix a copy-paste typo.
iandol added a commit to iandol/pandoc that referenced this issue Aug 19, 2024
See jgm#10069 -- the static linked pandoc on other OSes also
have a limitation to use binary lua packages. So added
this point at the top of the document. In addition
conda-forge is cross-platform way to install pandoc
and other tools, added to Windows, macOS and
Linux sections.

I wrapped at 75 characters, is that right?

Update INSTALL.md

fix a copy-paste typo.
iandol added a commit to iandol/pandoc that referenced this issue Aug 19, 2024
See jgm#10069 -- the static linked pandoc on other OSes also
have a limitation to use binary lua packages. So added
this point at the top of the document. In addition
conda-forge is cross-platform way to install pandoc
and other tools, added to Windows, macOS and
Linux sections.

I wrapped at 75 characters, is that right?
jgm pushed a commit that referenced this issue Aug 28, 2024
…nstall options (#10098)

See #10069 -- the static linked pandoc on other OSes also
have a limitation to use binary lua packages. So added
this point at the top of the document. In addition
conda-forge is cross-platform way to install pandoc
and other tools, added to Windows, macOS and
Linux sections.

Co-authored-by: iandol <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants