summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Don't use --release flag on Java 8 (#213)Pavel Rosický2023-03-301-1/+7
| | | | | | | | | | | | | | | | | this allows using ``` Rake::JavaExtensionTask.new("name", gemspec) do |ext| ext.release = '8' end ``` on Java 8 (for building the gem), because the flag is available since Java 9, see https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html this flag is for backward compatibility, so it's safe to just skip it if we can't use it. relates to https://github.com/puma/puma/pull/3109 https://github.com/socketry/nio4r/pull/292
* baseextensiontask: provide an API to allow for dynamic sources (#211)James Tucker2023-03-071-1/+3
| | | | | | | | | | | | | | | | | | If a build wishes to generate some of the extension source files then the pattern input is insufficient. Provide a place to stash an additional FileList that will then become a dependency of the compile tasks. Example: ```ruby file 'ext/libfoo/generated.c' do |t| open(t.name, 'w+) { |f| f << '#include <foo.h>' } end Rake::ExtensionTask.new('foo') do |ext| ext.extra_sources << 'generated.c' end ```
* Add support for RubyGems 3.3.21 or later (#209)Mike Dalessio2022-12-163-7/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-152-6/+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
* Support --release option to build JRuby extension for older platforms (#201)Satoshi Tagomori2022-01-221-2/+13
|
* 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 binary(platf)Sutou Kouhei2022-01-041-5/+7
|
* Reduce duplicated File.basename(binary_path)Sutou Kouhei2022-01-041-3/+4
|
* Fix binary paths for staging and clobber (#197)konsolebox2022-01-042-17/+35
|
* Fix extension pathSutou Kouhei2021-12-121-2/+2
|
* Remove needless lib_binary_path and lib_binary_dir_pathSutou Kouhei2021-12-121-5/+2
|
* Accept Symbol as nameSutou Kouhei2021-12-121-2/+2
|
* Fix a regression bugSutou Kouhei2021-12-121-0/+3
| | | | | | | | | | | GitHub: fix GH-196 It's caused when name that includes "/" is specified to Rake::ExtensionTask.new and the default lib_dir is used such as https://github.com/konsolebox/digest-xxhash-ruby . In the case, built binaries are copied to lib/ not lib/XXX/. Reported by konsolebox. Thanks!!!
* 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.
* Avoid warning: assigned but unused variable - e (#185)Olle Jonsson2021-01-291-1/+1
|
* 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
|
* Default to 1.7-level bytecode in Java build (#172)Charles Oliver Nutter2020-07-091-2/+2
|
* Fix ruby warning: (#168)Lars Kanis2020-01-111-0/+1
| | | lib/rake/extensiontask.rb:471: warning: instance variable @make not initialized
* Extend mingw search pattern to find x86_64 gcc (#164)Lars Kanis2019-12-271-1/+1
| | | The previous pattern only recognized 32 bit compiler versions.
* Fix typosSutou Kouhei2019-12-251-2/+2
| | | | | | | | GitHub: fix #163 TODO: We should add an example for command line. Reported by Kai Kuchenbecker. Thanks!!!
* java: use command line array style instead of stringSutou Kouhei2019-10-211-22/+37
|
* Make lint options customizable (#158)Stephen George2019-10-211-1/+16
| | | | | | | | | | | | | | | | | | * Make customizable compiler Xlint option for JRuby native extension * [CS] restructure and fix indentation of (defaults) spec * Add specs for lint_option * [DOC] CHANGELOG: stub changelog entry for the next release * [DOC] CHANGELOG: Make customizable compiler Xlint option for JRuby native extension * Use "-Xlint" option for JRuby native extension by default. `javac -help -X` > -Xlint Enable recommended warnings
* Use the same order as definitionsSutou Kouhei2019-09-201-2/+2
|
* Add the -encoding option optionally to java compiler (#157)Tiago Dias2019-09-201-1/+11
|
* Add missing parenthesisKouhei Sutou2019-01-041-3/+3
|
* Fix caseKouhei Sutou2019-01-041-1/+1
|
* Raise error with proper messagePrashant Vithani2019-01-031-9/+17
| | | | Add comments explaining each condition.
* Fix cross-platform compilation for Java extensionsPrashant Vithani2019-01-021-1/+14
| | | | | | | | | | Using `libdir` provided by `RbConfig` to compile java extension from MRI breaks as it can't find `jruby.jar` under `lib` directory. Added a check on file existence if the path is taken from RbConfig and if it doesn't exist, check for the path which is set in environment JRUBY_HOME to find correct `jruby.jar`. Raise the error to abort compilation if `jruby.jar` is not found.
* Stop to make unreleased Ruby installableKouhei Sutou2018-12-231-1/+1
| | | | | | GitHub: fix #150 Reported by MSP-Greg. Thanks!!!
* Use require at top levelKouhei Sutou2018-08-291-1/+2
|
* Merge pull request #147 from prashantvithani/fix-classpathKouhei Sutou2018-08-291-4/+6
|\ | | | | | | | | Use 'libdir' of rbconfig to get jruby classpath Patch by Prashant Vithani. Thanks!!!
| * Remove redundant check as it is always presentPrashant Vithani2018-08-281-2/+1
| |
| * Use 'libdir' of rbconfig to get jruby classpathPrashant Vithani2018-08-281-4/+7
| |
* | Update source & target version defaults to 6Prashant Vithani2018-08-281-2/+2
|/ | | | Source & Target version 5 are no longer supported for java8 and later. refer https://github.com/ruby-concurrency/concurrent-ruby/issues/747#issuecomment-416230078
* :warning: method redefinedAkira Matsuda2017-05-191-1/+1
|
* :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-212-13/+23
|
* Fix lib directory pathKouhei Sutou2016-06-201-1/+1
|