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

ruby-changes:51338

From: knu <ko1@a...>
Date: Fri, 1 Jun 2018 16:13:43 +0900 (JST)
Subject: [ruby-changes:51338] knu:r63544 (trunk): Skip colliding filenames in LIBRUBY_ALIASES

knu	2018-06-01 16:13:38 +0900 (Fri, 01 Jun 2018)

  New Revision: 63544

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63544

  Log:
    Skip colliding filenames in LIBRUBY_ALIASES
    
    This allows user to specify any name in `--with-so-name` that might
    cause a name clash with LIBRUBY_ALIASES on the platform.
    
    Without this, for example, configuring with `--with-soname=ruby
    --enable-shared` on macOS would end up running `ln -sf libruby.dylib
    libruby.dylib` only to fail with the following error in installation:
    
    ```
    make[2]: stat: libruby.dylib: Too many levels of symbolic links
    ```

  Modified files:
    trunk/Makefile.in
    trunk/tool/rbinstall.rb
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 63543)
+++ Makefile.in	(revision 63544)
@@ -272,9 +272,9 @@ $(LIBRUBY_SO): https://github.com/ruby/ruby/blob/trunk/Makefile.in#L272
 		-$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)ruby_static_id_*' \
 			-L '$(SYMBOL_PREFIX)*_threadptr_*' -L '$(SYMBOL_PREFIX)*_ec_*' $@
 		$(Q) $(POSTLINK)
-		@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link rescue nil; \
-						  File.symlink "$(LIBRUBY_SO)", link}' \
-				$(LIBRUBY_ALIASES) || true
+		@-$(MINIRUBY) -e 'so, *aliases = ARGV; aliases.uniq!; aliases.delete(File.basename(so)); \
+				  aliases.each { |link| File.delete link rescue nil; File.symlink so, link }' \
+				$(LIBRUBY_SO) $(LIBRUBY_ALIASES) || true
 
 LIBRUBY_WITH_EXT = @LIBRUBY_WITH_EXT@
 $(LIBRUBY_$(LIBRUBY_WITH_EXT)): $(LIBRUBY_SO_UPDATE)
Index: tool/rbinstall.rb
===================================================================
--- tool/rbinstall.rb	(revision 63543)
+++ tool/rbinstall.rb	(revision 63544)
@@ -360,7 +360,7 @@ install?(:local, :arch, :lib, :'lib-arch https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L360
   install lib, libdir, :mode => $prog_mode, :strip => $strip unless lib == arc
   install arc, libdir, :mode => $data_mode unless CONFIG["INSTALL_STATIC_LIBRARY"] == "no"
   if dll == lib and dll != arc
-    for link in CONFIG["LIBRUBY_ALIASES"].split
+    for link in CONFIG["LIBRUBY_ALIASES"].split - [File.basename(dll)]
       ln_sf(dll, File.join(libdir, link))
     end
   end

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

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