setup.rb problems and possible fix

ruby

    Next

  • 1. [ANN] regexp_parser 0.1.1
    Name: regexp_parser Summary: Scanner, lexer, and parser for ruby's regular expressions Description: (from README) What? A ruby library to help with lexing, parsing, and transforming regular expressions. - Multilayered - A scanner based on ragel - A lexer that produces a "stream" of tokens - A parser that produces a "tree" of Regexp::Expression objects (OO API) - Lexes and parses both 1.8 and 1.9 regular expression flavors - Supports ruby 1.8 and 1.9 runtime read more: https://github.com/ammar/regexp_parser/blob/v0.1.1/README.rdoc Install: gem install regexp_parser Source: https://github.com/ammar/regexp_parser * release branch: tree/master * release tag: tree/v0.1.1 Test: $ rake (test with current ruby) $ rvm rake (test with all rvm installed rubies) For an example of regexp_parser in use, see meta_re: https://github.com/ammar/meta_re Note: v0.1.0 was a test release, and was not announced. See the ChangeLog for more. Happy Hacking, Ammar

setup.rb problems and possible fix

Postby Trans » Tue, 04 Apr 2006 05:29:04 GMT

As I reported earlier there seems to be some issues with setup.rb.
After investingating deeper it appears that there may be some very odd
bugs lurking within. There's is a lot of good code in their, but I'm
starting to think it may need a fresh rewrite. Of course, it doesn't
help that Minero whas not responded to my emails, and appearnetly does
not frequent this list.

The issue I'm currently facing is that setup.rb does not seem to be
handling --prefix correctly. While most things get the prefix, the lib/
directory does not. Looking at the code one sees these relavent pieces.

  def install_dir_lib(rel)
    install_files libfiles(), "#{config('rbdir')}/#{rel}", 0644
  end

  def install_files(list, dest, mode)
    mkdir_p dest, @config.install_prefix
    list.each do |fname|
      install fname, dest, mode, @config.install_prefix
    end
  end

  def mkdir_p(dirname, prefix = nil)
    dirname = prefix + File.expand_path(dirname) if prefix
    $stderr.puts "mkdir -p #{dirname}" if verbose?
    return if no_harm?

    # Does not check '/', it's too abnormal.
    dirs = File.expand_path(dirname).split(%r<(?=/)>)
    if /\A[a-z]:\z/i =~ dirs[0]
      disk = dirs.shift
      dirs[0] = disk + dirs[0]
    end
    dirs.each_index do |idx|
      path = dirs[0..idx].join('')
      Dir.mkdir path unless File.dir?(path)
    end
  end

Looking at this code one would expect that @config.install_prefix would
hold the value of the --prefix command line option. But oddly it does
not --I'm almost inclined to think that this is unintended in itself.
But assuming that's not how it's supposed to be, then obviously
config('rbdir') must contain the prefix. But it doesn't. The other
similiar config dirs do, config('bindir'), config('datadir'), etc. But
not 'rbdir', which leads me to think that it should actually be
'libdir'.

T.

P.S. Although I've now subscribed to the RubyGems mailing list and
posted my simple solution to the datadir problem, no one has responded
whatsoever.


Re: setup.rb problems and possible fix

Postby Trans » Tue, 04 Apr 2006 10:38:25 GMT

Sigh, 'libdir' isn't right either.

Is setup.rb just not being supported any longer?

T.


Re: setup.rb problems and possible fix

Postby Erik Hollensbe » Wed, 05 Apr 2006 23:16:11 GMT

On 2006-04-02 13:29:04 -0700, "Trans" < XXXX@XXXXX.COM > said:


I have had similar troubles. Testing was added in a recent version (a 
few months ago, IIRC) and was broken. I sent him a patch and recieved 
no response.

If anyone knows a sure-fire way to get ahold of him so I know he at 
least had the opportunity to consider my patch (which I'm using in my 
own projects without trouble), I'd love to know, please privately 
contact me.

It sounds like this will end up becoming a (for lack of a better term) 
"qmail patching nightmare" unless we get some consensus on what tool to 
use or how to provide patches for it. On another note, having tools 
like this in the standard distribution (like MakeMaker is for perl) 
would really eliminate a lot of the problems.


Re: setup.rb problems and possible fix

Postby Trans » Thu, 06 Apr 2006 04:42:44 GMT

> On another note, having tools like this in the standard distribution

I agree. In fact, it never occured to me before, but why isn't setup.rb
a part of the Ruby distibution?

Well, I'm not sure what I'm going to do about it yet. I may re-write
it. The code looks more like C than Ruby and I find it difficult to
work on (I still haven't figured out where the prefix is worked-in
exactly). Have any interested in such a project?

T.


Re: setup.rb problems and possible fix

Postby Kirk Haines » Thu, 06 Apr 2006 05:02:06 GMT




Wait.  Before you rewrite it, take a look at the work that was done on 
package.rb by Mauricio Fernandez and Chris Neukirchen.  They haven't worked 
on it since late last year, but even as is, it is a very capable system.  I 
only have one released package, at the moment, that uses it, but I have 
several more in various states of progress towards new releases, and they all 
use it.  It works well, is flexible, and is terribly simple to use.  And it 
can be used in a way that is compatible with existing setup.rb uses.

The URL that I have for it is:

 http://www.**--****.com/ 


Kirk Haines



Re: setup.rb problems and possible fix

Postby Trans » Thu, 06 Apr 2006 12:21:24 GMT

Very interesting. Thanks for making me aware of this. I'm curious about
a couple of things though. I wonder about this script involved. Eg.

   Package.setup("1.0") {
     ...
   }

Is that neccessary for every project? If so, is there a minimal
default? I found the available docs/examples of this a bit confusing.
Do the commands confom to a standard repo structure? For example:

  # all .rb files under foo/ are installed under foo/ in the specified
libdir
  lib *Dir["foo/**/*.rb"]

Does that mean my repo dir /lib/foo will map to distro /lib/foo? Or
does it mean repo /foo maps to distro /lib/foo?

T.


Re: setup.rb problems and possible fix

Postby Jeff Cohen » Thu, 06 Apr 2006 13:03:10 GMT

Coming from the Windows world, this thread really interests me. 
Installing software on Windows has traditionally been a challenge; in 
recent years Microsoft started including an installation engine (Windows 
Installer) in the OS.  Then .NET promised "xcopy deployment" but that 
wasn't quite true either (except in the simplest of cases).

1. I've seen usage of setup.rb and just assumed it came with my 
one-click-installer distribution.  Until I read this thread I didn't 
think twice about it, but what exactly is/was the mission of setup.rb?

2. If we're just talking about copying files, etc. I wonder if using 
Rake would be better than an entirely new system.  Would it be possible 
to just use Rake tasks as a way to install files?

3. What happens in a Ruby setup other than copying files into the right 
folders?

4. Is there a desire/need for OS-specific setup options?  For example, 
on Windows, "good" installers place an entry in the Control Panel's 
Add/Remove list, and also probably install some shortcut icons in the 
start menu, etc.  And maybe there are similar needs on *nix and Mac?

Please pardon any stupid-sounding newbie questions here... any light 
that could be shed would be much appreciated :-)

Thanks
Jeff
www.softiesonrails.com



-- 
Posted via  http://www.**--****.com/ 



Re: setup.rb problems and possible fix

Postby Trans » Thu, 06 Apr 2006 21:15:47 GMT

Hmm... I tried out this package.rb and to be honest I'm suprised it's
working for you. It was onely after I first ran it direcly from my
project's directory, where it tired to install make beleive files like
"fuutils.rb", that this is meant to be required and used in a Rakefile
or something like that. Thankfully, it didn't actually copy anything.
But I'm not sure why --it acted like it did, there was no error. So
then I tried to "fix" it with this:

  Package.setup("1.0") {
    bin  *Dir['bin/**/*']
    lib  *Dir['lib/**/*']
    doc  *Dir['doc/**/*']
    ext  *Dir['ext/**/*']
    data *Dir['data/**/*']
    conf *Dir['conf/**/*']
  }

Which seems like must be the basic minimal. Well, trying that it goes
to install files in all the wrong places. First line:

  mkdir -p /usr/local/lib/site_ruby/1.8/lib/reap

Notice the extra lib/ dir right before my project's name. It did this
with every directory. Thankfully, it again did not actually install
anything --so I count my lucky stars.

At this point I'm missing the whol "easy to use" part. :-(

BTW, I see in the --help that it has a --destdir option, which is
exactly what I wish setup.rb had.


Re: setup.rb problems and possible fix

Postby Trans » Thu, 06 Apr 2006 21:35:02 GMT




You've got that right. In my experience I've had to use a commerical
program like InstallShield to create a proper Windows install. Now I've
never tried it with Ruby, so I have no idea where Ruby libs ought to go
in a Windows system, but I assume it relects the unix layout, just
stored somewhere under Programs/ruby, or something like that.


Hmm... well, setup.rb allows one to manually install a program/library.
You download the archive, unpack it, cd into it, and type 'ruby
setup.rb'. Done. But honestly I have no idea if setup.rb works with
Windows. I assume it does b/c it depend on ruby's own install setup
--but that's fully an assumption on my part.


You could, you could even write your own stand-alone script, and many
have. But that's a limited solution. Setup.rb takes into account many
factors. It looks at your current installation to figure out where to
put things by default. It also compiles extensions. And it allows you
to set command line options to adjust those.


Besides compiling extensions, nothing.


Which is exactly why for Windows a good installer is generally a
commercial application like Installshield. In the long run I am working
on targeting specific OSes. Windows will no doubt be a substantial
challenge.


Not stupid at all. It can be complicated.

T.


Re: setup.rb problems and possible fix

Postby Erik Hollensbe » Tue, 11 Apr 2006 06:17:43 GMT

On 2006-04-04 12:42:44 -0700, "Trans" < XXXX@XXXXX.COM > said:


I would be happy to work with you on this, or get setup.rb to a point 
where it's in a managable state with multiple contributors/maintainers 
so handling patches wouldn't be an issue.

I like the simplicity of setup.rb, and the discussion of package.rb 
leaves me wondering whether working with that would be worth it.



Re: setup.rb problems and possible fix

Postby Trans » Tue, 11 Apr 2006 07:59:35 GMT





I too was leaning toward cleaning up setup.rb at first, but after
hacking on it and looking a package.rb again I've decided Kirk Haines
has the right idea.

While package.rb still needs improvement to be a little easier to use
and to catch up to the capabilites of setup.rb, it is not far off, plus
it does things that setup.rb cannot, and importantly the code is
reasonably well written and maintainable.

I've been in contact with Christian Neukirchen, (one of) the original
author(s), and Kirk Haines who said he plans to continue with it's
developent soon. (Christian said he didn't have the time but asks we
submit patches back to him.)

So what about taking a closer look a package.rb and see if you'd like
to work with us on improving it?

Thanks,
T.


Re: setup.rb problems and possible fix

Postby Erik Hollensbe » Tue, 11 Apr 2006 13:09:31 GMT

On 2006-04-09 15:59:35 -0700, "Trans" < XXXX@XXXXX.COM > said:




Sounds like a great idea. I'll contact you off-list when I have some 
time to get geared up (this is going to be a busy week for me), if you 
don't mind.

-- 
Erik Hollensbe
 XXXX@XXXXX.COM 


Similar Threads:

1.Linux protocol.rb and smtp.rb problem[FIXED]

The problem had to due to line endings. On a Windows machine it appears that
the protocol.rb file allows you to pass in parameters with a CRLF on the
end. It works! On a Linux machine it didn't.

Solution: I 'chomp'ed the line endings off.

Zach


2.[ANN] Ruby Setup 5 (setup.rb)

3.Problems with setup.rb and metaconfig

4.GEM install problem using setup.rb

5.Package, a future replacement for setup.rb and mkmf.rb

6. Compiling Ruby on OSX, OpenSSL error and possible fix

7. Build crash of preview3 on alpha/osf5.1 AND POSSIBLE FIX

8. setup.rb question



Return to ruby

 

Who is online

Users browsing this forum: No registered users and 19 guest