Skip to content

Move FFI::Platform::CPU from C to Ruby and remove duplicated libtest#663

Merged
larskanis merged 2 commits into
ffi:masterfrom
larskanis:cpu-to-ruby
Jan 23, 2019
Merged

Move FFI::Platform::CPU from C to Ruby and remove duplicated libtest#663
larskanis merged 2 commits into
ffi:masterfrom
larskanis:cpu-to-ruby

Conversation

@larskanis

Copy link
Copy Markdown
Member

See the commit messages for more details.

The CPU detection was moved to C 10 years ago as a workaround to an
incorrect RbConfig::CONFIG['host_cpu'] value on MacOS.
This was in commit c53282a .
Although I can't reproduce the original environment, I guess that
this issue has been fixed years ago, so that the workaround isn't
necessary anymore.

Moving CPU detection to Ruby allows to use lib/ffi/platform.rb in
Rakefile before the C ext is built.
The test library has been moved to spec/ffi/fixtures and it's built
by the spec helper. This was in commit c79e9f5 .

Since that time we managed two copies of these tests, but only the one
in spec/ffi/fixtures is actually used.
@eregon

eregon commented Jan 15, 2019

Copy link
Copy Markdown
Collaborator

Looks great to me.
I was wondering what was these duplicated files in libtest.

@eregon

eregon commented Jan 22, 2019

Copy link
Copy Markdown
Collaborator

Let's merge this :) Anything we need to wait for?

@larskanis larskanis merged commit bc556a1 into ffi:master Jan 23, 2019
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.

2 participants