[前][次][番号順一覧][スレッド一覧]

ruby-changes:68517

From: Nobuyoshi <ko1@a...>
Date: Mon, 18 Oct 2021 13:03:06 +0900 (JST)
Subject: [ruby-changes:68517] 0bbfb6a37b (master): Fix error when srcdir not found

https://git.ruby-lang.org/ruby.git/commit/?id=0bbfb6a37b

From 0bbfb6a37b6fa65c2aeb7a587ef75ce2fa4a4ec3 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 18 Oct 2021 10:29:51 +0900
Subject: Fix error when srcdir not found

So that `spec/mspec/bin/mspec --help` works at least.
---
 spec/default.mspec | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/spec/default.mspec b/spec/default.mspec
index 162fa8b9f2..2dbaeb83d3 100644
--- a/spec/default.mspec
+++ b/spec/default.mspec
@@ -10,17 +10,19 @@ class MSpecScript https://github.com/ruby/ruby/blob/trunk/spec/default.mspec#L10
   builddir = Dir.pwd
   srcdir = ENV['SRCDIR']
   srcdir ||= File.read("Makefile", encoding: "US-ASCII")[/^\s*srcdir\s*=\s*(.+)/i, 1] rescue nil
-  srcdir = File.expand_path(srcdir)
   config = RbConfig::CONFIG
 
   # The default implementation to run the specs.
   set :target, File.join(builddir, "miniruby#{config['exeext']}")
   set :prefix, File.expand_path('ruby', File.dirname(__FILE__))
-  set :flags, %W[
-    -I#{srcdir}/lib
-    #{srcdir}/tool/runruby.rb --archdir=#{Dir.pwd} --extout=#{config['EXTOUT']}
-    --
-  ]
+  if srcdir
+    srcdir = File.expand_path(srcdir)
+    set :flags, %W[
+      -I#{srcdir}/lib
+      #{srcdir}/tool/runruby.rb --archdir=#{builddir} --extout=#{config['EXTOUT']}
+      --
+    ]
+  end
 end
 
 module MSpecScript::JobServer
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]