summaryrefslogtreecommitdiff
path: root/lib/rake/extensiontask.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add support for RubyGems 3.3.21 or later (#209)Mike Dalessio2022-12-161-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Rubygems 3.3.21, the Gem::Platform name always contains the library version for gnu platforms. So where the rake-compiler config entries previously were: ```yaml --- rbconfig-x86_64-linux-gnu-2.7.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-2.7.0/lib/ruby/2.7.0/x86_64-linux-gnu/rbconfig.rb" rbconfig-x86_64-linux-2.7.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-2.7.0/lib/ruby/2.7.0/x86_64-linux-gnu/rbconfig.rb" ``` with later versions of rubygems, it is only ```yaml --- rbconfig-x86_64-linux-gnu-2.7.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-2.7.0/lib/ruby/2.7.0/x86_64-linux-gnu/rbconfig.rb" ``` This means that the current way of finding a matching runtime, by doing a string comparison on the config keys, is no longer appropriate. This is causing failing builds downstream in `rake-compiler-dock`. This PR: - extracts a new CompilerConfig class to encapsulate the logic - uses `Gem::Platform#=~` to tell if the gem platform matches the runtime platform
* Defer requiring yamlSutou Kouhei2022-04-151-0/+1
| | | | | | | Because yaml requires stringio implicitly. If stringio is required, we can't use rake-compiler for stringio. See also: https://github.com/ruby/stringio/pull/21#issuecomment-1082632676
* Set correct `required_ruby_version` when some `RUBY_CC_VERSION`s are missing ↵Lars Kanis2022-01-181-3/+0
| | | | | | | (#199) The required_ruby_version was set twice, although one in define_native_tasks is enough. Fixes #198
* Reduce duplicated File.basename(binary_path)Sutou Kouhei2022-01-041-3/+4
|
* Fix binary paths for staging and clobber (#197)konsolebox2022-01-041-11/+23
|
* Fix extension pathSutou Kouhei2021-12-121-2/+2
|
* Remove needless lib_binary_path and lib_binary_dir_pathSutou Kouhei2021-12-121-5/+2
|
* Fix a regression bugSutou Kouhei2021-12-111-2/+15
| | | | | | | | | | | GitHub: fix GH-195 It's caused when base Ruby and cross Ruby use different RbConfig::CONFIG["ENABLE_SHARED"]. Gem's extension directory is depend on it. So we should use the same RbConfig::CONFIG["ENABLE_SHARED"] for both base Ruby and cross Ruby. Reported by Mike Dalessio. Thanks!!!
* Ignore target_prefix= to ensure installing lib_dirSutou Kouhei2021-12-081-1/+1
| | | | | | GitHub: fix GH-194 Reported by Andrew Kane. Thanks!!!
* Fix determining of ruby versions in "rake native gem" (#166)Lars Kanis2021-04-091-4/+7
| | | | | | | | | | | | | | | | | | | | "rake native gem" without "cross" didn't set the ruby version constraint. Instead it failed with NoMethodError like so: /ffi $ rake native gem no configuration section for specified version of Ruby (rbconfig-i386-mingw32-2.6.3) no configuration section for specified version of Ruby (rbconfig-x64-mingw32-2.6.3) install -c build/x86_64-linux/ffi_c/2.6.3/ffi_c.so lib/ffi_c.so cp build/x86_64-linux/ffi_c/2.6.3/ffi_c.so build/x86_64-linux/stage/lib/ffi_c.so rake aborted! NoMethodError: undefined method `split' for nil:NilClass /home/lars/.rvm/gems/ruby-2.6.3/gems/rake-compiler-1.0.9/lib/rake/extensiontask.rb:515:in `ruby_api_version' /home/lars/.rvm/gems/ruby-2.6.3/gems/rake-compiler-1.0.9/lib/rake/extensiontask.rb:262:in `block in define_native_tasks' /home/lars/.rvm/gems/ruby-2.6.3/gems/rake-12.3.3/exe/rake:27:in `<top (required)>' /home/lars/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval' /home/lars/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>' Tasks: TOP => native => native:x86_64-linux => native:ffi:x86_64-linux (See full trace by running task with --trace)
* Use "make install" instead of manually copying extension binary (#191)Lars Kanis2021-04-021-4/+22
| | | | | | Until now rake-compiler uses "make" to build the extension binary, but doesn't use "make install" to copy it into the lib directory. This has the downside, that only the extension binary is copied, but no additional files. In particular files registered per mkmf's $INSTALLFILES mechanism are not respected. Using "make install" fixes this.
* IronRuby has been a dead project for 10 years (#184)Thomas E Enebo2021-01-261-9/+0
|
* Use RAKE_EXTENSION_TASK_NO_NATIVE env var as the default valueSutou Kouhei2020-12-211-1/+1
|
* Fix ruby warning: (#168)Lars Kanis2020-01-111-0/+1
| | | lib/rake/extensiontask.rb:471: warning: instance variable @make not initialized
* Stop to make unreleased Ruby installableKouhei Sutou2018-12-231-1/+1
| | | | | | GitHub: fix #150 Reported by MSP-Greg. Thanks!!!
* :warning: method redefinedAkira Matsuda2017-05-191-1/+1
|
* :warning: assigned but unused variable - tmp_pathAkira Matsuda2017-05-191-1/+0
|
* :warning: shadowing outer local variable - pkgAkira Matsuda2017-05-191-4/+4
|
* Regard C++ sources as source_filesTakashi Kokubun2017-04-271-1/+1
|
* SimplifyKouhei Sutou2016-12-021-10/+9
|
* Fix a bug that Ruby versions are shared by all platformsKouhei Sutou2016-12-021-3/+4
|
* Set Ruby version constraints in the gemspec of cross gems.Lars Kanis2016-11-301-0/+19
| | | | | | | | This way the gem, that is not built for the ruby version in use, fails at install time rather than runtime. Moreover a clear error message is given to the user or bundler can select the source gem instead.
* Fixing another regular expression.Lars Kanis2016-11-121-1/+1
| | | | Same as in commit d0fd3260c.
* Add missing dependencyKouhei Sutou2016-06-211-5/+6
|
* Really support extension in sub directoryKouhei Sutou2016-06-211-12/+22
|
* Fix lib directory pathKouhei Sutou2016-06-201-1/+1
|
* SimplifyKouhei Sutou2016-04-241-7/+3
|
* SimplifyKouhei Sutou2016-04-241-2/+1
|
* Add missing parenthesesKouhei Sutou2016-04-241-1/+1
|
* Always use instance variableKouhei Sutou2016-04-241-1/+1
|
* Fix install destination with directory prefixesKenta Murata2016-04-241-1/+9
|
* May fix make detection on WindowsKouhei Sutou2016-03-161-1/+4
| | | | | | GitHub: #123 Reported by Aaron Stone. Thanks!!!
* Change the fake mechanism to be compatible with bundler.Lars Kanis2016-01-301-21/+14
| | | | | | | | | | | | | | | | | | | | The previous fake mechanism worked by hooking onto the "require 'rbconfig'" call. This is problematic because bundler internally requires rbconfig, but doesn't work corretly in a faked environment. It then fails to load gems that are also part of the standard library, like json and rdoc. This results in issues like https://github.com/rake-compiler/rake-compiler-dock/issues/8 The fake mechanism is now changed to hook onto the "require 'mkrb'" call, which is typically part of the extconf file, and it is where the faked platform values are actually needed. That way it is loaded after bundler/setup, so that the library paths are set according to the Gemfile.lock, to the native Linux libraries, before the fake environment is active. Please note, that the build directory of a given gem needs to be cleared, in order to get updated fake files. So do a "rm tmp pkg -rf".
* Find make program from PATHKouhei Sutou2015-03-251-11/+13
|
* Change make program detection with `make' fallbackThibault Jouan2015-03-161-3/+8
| | | | | | | | | | | | | | | | | | | Some platforms provide a working `make' program out of the box, but some versions of this program won't return a successful exit status code when given `-v' as argument. One such platform is FreeBSD, providing the `make' program in the base system which is based on `pmake'. This version won't accept `-v': $ make -v usage: make [-BeikNnqrstWwX] [-C directory] [-D variable] [-d flags] [-f makefile] [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file] [-V variable] [variable=value] [target ...] zsh: exit 2 make -v This change ensures detection with `gmake -v` or `make -v` will continue to work as expected, but adds a fallback on plain `make' when tested successfully with the `command' shell builtin.
* Remove needless shebangsKouhei Sutou2015-03-161-2/+0
|
* Remove executable bits from lib source filesThibault Jouan2015-03-151-0/+0
|
* Add rake tasks for files added to spec.files by a cross_compile blockAaron Stone2014-12-311-21/+25
| | | | Resolves #98
* Pre-load resolver library before faking, in order to avoid errorLars Kanis2013-10-231-0/+5
| | | | | | "cannot load such file -- win32/resolv" when it is required later on. This solves issue https://github.com/tjschuck/rake-compiler-dev-box/issues/5
* Patch Ruby 1.8.7's mkmf.rb so it works with newer Ruby.Akinori MUSHA2013-08-121-0/+11
|
* Merge pull request #74 from larskanis/masterLuis Lavena2013-05-051-8/+76
|\ | | | | Add support for cross builds for multiple target platforms.
| * Use platform specific directories for packaging gem files.Lars Kanis2013-03-271-4/+59
| | | | | | | | | | | | | | | | | | | | | | Building gems for distinct platforms within one rake run conflicted in the lib/ directory, because all binary extensions were stored there and were copied from there to become packaged. This resulted in storing a binary extension of a wrong platform in a gem. To avoid this, the files to package are now stored in a platform specific stage directory and are used to package the specific gem.
| * Add possibility to set per-platform cross_config_options.Lars Kanis2013-03-131-2/+15
| | | | | | | | | | This is especially useful to set distinct library paths for different target platforms.
| * Store cross compiled Ruby into seperate directories depending on HOST platform.Lars Kanis2013-03-131-2/+2
| | | | | | | | | | | | | | | | | | Also prefix the selection of rbconfig in config.yml with the corresponding Ruby platform. This allowes to use cross compiled Ruby-builds for multiple target architectures on the same machine. This is especially usefull to compile for Ruby-2.0 i386-mingw32 and x64-mingw32 platforms.
* | Re-support fat gemKouhei Sutou2013-03-211-6/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ruby 1.9 bundles RubyGems and it is required automatically before command line "-r" option. It breaks fake.rb trick. We cannot build fat gem without fake.rb trick because building fat gem requires two or more Rubies and fake.rb fakes Rubies. /tmp/rbconfig.rb: p :rbconfig puts caller module RbConfig Config = {} end /tmp/fake.rb: p :fake Command: % cd /tmp % ruby -v -I . -r fake -e '' ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] :rbconfig /usr/lib/ruby/1.9.1/rubygems.rb:31:in `require' /usr/lib/ruby/1.9.1/rubygems.rb:31:in `<top (required)>' <internal:gem_prelude>:1:in `require' <internal:gem_prelude>:1:in `<compiled>' :fake The command output shows fake.rb that is used to change RUBY_PLATFORM, RUBY_VERSION and so on in rake-compiler is required after rbconfig.rb. And rbconfig.rb is required from RubyGems. fake.rb should be required before rbconfig.rb because rbconfig.rb uses RUBY_VERSION. So this change puts 'require "fake.rb"' into rbconfig.rb. It ensures that fake.rb is evaluated before rbconfig.rb body is evaluated.
* Raise error when no make tool was found. Closes #53Luis Lavena2012-04-151-0/+5
|
* Generate dummy cross-compile target when no configuration exists.Matijs van Zuijlen2011-10-301-1/+10
| | | | This fixes issue #16.
* Merge pull request #45 from jfirebaugh/jruby_warningLuis Lavena2011-10-051-4/+6
|\ | | | | Only emit warnings when doing cross-compilation tasks
| * Emit JRuby cross-compile warnings only when actually doing cross-compiles.John Firebaugh2011-08-061-4/+6
| |
* | Add some test harness to latest changesLuis Lavena2011-10-051-1/+1
| | | | | | | | And also update History to reflect the new change in codebase