From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (smtp.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 9F8141BA00FF for ; Wed, 17 May 2017 05:27:22 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 179F8B5D8A4 for ; Wed, 17 May 2017 06:12:28 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 27E9018CC836 for ; Wed, 17 May 2017 06:12:28 +0900 (JST) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 80C8312074C; Wed, 17 May 2017 06:12:25 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 4A5BE1205F6 for ; Wed, 17 May 2017 06:12:20 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=4r/FFJFtOUX3HvHz+87Cq2OCCjg=; b=Ft1fJN+X5TGF6l2xb5 x0xALbP7+3SpSLGulvUMAC/RLsO9RzROxPH7TJdcEjEQya4v2qsAc0vYkf6ORwM1 ifXPVEUVhcCfx77GDJzITrLlfRXcr3MyCxs1Xbu8YtkchrKauBiUezHEHUg/FhSE HjNuHoumdxm0LN+UvhBETZqRg= Received: by filter0958p1mdw1.sendgrid.net with SMTP id filter0958p1mdw1-10525-591B6B11-B 2017-05-16 21:11:45.170065558 +0000 UTC Received: from herokuapp.com (ec2-107-20-98-41.compute-1.amazonaws.com [107.20.98.41]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id fKR1bcqLQSaS8xu857o7VQ for ; Tue, 16 May 2017 21:11:45.143 +0000 (UTC) Date: Tue, 16 May 2017 21:11:45 +0000 From: Greg.mpls@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56227 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13570 X-Redmine-Issue-Author: Eregon X-Redmine-Sender: MSP-Greg X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS5yQR/5RV9E2DL8c3Co+rGoaTA5TeaJ5P5xSP IK7cgkUpqLt0EGkACzRWGfH6njl1+8xIu1gLfAD4pouLfXzHDFeHCJk9hUFPu5bbXQ3euQEGEvAlXZ hK8PWNSi6XZ/NiZAeFWRdCLch9NRNcKRfgmKZ5Kz4w6/M7R9DoqmpKxJuw== X-ML-Name: ruby-core X-Mail-Count: 81200 Subject: [ruby-core:81200] [Ruby trunk Feature#13570] Using mkmf for ruby/spec C API specs X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #13570 has been updated by MSP-Greg (Greg L). > Does mkmf works well on Windows? I'm not a c type. With MinGW builds, I've got 89 mkmf.log files in the build dir, and [test-all results](https://msp-greg.github.io/file.mingw_test-all.html) are consistent and reasonable low. I'm guessing that means yes. FYI, I ran test-spec with -j on 58760, and it matched (or very closely matched) results without -j. test-all has the same results, but assertions and skips are different. ---------------------------------------- Feature #13570: Using mkmf for ruby/spec C API specs https://bugs.ruby-lang.org/issues/13570#change-64855 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Hello all, I am thinking to use mkmf to compile the C API specs. https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/optional/capi/spec_helper.rb is getting pretty complex and hard to maintain. I have a few questions: * Does mkmf works well on Windows? * What is a good way to compile a single .c file with mkmf to a given library file in another directory? I tried this but I am not sure it's correct: ~~~ ruby def compile_extension(name) objdir = object_path ext = "#{name}_spec" lib = "#{objdir}/#{ext}.#{RbConfig::CONFIG['DLEXT']}" require 'mkmf' # TODO: probably best to use a subprocess to avoid polluting the namespace Dir.chdir(objdir) do $srcs = ["#{extension_path}/#{ext}.c"] $objs = ["#{extension_path}/#{ext}.o"] # should probably be in objdir but that does not seem to work create_makefile(ext) system "make" end lib end ~~~ Alternatively, we can copy the needed files to a temporary directory, build there and copy the shared library back. It's a bit more work but not a big deal either. -- https://bugs.ruby-lang.org/