ruby-changes:47737
From: hsbt <ko1@a...>
Date: Tue, 12 Sep 2017 20:52:29 +0900 (JST)
Subject: [ruby-changes:47737] hsbt:r59854 (trunk): Merge fiddle-1.0.0.beta2 from upstream.
hsbt 2017-09-12 20:52:23 +0900 (Tue, 12 Sep 2017) New Revision: 59854 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59854 Log: Merge fiddle-1.0.0.beta2 from upstream. * ext/fiddle/closure.c: use directly declaration for standalone gem without internal.h. * Specify frozen string literal is true. * Update gemspec configuration for release version. Modified files: trunk/ext/fiddle/closure.c trunk/ext/fiddle/extconf.rb trunk/ext/fiddle/fiddle.gemspec trunk/ext/fiddle/lib/fiddle/closure.rb trunk/ext/fiddle/lib/fiddle/cparser.rb trunk/ext/fiddle/lib/fiddle/function.rb trunk/ext/fiddle/lib/fiddle/import.rb trunk/ext/fiddle/lib/fiddle/pack.rb trunk/ext/fiddle/lib/fiddle/struct.rb trunk/ext/fiddle/lib/fiddle/types.rb trunk/ext/fiddle/lib/fiddle/value.rb trunk/ext/fiddle/lib/fiddle.rb trunk/ext/fiddle/win32/libffi-config.rb trunk/test/fiddle/helper.rb trunk/test/fiddle/test_c_struct_entry.rb trunk/test/fiddle/test_c_union_entity.rb trunk/test/fiddle/test_closure.rb trunk/test/fiddle/test_cparser.rb trunk/test/fiddle/test_fiddle.rb trunk/test/fiddle/test_func.rb trunk/test/fiddle/test_function.rb trunk/test/fiddle/test_handle.rb trunk/test/fiddle/test_import.rb trunk/test/fiddle/test_pointer.rb Index: test/fiddle/test_func.rb =================================================================== --- test/fiddle/test_func.rb (revision 59853) +++ test/fiddle/test_func.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_func.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true begin require_relative 'helper' rescue LoadError @@ -16,7 +16,7 @@ module Fiddle https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_func.rb#L16 assert_raise(SecurityError) do Thread.new { $SAFE = 1 - f.call("uname -rs".taint) + f.call("uname -rs".dup.taint) }.join end end Index: test/fiddle/test_handle.rb =================================================================== --- test/fiddle/test_handle.rb (revision 59853) +++ test/fiddle/test_handle.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_handle.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true begin require_relative 'helper' rescue LoadError @@ -11,7 +11,7 @@ module Fiddle https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_handle.rb#L11 def test_safe_handle_open t = Thread.new do $SAFE = 1 - Fiddle::Handle.new(LIBC_SO.taint) + Fiddle::Handle.new(LIBC_SO.dup.taint) end assert_raise(SecurityError) { t.value } end @@ -20,7 +20,7 @@ module Fiddle https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_handle.rb#L20 t = Thread.new do h = Fiddle::Handle.new(LIBC_SO) $SAFE = 1 - h["qsort".taint] + h["qsort".dup.taint] end assert_raise(SecurityError) { t.value } end Index: test/fiddle/test_closure.rb =================================================================== --- test/fiddle/test_closure.rb (revision 59853) +++ test/fiddle/test_closure.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_closure.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true begin require_relative 'helper' rescue LoadError Index: test/fiddle/test_cparser.rb =================================================================== --- test/fiddle/test_cparser.rb (revision 59853) +++ test/fiddle/test_cparser.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_cparser.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true begin require_relative 'helper' require 'fiddle/cparser' Index: test/fiddle/helper.rb =================================================================== --- test/fiddle/helper.rb (revision 59853) +++ test/fiddle/helper.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fiddle/helper.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true require 'test/unit' require 'fiddle' Index: test/fiddle/test_pointer.rb =================================================================== --- test/fiddle/test_pointer.rb (revision 59853) +++ test/fiddle/test_pointer.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_pointer.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true begin require_relative 'helper' rescue LoadError Index: test/fiddle/test_function.rb =================================================================== --- test/fiddle/test_function.rb (revision 59853) +++ test/fiddle/test_function.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_function.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true begin require_relative 'helper' rescue LoadError Index: test/fiddle/test_c_union_entity.rb =================================================================== --- test/fiddle/test_c_union_entity.rb (revision 59853) +++ test/fiddle/test_c_union_entity.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_c_union_entity.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true begin require_relative 'helper' require 'fiddle/struct' Index: test/fiddle/test_c_struct_entry.rb =================================================================== --- test/fiddle/test_c_struct_entry.rb (revision 59853) +++ test/fiddle/test_c_struct_entry.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_c_struct_entry.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true begin require_relative 'helper' require 'fiddle/struct' Index: test/fiddle/test_fiddle.rb =================================================================== --- test/fiddle/test_fiddle.rb (revision 59853) +++ test/fiddle/test_fiddle.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_fiddle.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true begin require_relative 'helper' rescue LoadError Index: test/fiddle/test_import.rb =================================================================== --- test/fiddle/test_import.rb (revision 59853) +++ test/fiddle/test_import.rb (revision 59854) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_import.rb#L1 # coding: US-ASCII -# frozen_string_literal: false +# frozen_string_literal: true begin require_relative 'helper' require 'fiddle/import' Index: ext/fiddle/extconf.rb =================================================================== --- ext/fiddle/extconf.rb (revision 59853) +++ ext/fiddle/extconf.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ext/fiddle/extconf.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true require 'mkmf' # :stopdoc: @@ -41,12 +41,12 @@ begin https://github.com/ruby/ruby/blob/trunk/ext/fiddle/extconf.rb#L41 libffi.lib = "#{libffi.builddir}/.libs" libffi.a = "#{libffi.lib}/libffi_convenience.#{$LIBEXT}" nowarn = CONFIG.merge("warnflags"=>"") - libffi.cflags = RbConfig.expand("$(CFLAGS)", nowarn) + libffi.cflags = RbConfig.expand("$(CFLAGS)".dup, nowarn) ver = ver[/libffi-(.*)/, 1] FileUtils.mkdir_p(libffi.dir) libffi.opt = CONFIG['configure_args'][/'(-C)'/, 1] - libffi.ldflags = RbConfig.expand("$(LDFLAGS) #{libpathflag([relative_from($topdir, "..")])} #{$LIBRUBYARG}") + libffi.ldflags = RbConfig.expand("$(LDFLAGS) #{libpathflag([relative_from($topdir, "..")])} #{$LIBRUBYARG}".dup) libffi.arch = RbConfig::CONFIG['host'] if $mswin unless find_executable(as = /x64/ =~ libffi.arch ? "ml64" : "ml") @@ -77,7 +77,7 @@ begin https://github.com/ruby/ruby/blob/trunk/ext/fiddle/extconf.rb#L77 args << libffi.opt if libffi.opt args.concat %W[ CC=#{cc} CFLAGS=#{libffi.cflags} - CXX=#{cxx} CXXFLAGS=#{RbConfig.expand("$(CXXFLAGS)", nowarn)} + CXX=#{cxx} CXXFLAGS=#{RbConfig.expand("$(CXXFLAGS)".dup, nowarn)} LD=#{ld} LDFLAGS=#{libffi.ldflags} ] Index: ext/fiddle/fiddle.gemspec =================================================================== --- ext/fiddle/fiddle.gemspec (revision 59853) +++ ext/fiddle/fiddle.gemspec (revision 59854) @@ -1,14 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ext/fiddle/fiddle.gemspec#L1 # frozen_string_literal: true Gem::Specification.new do |spec| spec.name = "fiddle" - spec.version = '1.0.0.beta1' + spec.version = '1.0.0.beta2' spec.authors = ["Aaron Patterson", "SHIBATA Hiroshi"] spec.email = ["aaron@t...", "hsbt@r..."] spec.summary = %q{A libffi wrapper for Ruby.} spec.description = %q{A libffi wrapper for Ruby.} spec.homepage = "https://github.com/ruby/fiddle" - spec.license = "MIT" + spec.license = "BSD-2-Clause" spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "ext/fiddle/closure.c", "ext/fiddle/closure.h", "ext/fiddle/conversions.c", "ext/fiddle/conversions.h", "ext/fiddle/extconf.rb", "ext/fiddle/extlibs", "ext/fiddle/fiddle.c", "ext/fiddle/fiddle.h", "ext/fiddle/function.c", "ext/fiddle/function.h", "ext/fiddle/handle.c", "ext/fiddle/pointer.c", "ext/fiddle/win32/fficonfig.h", "ext/fiddle/win32/libffi-3.2.1-mswin.patch", "ext/fiddle/win32/libffi-config.rb", "ext/fiddle/win32/libffi.mk.tmpl", "fiddle.gemspec", "lib/fiddle.rb", "lib/fiddle/closure.rb", "lib/fiddle/cparser.rb", "lib/fiddle/function.rb", "lib/fiddle/import.rb", "lib/fiddle/pack.rb", "lib/fiddle/struct.rb", "lib/fiddle/types.rb", "lib/fiddle/value.rb"] spec.bindir = "exe" @@ -17,6 +17,5 @@ Gem::Specification.new do |spec| https://github.com/ruby/ruby/blob/trunk/ext/fiddle/fiddle.gemspec#L17 spec.add_development_dependency "bundler" spec.add_development_dependency "rake" - spec.add_development_dependency "minitest", "~> 4.0" spec.add_development_dependency "rake-compiler" end Index: ext/fiddle/closure.c =================================================================== --- ext/fiddle/closure.c (revision 59853) +++ ext/fiddle/closure.c (revision 59854) @@ -1,6 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ext/fiddle/closure.c#L1 #include <fiddle.h> #include <ruby/thread.h> -#include "internal.h" /* rb_thread_has_gvl_p */ + +int ruby_thread_has_gvl_p(void); /* from internal.h */ VALUE cFiddleClosure; Index: ext/fiddle/win32/libffi-config.rb =================================================================== --- ext/fiddle/win32/libffi-config.rb (revision 59853) +++ ext/fiddle/win32/libffi-config.rb (revision 59854) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ext/fiddle/win32/libffi-config.rb#L1 #!/usr/bin/ruby -# frozen_string_literal: false +# frozen_string_literal: true require 'fileutils' basedir = File.dirname(__FILE__) Index: ext/fiddle/lib/fiddle/closure.rb =================================================================== --- ext/fiddle/lib/fiddle/closure.rb (revision 59853) +++ ext/fiddle/lib/fiddle/closure.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ext/fiddle/lib/fiddle/closure.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true module Fiddle class Closure Index: ext/fiddle/lib/fiddle/value.rb =================================================================== --- ext/fiddle/lib/fiddle/value.rb (revision 59853) +++ ext/fiddle/lib/fiddle/value.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ext/fiddle/lib/fiddle/value.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true require 'fiddle' module Fiddle Index: ext/fiddle/lib/fiddle/pack.rb =================================================================== --- ext/fiddle/lib/fiddle/pack.rb (revision 59853) +++ ext/fiddle/lib/fiddle/pack.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ext/fiddle/lib/fiddle/pack.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true require 'fiddle' module Fiddle @@ -101,7 +101,7 @@ module Fiddle https://github.com/ruby/ruby/blob/trunk/ext/fiddle/lib/fiddle/pack.rb#L101 private def parse_types(types) - @template = "" + @template = "".dup addr = 0 types.each{|t| orig_addr = addr Index: ext/fiddle/lib/fiddle/cparser.rb =================================================================== --- ext/fiddle/lib/fiddle/cparser.rb (revision 59853) +++ ext/fiddle/lib/fiddle/cparser.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ext/fiddle/lib/fiddle/cparser.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true module Fiddle # A mixin that provides methods for parsing C struct and prototype signatures. # Index: ext/fiddle/lib/fiddle/struct.rb =================================================================== --- ext/fiddle/lib/fiddle/struct.rb (revision 59853) +++ ext/fiddle/lib/fiddle/struct.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ext/fiddle/lib/fiddle/struct.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true require 'fiddle' require 'fiddle/value' require 'fiddle/pack' Index: ext/fiddle/lib/fiddle/types.rb =================================================================== --- ext/fiddle/lib/fiddle/types.rb (revision 59853) +++ ext/fiddle/lib/fiddle/types.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ext/fiddle/lib/fiddle/types.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true module Fiddle # Adds Windows type aliases to the including class for use with # Fiddle::Importer. Index: ext/fiddle/lib/fiddle/function.rb =================================================================== --- ext/fiddle/lib/fiddle/function.rb (revision 59853) +++ ext/fiddle/lib/fiddle/function.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ext/fiddle/lib/fiddle/function.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true module Fiddle class Function # The ABI of the Function. Index: ext/fiddle/lib/fiddle/import.rb =================================================================== --- ext/fiddle/lib/fiddle/import.rb (revision 59853) +++ ext/fiddle/lib/fiddle/import.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ext/fiddle/lib/fiddle/import.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true require 'fiddle' require 'fiddle/struct' require 'fiddle/cparser' Index: ext/fiddle/lib/fiddle.rb =================================================================== --- ext/fiddle/lib/fiddle.rb (revision 59853) +++ ext/fiddle/lib/fiddle.rb (revision 59854) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ext/fiddle/lib/fiddle.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true require 'fiddle.so' require 'fiddle/function' require 'fiddle/closure' -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/