[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bootstrapping SED-4.5, circular dependency?
From: |
Jan Nieuwenhuizen |
Subject: |
Re: bootstrapping SED-4.5, circular dependency? |
Date: |
Sun, 09 Dec 2018 04:52:35 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Assaf Gordon writes:
Hello Assaf,
> Technically speaking, these kind of dependencies (e.g. needing SED
> to build a package) arise from autotools, not directly from sed's
> build commands.
Ah yes, course. That is a big difference.
>> Here is what I get:
> [...]
>> ERROR: In procedure scm-error:
>> SED: command not supported: "/^.*\\/\\([^/][^/]*\\)\\/*$/{\n\t
>> s//\\1/\n\t q\n\t }\n\t /^X\\/\\(\\/\\/\\)$/{\n\t s//\\1/\n\t
>> q\n\t }\n\t /^X\\/\\(\\/\\).*/{\n\t s//\\1/\n\t q\n\t }\n\t
>> s/.*/./; q"
>
> The failed sed program is (transcribed from the above error message)
> ====
> /^.*\/\([^/][^/]*\)\/*$/{
> s//\1/
> q
> }
> /^X\/\(\/\/\)$/{
> s//\1/
> q
> }
> /^X\/\(\/\).*/{
> s//\1/
> q
> }
> s/.*/./; q
> ====
>
> It is a very standard sed program, which should (and does) work on every
> existing SED implementation (posix-compliant of course).
Right, now I see. I really only catered for plain `-e s,,,' commands.
> I would recommend adjusting your sed implementation to support
> these commands, because you'll encounter them in many packages
> that use autotools.
That's sounds like the right thing to do, thanks!
> Digging a bit further, I see this specific sed program originates
> from autoconf, from the M4 code used to implement basename and dirname,
> e.g. here:
> https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/m4sugar/m4sh.m4#n922
> https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/m4sugar/m4sh.m4#n970
>
> So it means every autotools package that uses these macros (and there
> are many) will cause the same issue.
>
> The best solution is likely to implement these sed commands in your
> sed implementation (if you need help in testing I'm happy to try,
> though I know very little about guile).
That is even more helpful! While I still think we should support the
simple SED script above, there could be a problem with basename/dirname.
Solving that might even sidestep this SED feature. Many options now!
> As a last resort, I can think of a really ugly hack:
> create a "fake sed" wrapper script in guile,
> that checks if the given SED script is one that you don't implement
> (e.g. the one above). If it is, since we know all it does is
> basename/dirname - just call a real dirname/basename instead of
> using sed's regexes. Otherwise, pass the parameters to the real
> guile-sed.
> Put this guile-sed-wrapper in $PATH, and it might just work...
>
>
> In a completely different approach, since you are trying to bootstrap:
> building OpenBSD's sed binary is very easy (needs just a C compiler
> and works fine on GNU/Linux) - perhaps building it
> would be faster as a first step to get a working sed, then use it
> to build other packages (I can help with that if you want, send me an
> email).
Many thanks, also for these two last resort options! I'm sure we'll
manage to bootstrap SED. I'll let you know how it goes.
Greetings,
janneke
--
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com