Hurd and ruby 1.8preview2

Hello,

i have compiled ruby 1.8preview2 on Hurd.

This is what i have change:

— ruby-1.8.0_org/ext/dl/extconf.rb 2003-03-24 22:11:12.000000000 +0100
+++ ruby-1.8.0/ext/dl/extconf.rb 2003-03-24 22:11:10.000000000 +0100
@@ -151,7 +151,7 @@

def File.update(file, str)
begin

  • open(file){|f|f.read} == str
  • open(file,File::CREAT|File::TRUNC|File::RDWR, 0644){|f|f.read} == str
    rescue Errno::ENOENT
    false
    end or open(file, “w”){|f|f.print(str)}

— ruby-1.8.0_org/lib/fileutils.rb 2003-02-27 09:02:31.000000000 +0100
+++ ruby-1.8.0/lib/fileutils.rb 2003-03-24 22:03:54.000000000 +0100
@@ -627,11 +627,11 @@
return if noop

 fu_each_src_dest(src, dest) do |s,d|
  •  unless FileTest.exist? d and cmp(s,d)
    
  •    remove_file d, true
    
  •  #unless FileTest.exist? d and cmp(s,d)
    
  •  #  remove_file d, true
       copy_file s, d
       File.chmod mode, d if mode
    
  •  end
    
  •  #end
    
    end
    end

Regards Manfred

Hi,

i have compiled ruby 1.8preview2 on Hurd.

This is what i have change:

What trouble did you have exactly?

  • open(file){|f|f.read} == str
  • open(file,File::CREAT|File::TRUNC|File::RDWR, 0644){|f|f.read} == str

File::TRUNC means making opened file empty. This modification
doesn’t seem correct.

  •  unless FileTest.exist? d and cmp(s,d)
    
  •    remove_file d, true
    
  •  #unless FileTest.exist? d and cmp(s,d)
    
  •  #  remove_file d, true
       copy_file s, d
       File.chmod mode, d if mode
    
  •  end
    
  •  #end
    

Ditto. File operations don’t work at all?

···

At Thu, 27 Mar 2003 03:09:06 +0900, Manfred Hansen wrote:


Nobu Nakada

Hi,

the ruby-1.8.0/ext/dl/extconf.rb didn’t make the makefile.

ruby-1.8.0/lib/fileutils.rb was necessary by “make install” because
there didn’t copy any files to the directory.

I try to emulate the error from extconf.rb .
This example didn’t run on GNU/Hurd but on Linux (Suse).

!/usr/local/bin/ruby

def File.update(file, str)
begin
open(file){|f|f.read} == str
# open(file,File::CREAT|File::TRUNC|File::RDWR, 0644){|f|f.read} == str
rescue Errno::ENOENT
false
end or open(file, “w”){|f|f.print(str)}
end

File.update(“dlconfig.h”, <<EOF)
#ifndef DLCONFIG_H
#define DLCONFIG_H
#{$dlconfig_h}
#endif /* DLCONFIG_H */
EOF

Here are the first error massage from make:

/home/hansen/ruby-1.8.0/ext/dl/extconf.rb:154:in initialize': No such file or directory - "dlconfig.h" (Errno::ENOENT) from /home/hansen/ruby-1.8.0/ext/dl/extconf.rb:154:in open’
from /home/hansen/ruby-1.8.0/ext/dl/extconf.rb:154:in update' from /home/hansen/ruby-1.8.0/ext/dl/extconf.rb:163 from ./ext/extmk.rb:78:in load’
from ./ext/extmk.rb:78:in extmake' from ./ext/extmk.rb:220 from ./ext/extmk.rb:217:in glob’
from ./ext/extmk.rb:217
make: *** [all] Error 1

The second error by fileutils.rb:

hurd:/home/hansen/ruby-1.8.0# make install
…/miniruby ./instruby.rb --dest-dir=“” --make=“make” --mflags=“”
–make-flags=“” --mantype=“doc”
install -c -m 0755 ruby /usr/local/bin/ruby
/home/hansen/ruby-1.8.0/lib/fileutils.rb:554:in chmod': No such file or directory - "/usr/local/bin/ruby" (Errno::ENOENT) from /home/hansen/ruby-1.8.0/lib/fileutils.rb:554:in remove_file’
from /home/hansen/ruby-1.8.0/lib/fileutils.rb:631:in install' from /home/hansen/ruby-1.8.0/lib/fileutils.rb:629:in fu_each_src_dest’
from /home/hansen/ruby-1.8.0/lib/fileutils.rb:629:in install' from ./instruby.rb:58:in install’
from ./instruby.rb:58:in `install’
from ./instruby.rb:98
make: *** [install] Error 1

Regards Manfred

···

nobu.nokada@softhome.net wrote:

Hi,

At Thu, 27 Mar 2003 03:09:06 +0900, > Manfred Hansen wrote:

i have compiled ruby 1.8preview2 on Hurd.

This is what i have change:

What trouble did you have exactly?

  • open(file){|f|f.read} == str
  • open(file,File::CREAT|File::TRUNC|File::RDWR, 0644){|f|f.read} ==
    str

File::TRUNC means making opened file empty. This modification
doesn’t seem correct.

  •  unless FileTest.exist? d and cmp(s,d)
    
  •    remove_file d, true
    
  •  #unless FileTest.exist? d and cmp(s,d)
    
  •  #  remove_file d, true
       copy_file s, d
       File.chmod mode, d if mode
    
  •  end
    
  •  #end
    

Ditto. File operations don’t work at all?

Hi,

Here are the first error massage from make:

/home/hansen/ruby-1.8.0/ext/dl/extconf.rb:154:in `initialize’: No such file
or directory - “dlconfig.h” (Errno::ENOENT)

This exception should be rescued.

The second error by fileutils.rb:

hurd:/home/hansen/ruby-1.8.0# make install
…/miniruby ./instruby.rb --dest-dir=“” --make=“make” --mflags=“”
–make-flags=“” --mantype=“doc”
install -c -m 0755 ruby /usr/local/bin/ruby
/home/hansen/ruby-1.8.0/lib/fileutils.rb:554:in `chmod’: No such file or
directory - “/usr/local/bin/ruby” (Errno::ENOENT)

remove_files checks ENOENT, so this exception shouldn’t be
raised here (unless race condition). Seems Errno::ENOENT
couldn’t be handled properly.

What happens with followings?

begin
raise Errno::ENOENT, “test1”
rescue
p $!
end
begin
raise Errno::ENOENT, “test2”
rescue SystemCallError
p $!
end
begin
raise Errno::ENOENT, “test3”
rescue Errno::ENOENT
p $!
end

···

At Thu, 27 Mar 2003 05:09:33 +0900, Manfred Hansen wrote:


Nobu Nakada

Hi,

here is the output from your example.

#<Errno::ENOENT: test1>
#<Errno::ENOENT: test2>
#<Errno::ENOENT: test3>

I hope this help you.

Regards Manfred

···

remove_files checks ENOENT, so this exception shouldn’t be
raised here (unless race condition). Seems Errno::ENOENT
couldn’t be handled properly.

What happens with followings?

begin
raise Errno::ENOENT, “test1”
rescue
p $!
end
begin
raise Errno::ENOENT, “test2”
rescue SystemCallError
p $!
end
begin
raise Errno::ENOENT, “test3”
rescue Errno::ENOENT
p $!
end