[#29190] AIXでのコンパイル (オプションの統一など) — "Yutaka Kanemoto" <kinpoco@...>

金本ともうします。

21 messages 2006/08/06

[#29200] Re: [ruby-cvs:17336] ruby/lib/date: * lib/date/format.rb: specify maximum number of digits to parse — Tadayoshi Funaba <tadf@...>

ふなばです。

9 messages 2006/08/07

[#29252] 1.8.5への最終コミット — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

14 messages 2006/08/10

[#29284] CGI#out で MIMEエンコード文字列がデコードされる — とみたまさひろ <tommy@...>

とみたです。

26 messages 2006/08/17
[#29285] Re: CGI#out で MIMEエンコード文字列がデコードされる — Takahiro Kambe <taca@...> 2006/08/17

In message <20060817182312.adce9ff7.tommy@tmtm.org>

[#29286] Re: CGI#out で MIMEエンコード文字列がデコードされる — とみたまさひろ <tommy@...> 2006/08/17

とみたです。

[#29287] Re: CGI#out で MIMEエンコード文字列がデコードされる — Fujioka <fuj@...> 2006/08/17

藤岡です。

[#29288] Re: CGI#out で MIMEエンコード文字列がデコードされる — Fujioka <fuj@...> 2006/08/17

藤岡です。

[#29290] Re: CGI#out で MIMEエンコード文字列がデコードされる — Yukihiro Matsumoto <matz@...> 2006/08/17

まつもと ゆきひろです

[#29292] Re: CGI#out で MIMEエンコード文字列がデコードされる — Fujioka <fuj@...> 2006/08/17

藤岡です。

[#29291] ruby 1.8.5 preview4 — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

21 messages 2006/08/17
[#29314] Re: ruby 1.8.5 preview4 — URABE Shyouhei <root@...> 2006/08/18

卜部です。

[#29319] Re: ruby 1.8.5 preview4 — Yukihiro Matsumoto <matz@...> 2006/08/19

[#29321] Re: ruby 1.8.5 preview4 — URABE Shyouhei <root@...> 2006/08/19

卜部です。

[ruby-dev:29249] Re: AIXでのコンパイル (オプションの統一など)

From: "Yutaka Kanemoto" <kinpoco@...>
Date: 2006-08-09 18:05:10 UTC
List: ruby-dev #29249
金本です。
お世話になっています。

> これに関してはほとんどのシステムで共通すると思いますが、すでに
> FileUtils.installでは削除してからコピーしているはずです。もうちょっ
> と具体的なエラーの内容を教えてもらえませんか。
エラーは例えば以下のものです。
1.8.5preview3で、報告したPREINSTALLをからにしたときの結果です。
寸前にmake checkしていると、違うファイルでひっかかるときがあります。

# make install
(中略)
./miniruby ./ext/extmk.rb --dest-dir="" --make="make" --mflags=""
--make-flags="" --extout=".ext" --extension  --extstatic  -- install
cp -r ./.ext/. /home/kanemoto/r185p3/lib/ruby/1.8
/home/kanemoto/com/ruby-1.8.5/lib/fileutils.rb:1246:in `initialize':
Text file busy -
/home/kanemoto/r185p3/lib/ruby/1.8/./powerpc-aix5.3.0.0/etc.so
(Errno::ETXTBSY)
        from /home/kanemoto/com/ruby-1.8.5/lib/fileutils.rb:1246:in `open'
        from /home/kanemoto/com/ruby-1.8.5/lib/fileutils.rb:1246:in `copy_file'
        from /home/kanemoto/com/ruby-1.8.5/lib/fileutils.rb:1245:in `open'
        from /home/kanemoto/com/ruby-1.8.5/lib/fileutils.rb:1245:in `copy_file'
        from /home/kanemoto/com/ruby-1.8.5/lib/fileutils.rb:1215:in `copy'
        from /home/kanemoto/com/ruby-1.8.5/lib/fileutils.rb:447:in `copy_entry'
        from /home/kanemoto/com/ruby-1.8.5/lib/fileutils.rb:1308:in `traverse'
        from /home/kanemoto/com/ruby-1.8.5/lib/fileutils.rb:445:in `copy_entry'
        from /home/kanemoto/com/ruby-1.8.5/lib/fileutils.rb:423:in `cp_r'
        from /home/kanemoto/com/ruby-1.8.5/lib/fileutils.rb:1379:in
`fu_each_src_dest'
        from /home/kanemoto/com/ruby-1.8.5/lib/fileutils.rb:1393:in
`fu_each_src_dest0'
        from /home/kanemoto/com/ruby-1.8.5/lib/fileutils.rb:1377:in
`fu_each_src_dest'
        from /home/kanemoto/com/ruby-1.8.5/lib/fileutils.rb:422:in `cp_r'
        from ./ext/extmk.rb:389
make: *** [do-install-ext] Error 1

AIXがらみの報告の発端が1.8.5preview2でして、その後ずっと1.8での作業を
報告していてバージョンの言及をしていませんでした。
申し訳ありません。
ちょっと調べてみたのですが、おっしゃられている動作は1.9のものではありませんでしょうか?
1.9のfileutils.rbやext/extmk.rbを1.8のものと比較すると、remove_destinationオプションが
1.9で追加になっているようです。これがあれば報告したPREINSTALLは
必要なくなるようです。私のはひどいクイックハックでした。

PREINSTALLを消して、remove_destinationをバックポートする1.8へのパッチを
作ってみました。ご一考いただけますでしょうか?
どうもご迷惑をおかけしました。

また、今回の作業で気づいたのですが、1.9のcommon.mkに、私の書いた
Win32に問題のある部分が残っていましたので、
念のためにそちらもパッチにしておきました。
よろしくおねがいします。

-- 
Yutaka KANEMOTO
http://d.hatena.ne.jp/kinpoco/

Attachments (2)

remove_destination.patch (4.11 KB, text/x-diff)
Index: Makefile.in
===================================================================
RCS file: /src/ruby/Makefile.in,v
retrieving revision 1.55.2.15
diff -u -r1.55.2.15 Makefile.in
--- Makefile.in	8 Aug 2006 02:37:43 -0000	1.55.2.15
+++ Makefile.in	9 Aug 2006 17:52:55 -0000
@@ -85,7 +85,6 @@
 OBJEXT        = @OBJEXT@
 MANTYPE	      = @MANTYPE@
 
-PREINSTALL    = @PREINSTALL@
 #### End of variables
 
 all:
Index: configure.in
===================================================================
RCS file: /src/ruby/configure.in,v
retrieving revision 1.212.2.60
diff -u -r1.212.2.60 configure.in
--- configure.in	8 Aug 2006 02:37:43 -0000	1.212.2.60
+++ configure.in	9 Aug 2006 17:52:56 -0000
@@ -1449,9 +1449,6 @@
 	esac
 	MINIOBJS=dmydln.o
 	;;
-    aix*)
-	PREINSTALL='@$(RM) -r $(prefix)/lib/$(LIBRUBY_A) $(prefix)/lib/$(LIBRUBY_SO) $(prefix)/lib/ruby/$(MAJOR).$(MINOR)/$(arch)'
-	;;
     *)
 	;;
 esac
@@ -1484,7 +1481,6 @@
 AC_SUBST(COMMON_HEADERS)
 AC_SUBST(EXPORT_PREFIX)
 AC_SUBST(MINIOBJS)
-AC_SUBST(PREINSTALL)
 
 MAKEFILES="Makefile `echo $FIRSTMAKEFILE | sed 's/:.*//'`"
 MAKEFILES="`echo $MAKEFILES`"
Index: ext/extmk.rb
===================================================================
RCS file: /src/ruby/ext/extmk.rb,v
retrieving revision 1.44.2.29
diff -u -r1.44.2.29 extmk.rb
--- ext/extmk.rb	21 Jul 2006 03:12:44 -0000	1.44.2.29
+++ ext/extmk.rb	9 Aug 2006 17:52:56 -0000
@@ -386,7 +386,7 @@
     unless $destdir.empty?
       dest.sub!($dest_prefix_pattern, Config.expand($destdir.dup))
     end
-    FileUtils.cp_r(extout+"/.", dest, :verbose => true, :noop => $dryrun)
+    FileUtils.cp_r(extout+"/.", dest, :verbose => true, :noop => $dryrun, :remove_destination => true)
     exit
   end
   unless $ignore
Index: lib/fileutils.rb
===================================================================
RCS file: /src/ruby/lib/fileutils.rb,v
retrieving revision 1.36.2.16
diff -u -r1.36.2.16 fileutils.rb
--- lib/fileutils.rb	18 Feb 2006 03:23:15 -0000	1.36.2.16
+++ lib/fileutils.rb	9 Aug 2006 17:52:56 -0000
@@ -392,7 +392,7 @@
   OPT_TABLE['copy'] = %w( noop verbose preserve )
 
   #
-  # Options: preserve noop verbose dereference_root
+  # Options: preserve noop verbose dereference_root remove_destination
   # 
   # Copies +src+ to +dest+. If +src+ is a directory, this method copies
   # all its contents recursively. If +dest+ is a directory, copies
@@ -415,17 +415,17 @@
   #                                      # but this doesn't.
   # 
   def cp_r(src, dest, options = {})
-    fu_check_options options, :preserve, :noop, :verbose, :dereference_root
-    fu_output_message "cp -r#{options[:preserve] ? 'p' : ''} #{[src,dest].flatten.join ' '}" if options[:verbose]
+    fu_check_options options, :preserve, :noop, :verbose, :dereference_root, :remove_destination
+    fu_output_message "cp -r#{options[:preserve] ? 'p' : ''}#{options[:remove_destination] ? ' --remove-destination' : ''} #{[src,dest].flatten.join ' '}" if options[:verbose]
     return if options[:noop]
     options[:dereference_root] = true unless options.key?(:dereference_root)
     fu_each_src_dest(src, dest) do |s, d|
-      copy_entry s, d, options[:preserve], options[:dereference_root]
+      copy_entry s, d, options[:preserve], options[:dereference_root], options[:remove_destination]
     end
   end
   module_function :cp_r
 
-  OPT_TABLE['cp_r'] = %w( noop verbose preserve dereference_root )
+  OPT_TABLE['cp_r'] = %w( noop verbose preserve dereference_root remove_destination)
 
   #
   # Copies a file system entry +src+ to +dest+.
@@ -441,9 +441,13 @@
   #
   # If +dereference_root+ is true, this method dereference tree root.
   #
-  def copy_entry(src, dest, preserve = false, dereference_root = false)
+  # If +remove_destination+ is true, this method removes each destination file before copy.
+  #
+
+  def copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false)
     Entry_.new(src, nil, dereference_root).traverse do |ent|
       destent = Entry_.new(dest, ent.rel, false)
+      File.unlink destent.path if remove_destination && File.file?(destent.path)
       ent.copy destent.path
       ent.copy_metadata destent.path if preserve
     end
common.mk.19.patch (490 Bytes, text/x-diff)
Index: common.mk
===================================================================
RCS file: /src/ruby/common.mk,v
retrieving revision 1.23
diff -u -r1.23 common.mk
--- common.mk	7 Aug 2006 05:44:43 -0000	1.23
+++ common.mk	9 Aug 2006 17:59:45 -0000
@@ -121,8 +121,6 @@
 
 pre-install: pre-install-local pre-install-ext
 pre-install-local:: PHONY
-	$(RM) $(prefix)/lib/$(LIBRUBY)
-	$(RM) -r $(prefix)/lib/ruby/$(MAJOR).$(MINOR)/$(arch)
 pre-install-ext:: PHONY
 pre-install-doc:: PHONY
 

In This Thread