method
build_extension
v2_6_3 -
Show latest stable
-
0 notes -
Class: Builder
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
build_extension(extension, dest_path)
public
Hide source
# File lib/rubygems/ext/builder.rb, line 156 def build_extension(extension, dest_path) # :nodoc: results = [] # FIXME: Determine if this line is necessary and, if so, why. # Notes: # 1. As far as I can tell, this method is only called by +build_extensions+. # 2. The existence of this line implies +extension+ is, or previously was, # sometimes +false+ or +nil+. # 3. #1 and #2 combined suggests, but does not confirm, that # +@specs.extensions+ sometimes contained +false+ or +nil+ values. # 4. Nothing seems to explicitly handle +extension+ being empty, # which makes me wonder both what it should do and what it does. # # - @duckinator extension ||= '' # I wish I knew why this line existed extension_dir = File.expand_path File.join(@gem_dir, File.dirname(extension)) lib_dir = File.join @spec.full_gem_path, @spec.raw_require_paths.first builder = builder_for extension begin FileUtils.mkdir_p dest_path CHDIR_MUTEX.synchronize do pwd = Dir.getwd Dir.chdir extension_dir begin results = builder.build(extension, dest_path, results, @build_args, lib_dir) verbose { results.join("\n") } ensure begin Dir.chdir pwd rescue SystemCallError Dir.chdir dest_path end end end write_gem_make_out results.join "\n" rescue => e results << e.message build_error extension_dir, results.join("\n"), $@ end end