Bug #38

need replacement for tr

Added by Garrett D'Amore over 10 years ago. Updated over 10 years ago.

Start date:
Due date:
% Done:


Estimated time:
3.00 h
Gerrit CR:


A suitable replacement for "tr" is required to facilitate the build, as the closed one does not link due to use of a private symbol in libc_i18n (one that we lack).

tr is necessary to get to self hosting, so this is very urgent.


tr.tgz (12.5 KB) tr.tgz Paul Armstrong, 2010-08-14 04:08 PM
tr (26.5 KB) tr Paul Armstrong, 2010-08-18 09:21 AM

Updated by Paul Armstrong over 10 years ago

Here's a port of FreeBSDs tr.

I've included a Makefile that should work if dropped into the tree (I haven't got a full illumos build environment up yet) and a Makefile.localbuild so you can get a binary quickly.


Updated by Garrett D'Amore over 10 years ago

  • Assignee set to Garrett D'Amore

I'm importing this from fbsd. There are some changes required in libc as well.


Updated by Paul Armstrong over 10 years ago

x86 tr binary from my build


Updated by Garrett D'Amore over 10 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
  • Estimated time set to 3.00 h

tr is now integrated.


Updated by Gary Mills over 10 years ago

I agree with all parties concerned here. The `tr' that was integrated
into illumos was an expedient solution that got the system working
but introduced bugs, some of them still unknown. It's an example
of the conflict between availability and quality. We need to strive
for both, but getting the system working should have priority, at
least in the short term.

Is there a way to mark this integration as a temporary fix, so that
it can be replaced by a better quality fix? Until we have a
comprehensive test suite, we won't even know when we have a
correct version of `tr'.


Updated by Garrett D'Amore over 10 years ago

I'm not aware of any such way. I think we can all agree that this was an expedient solution to the problem... and I'm willing to set aside the current implementation if a better one is available.

So far it looks like the current implementation has some bugs that we now are starting to understand, and that might not be the same bugs in the upstream FreeBSD -- so they may have been introduced by my porting effort, or by the underlying library.

Whether the quickest solution to solving those is to diagnose and fix the bugs here, or to switch to a different implementation is not entirely clear to me. I confess that I'd prefer to understand what the bugs are, if only so that we can fix them if they are in the underlying C library. (Switching out the C library is not on the table.)


Updated by Gary Mills over 10 years ago

In that case, I'd recommend a new bug report be opened.
I see that there already is one relating to certain scripts, but
a more general one might be better.


Updated by Garrett D'Amore over 10 years ago

Issue 132 has been opened for the specific regression, and I think we now have a solution. (I screwed it up.)

If there are other issues known, then please do file a bug.

We need a regression test for this stuff.

Also available in: Atom PDF