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

in `find_type': unable to resolve type 'intptr_t' (TypeError) #166

Closed
Vucius opened this issue Nov 25, 2021 · 3 comments
Closed

in `find_type': unable to resolve type 'intptr_t' (TypeError) #166

Vucius opened this issue Nov 25, 2021 · 3 comments

Comments

@Vucius
Copy link

Vucius commented Nov 25, 2021

Softare:Emacs 27.2
System: Win10
p "hello" # =>

and the error log

X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ffi-1.11.3/lib/ffi/types.rb:69:in `find_type': unable to resolve type 'intptr_t' (TypeError)
	from X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ffi-1.11.3/lib/ffi/library.rb:585:in `find_type'
	from X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ffi-1.11.3/lib/ffi/library.rb:265:in `block in attach_function'
	from X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ffi-1.11.3/lib/ffi/library.rb:252:in `each'
	from X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ffi-1.11.3/lib/ffi/library.rb:252:in `attach_function'
	from X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/childprocess-3.0.0/lib/childprocess/windows/lib.rb:175:in `<module:Lib>'
	from X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/childprocess-3.0.0/lib/childprocess/windows/lib.rb:35:in `<module:Windows>'
	from X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/childprocess-3.0.0/lib/childprocess/windows/lib.rb:2:in `<module:ChildProcess>'
	from X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/childprocess-3.0.0/lib/childprocess/windows/lib.rb:1:in `<top (required)>'
	from <internal:X:/Ruby/Ruby30-x64/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:X:/Ruby/Ruby30-x64/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/childprocess-3.0.0/lib/childprocess/windows.rb:33:in `<top (required)>'
	from <internal:X:/Ruby/Ruby30-x64/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:X:/Ruby/Ruby30-x64/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/childprocess-3.0.0/lib/childprocess.rb:209:in `<top (required)>'
	from <internal:X:/Ruby/Ruby30-x64/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:X:/Ruby/Ruby30-x64/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/seeing_is_believing-4.0.1/lib/seeing_is_believing/evaluate_by_moving_files.rb:16:in `<top (required)>'
	from <internal:X:/Ruby/Ruby30-x64/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:X:/Ruby/Ruby30-x64/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/seeing_is_believing-4.0.1/lib/seeing_is_believing.rb:8:in `<top (required)>'
	from <internal:X:/Ruby/Ruby30-x64/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:X:/Ruby/Ruby30-x64/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/seeing_is_believing-4.0.1/lib/seeing_is_believing/binary.rb:1:in `<top (required)>'
	from <internal:X:/Ruby/Ruby30-x64/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:X:/Ruby/Ruby30-x64/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from X:/Ruby/Ruby30-x64/lib/ruby/gems/3.0.0/gems/seeing_is_believing-4.0.1/bin/seeing_is_believing:6:in `<top (required)>'
	from X:/Ruby/Ruby30-x64/bin/seeing_is_believing:25:in `load'
	from X:/Ruby/Ruby30-x64/bin/seeing_is_believing:25:in `<main>'

Before I installed seeing_is_believing, I installed ffi-1.15.4.
But When typed gem install seeing_is_believing, ffi-1.11.3 was still be installed.

I think it is the gem's problem

@Vucius
Copy link
Author

Vucius commented Nov 30, 2021

ah,I think I found this reason.
there's three rubygems sources:

  • rubygems.org/
  • gems.ruby-china.com/
  • mirrors.tuna.tsinghua.edu.cn/rubygems/
And the all gemspec on there require ffi ~> 1.11 rather than 1.15 so, that's ...

@Vucius Vucius closed this as completed Nov 30, 2021
@Vucius
Copy link
Author

Vucius commented Nov 30, 2021

BTW, seeing_is_believing's version is 4.0.1 on these three rubygems.
Maybe, something did't go right.

@JoshCheek
Copy link
Owner

Hi, I'm not sure how to get everything working on all the different systems that need to run it. I'm pretty sure I can get it if I drop Windows support and monkey patch the FFI gem to understand the ARM processors (I do that on my machine so that I can at least use it still). Unfortunately, child process management just doesn't behave consistently across the different operating systems, and the majority of effort involved in this project now is trying to debug that, which is super painful and hasn't yielded much success.

I did rewrite it to just use Ruby's spawn method, but of course, that failed on Windows, too (🤔 IIRC, it was due to streams behaving differently).

Anyway, I've put bursts of effort into figuring it out a bunch of different times, and kinda feel like I don't know what to do now 😞

🤔 maybe if I made it a little bit dumber (eg not recording which side closed a stream) I could get spawn to work, which would then presumably remove the need for the childprocess gem, which could maybe get it back into a functional state.

🤔 oh, maybe also try pointing at the master branch on here instead of at Rubygems. There's some work on master, I think, which I didn't publish b/c it wasn't passing, but it's probably more likely to be correct. Like it should mostly work on Windows, even though the tests don't pass. You might get zombie processes, if you set a timeout and it kill the children, I can't remember if that's still a problem or not, I had it fixed at one point.

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

No branches or pull requests

2 participants