Bug 3032 - (int-167483) missing diff utility (required by the GNU Coding Standards)
(int-167483)
: missing diff utility (required by the GNU Coding Standards)
Status: RESOLVED FIXED
Product: Core
Busybox
: 5.0/(3.2010.02-8)
: N810 Maemo
: Low enhancement with 14 votes (vote)
: Harmattan
Assigned To: unassigned
: busybox-bugs
:
:
:
:
  Show dependency tree
 
Reported: 2008-03-20 02:08 UTC by Vincent Lefevre
Modified: 2010-11-22 14:33 UTC (History)
9 users (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description Vincent Lefevre (reporter) 2008-03-20 02:08:51 UTC
SOFTWARE VERSION:
OS2008 / 2.2007.50-2

The diff utility (required by the GNU Coding Standards) is missing. It isn't
even tested by configure scripts generated by autoconf, which give a misleading
error message (in my case, a problem with the grep utility, though grep works
fine). I've reported the problem to bug-autoconf, but got a reply saying that
this won't be fixed on the autoconf side as a system with a missing diff is
broken. Hence this bug report.

Development packages, such as make, also assume that diff is provided as
standard by the system since they don't depend on a package that provides diff
(and I couldn't find any such package for OS2008 anyway).
Comment 1 Haibo Li 2008-08-26 09:13:35 UTC
You can upgrade the busybox to the latest version(1.11.1).Then you can use diff
script.
Comment 2 Vincent Lefevre (reporter) 2008-08-26 12:25:31 UTC
But this isn't the latest official version (from Nokia's repositories) for
OS2008.
Comment 3 Haibo Li 2008-09-11 07:26:40 UTC
> -----Original Message-----
> From: maemo-developers-bounces@maemo.org
> [mailto:maemo-developers-bounces@maemo.org] On Behalf Of Andre Klapper
> Sent: Thursday, August 14, 2008 5:22 PM
> To: maemo-developers@maemo.org
> Subject: RE: Qemu Error on Maemo
> 
> Am Donnerstag, den 14.08.2008, 12:10 +0300 schrieb Wei Zhou:
> > Little out of topic, busybox in diablo image is  1.6.1,
> while the latest
> > one is 1.11.x, does Nokia plan to upgrade this?
> 
> An updated version of Busybox will be shipped for Fremantle (the next 
> major release).
> 
> andre
> --
> Andre Klapper (maemo.org bugmaster)
> 
> _______________________________________________
> maemo-developers mailing list
> maemo-developers@maemo.org
> https://lists.maemo.org/mailman/listinfo/maemo-developers
> 

What's more, I can supply a way to use the diff script at present version, but
it not the best way to solve this bug.
1. Download the newest version busybox.( busybox-1.11.1.tar.gz) Compile and
install it in scratchbox.
2. Create a symbolic link with busybox 
 [sbox-CHINOOK_ARMEL: ~/application/busybox-1.11.1] >ln –s busybox diff 
3. Then copy diff to N810’s /usr/bin/ directory.
Comment 4 Vincent Lefevre (reporter) 2008-09-11 10:46:50 UTC
(In reply to comment #3)
> What's more, I can supply a way to use the diff script at present version, but
> it not the best way to solve this bug.
> 1. Download the newest version busybox.( busybox-1.11.1.tar.gz) Compile and
> install it in scratchbox.
> 2. Create a symbolic link with busybox 
>  [sbox-CHINOOK_ARMEL: ~/application/busybox-1.11.1] >ln –s busybox diff 
> 3. Then copy diff to N810’s /usr/bin/ directory.

That's really bad because /usr/bin/diff would not be part of any package,
meaning possible upgrade failures later (and I don't have scratchbox).

Recompiling GNU diff from upstream (directly on the N810) was much simpler (and
I have a better diff).
Comment 5 Haibo Li 2008-09-11 10:53:35 UTC
(In reply to comment #4)

> Recompiling GNU diff from upstream (directly on the N810) was much simpler (and
> I have a better diff).

Can you share your experience?
Comment 6 Vincent Lefevre (reporter) 2008-09-11 11:31:57 UTC
(In reply to comment #5)
> Can you share your experience?

This was several months ago. But I got the tarball here:
ftp://ftp.gnu.org/gnu/diffutils/diffutils-2.8.1.tar.gz

Then I did:
$ ./configure --prefix=/media/mmc3/opt/diffutils
$ make
$ sudo gainroot
# make install

Note: you need some packages, like gcc and make. You can choose whatever you
want for prefix, but it mustn't be a vfat file system (you just need to update
$PATH in your .profile). In my case, I repartitioned the internal card as I
explained here: http://www.vinc17.org/maemo/
Comment 7 Haibo Li 2008-09-11 12:37:34 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Can you share your experience?
> This was several months ago. But I got the tarball here:
> ftp://ftp.gnu.org/gnu/diffutils/diffutils-2.8.1.tar.gz
> Then I did:
> $ ./configure --prefix=/media/mmc3/opt/diffutils
> $ make
> $ sudo gainroot
> # make install
> Note: you need some packages, like gcc and make. You can choose whatever you
> want for prefix, but it mustn't be a vfat file system (you just need to update
> $PATH in your .profile). In my case, I repartitioned the internal card as I
> explained here: http://www.vinc17.org/maemo/

That sounds this bug has fixed.
Comment 8 Andre Klapper maemo.org 2008-09-15 17:53:16 UTC
There will be an updated version of busybox for Fremantle.
Comment 9 Quim Gil nokia 2008-11-26 13:17:05 UTC
Eero, can you please tell whether this is being addressed in Fremantle? Thanks.
Comment 10 Eero Tamminen nokia 2008-11-26 13:42:43 UTC
(In reply to comment #0)
> The diff utility (required by the GNU Coding Standards) is missing.
> It isn't even tested by configure scripts generated by autoconf, which
> give a misleading error message (in my case, a problem with the grep
> utility, though grep works fine).

We have diff in the SDK environment. Building packages is supported only in
SDK, not on the device.  Diff isn't pre-installed on the device. 

The current Maemo packaging policy states that packages should declare
dependencies to things they depend from unless they're in the list of Maemo
essentials.  Diff isn't i.e. strictly speaking device packages using diff but
not declaring dependency to it are broken according to the packaging policy.


> Development packages, such as make also assume that diff is provided

Source package for make?

Note: packages in the SDK repository aren't intended to be compatible /
installed to the device currently, this is target for later releases.


> I've reported the problem to bug-autoconf, but got a reply saying that
> this won't be fixed on the autoconf side as a system with a missing diff
> is broken. Hence this bug report.

Diff is included into POSIX standard commands and is an essential utility in
all distros, that's why upstream is unwilling to change this.  It's a bit silly
though that they claim such a setup not even worth a check when autotools have
special code for systems which shell doesn't implement functions (this is the
reason why configure scripts are so huge and ugly).


(In reply to comment #1)
> You can upgrade the busybox to the latest version(1.11.1).Then you can use diff script.

Even Diablo Busybox source package could provide diff, but it's lacking a lot
of Desktop diff features/options and not currently used by anything in the
device.


(In reply to comment #9)
> Eero, can you please tell whether this is being addressed in Fremantle? 

Whether it will be enabled in Fremantle is open.
Comment 11 Andre Klapper maemo.org 2009-06-19 20:11:05 UTC
diff isn't pre-installed in current Fremantle. Updating version info.
Comment 12 Jeff Moe 2009-12-04 00:03:07 UTC
It wouldn't be so bad if busybox didn't provide diff as long as the package
didn't say it *did* provide diff...

# apt-get install diff
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting busybox instead of diff
busybox is already the newest version.


This seems like a no-brainer, I don't see the difficulty. Either:
1) enable diff in the busybox build
or
2) Don't have busybox .deb say that it provides diff so "regular" diff could be
installed.

Also, this bug probably shouldn't be an "Enhancement", since something is
broken. It's not asking for a new feature.

Version could be bumped to 5.0/(1.2009.42-11) but I don't have perms. Thanks!
:)
Comment 13 Eero Tamminen nokia 2009-12-04 18:09:57 UTC
(In reply to comment #12)
> It wouldn't be so bad if busybox didn't provide diff as long as the package
> didn't say it *did* provide diff...
> This seems like a no-brainer, I don't see the difficulty. Either:
> 1) enable diff in the busybox build

Busybox isn't very compatible with normal Debian diff at least based on options
that it supports (according to busybox.net), so I'm not sure how much this
would help.  Have you tested it?


> 2) Don't have busybox .deb say that it provides diff so "regular"
> diff could be installed.

Busybox provides "cmp" which is in Debian "diff" package. Even without
Provides/Replaces/Conflicts in Busybox package control file, things would still
conflict at installation time.

Best is probably to do a separate symlink package for things corresponding to
Debian "diff" package instead of including them directly to the Busybox package
itself.  Then it's at least trivially replaceable with real "diff" package
(that has diff and other things in addition to "cmp").

I added NB#149566 for that.
Comment 14 Jeff Moe 2009-12-18 02:20:04 UTC
Ok, not having diff on the device was driving me crazy when trying to debug and
set things up. Then I had a "duh" moment and thought "why not just rename the
binaries?". Brace yourselves....I now present you: diffmo!!!


diff, diff3, sdiff, and cmp binaries renamed to diffmo, diff3mo, sdiffmo, and
cmpmo.  :)

Currently residing in extras-devel:
http://maemo.org/packages/view/diffmo/

Happy diffing!
Comment 15 Eero Tamminen nokia 2009-12-18 14:58:34 UTC
(In reply to comment #14)
> Ok, not having diff on the device was driving me crazy when trying to debug
> and set things up. Then I had a "duh" moment and thought "why not just rename
> the binaries?". Brace yourselves....I now present you: diffmo!!!
>
> diff, diff3, sdiff, and cmp binaries renamed to diffmo, diff3mo, sdiffmo, and
> cmpmo.  :)

Easier solution would probably be just to:
- remove 'cmp' from Debian diff package
- rename the package to "diff-without-cmp"

After that it would work fine I think.
Comment 16 Eero Tamminen nokia 2009-12-18 14:59:25 UTC
(In reply to comment #15)
> Easier solution would probably be just to:
> - remove 'cmp' from Debian diff package
> - rename the package to "diff-without-cmp"

+ state in debian/control file that this binary package conflicts with "diff".
Comment 17 Jeff Moe 2009-12-18 15:46:36 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > Ok, not having diff on the device was driving me crazy when trying to debug
> > and set things up. Then I had a "duh" moment and thought "why not just rename
> > the binaries?". Brace yourselves....I now present you: diffmo!!!
> >
> > diff, diff3, sdiff, and cmp binaries renamed to diffmo, diff3mo, sdiffmo, and
> > cmpmo.  :)
> 
> Easier solution would probably be just to:
> - remove 'cmp' from Debian diff package
> - rename the package to "diff-without-cmp"
> 
> After that it would work fine I think.

Well, this is the easier solution because it is already done. Plus this way we
get GNU cmp as well. Also, if future builds of busybox include diff, it won't
collide. This is definitely just meant to be an interim solution until Maemo
comes with some sort of diff and this bug is resolved.

Thanks. :)
Comment 18 Andre Klapper maemo.org 2009-12-29 15:01:21 UTC
*** Bug 7437 has been marked as a duplicate of this bug. ***
Comment 19 Thomas Tanner 2010-03-27 10:56:46 UTC
There's an alternative GNU diffutils package in extras-testing
http://maemo.org/packages/view/diffutils-gnu/
that provides all tools both with their original name in /usr/bin/gnu
and with the prefix g* (gdiff etc).
Comment 20 Matheus Izvekov 2010-05-06 05:19:15 UTC
Busybox since version 1.16.0 includes a new diff applet which should support
all the important flags, and closely match the behavior of gnu diff while at
it.
Please let me know if any important functionality is still missing.
Comment 21 Eero Tamminen nokia 2010-05-06 10:40:27 UTC
(In reply to comment #20)
> Busybox since version 1.16.0 includes a new diff applet which should support
> all the important flags, and closely match the behavior of gnu diff while at
> it.
> Please let me know if any important functionality is still missing.

Thanks for the info!

Andre, could you import this to Harmattan?
Comment 22 Andre Klapper maemo.org 2010-05-06 16:43:34 UTC
Done.
Comment 23 Eero Tamminen nokia 2010-05-10 13:18:15 UTC
Apparently Harmattan has BB v1.15 with diff enabled.
-> TM = Harmattan.

(In reply to comment #20)
> Busybox since version 1.16.0 includes a new diff applet which should support
> all the important flags, and closely match the behavior of gnu diff while at
> it.

Thanks!  How bad the diff version in BB v1.15 is compatibility wise?

I've asked about whether BB could still be updated to v1.16 (BB updates have
always been a hassle, so it would be good to know how much can be gained by the
update).
Comment 24 Matheus Izvekov 2010-05-10 14:19:14 UTC
(In reply to comment #23)
> Apparently Harmattan has BB v1.15 with diff enabled.
> -> TM = Harmattan.
> 
> (In reply to comment #20)
> > Busybox since version 1.16.0 includes a new diff applet which should support
> > all the important flags, and closely match the behavior of gnu diff while at
> > it.
> 
> Thanks!  How bad the diff version in BB v1.15 is compatibility wise?
> 
> I've asked about whether BB could still be updated to v1.16 (BB updates have
> always been a hassle, so it would be good to know how much can be gained by the
> update).
> 

Well, there were lots of issues. If you used it without any flags, it worked
ok, in which case I just remember one segfault scenario on some architectures
(there was a patch posted for this, but I don' t know if it went upstream for
stable inclusion).
Otherwise, there were several issues with flags -b and -w, -q did not work
correctly in some situations, and the fact that it didn't support -i and -B at
all.

It should be really straightforward to port the new diff to 1.15. If you are
lazy, just dropping diff.c in place should work.
But I guess I should encourage you to try 1.16, and to report us any issues you
find. We would really appreciate it, even if you are not committed to using it
anytime soon.
Comment 25 Eero Tamminen nokia 2010-05-10 15:34:01 UTC
Thanks for the info!

I think it's a while until our current Harmattan Busybox maintainer will have
time to look into possible issues with the upgrade, hopefully it's before the
summer vacations here. :-)
Comment 26 Andre Klapper maemo.org 2010-05-18 13:53:09 UTC
Currently BusyBox 1.15.3 is planned for Harmattan which provides diff.
Hence closing as FIXED in Harmattan.
Comment 27 Andre Klapper maemo.org 2010-11-22 14:33:00 UTC
*** Bug 11607 has been marked as a duplicate of this bug. ***