
Apt: please make the moo reproducible - teddyh
https://bugs.debian.org/848721
======
smcl
Took me a while (after reading through the reply, to no avail) to figure out
what this refers to. Here's the feature this is referring to:

    
    
         $ apt-get moo
                         (__) 
                         (oo) 
                   /------\/ 
                  / |    ||   
                 *  /\---/\ 
                    ~~   ~~   
        ..."Have you mooed today?"...
    

Edit: maybe not actually! Just found this too:

    
    
        $ aptitude moo
        There are no Easter Eggs in this program.
        $ aptitude -v moo
        There really are no Easter Eggs in this program.

~~~
simias
I don't really understand what in this feature makes the build non-
reproducible. Judging by the patch it's the call to time(NULL) that seems to
be problematic, but I don't understand why.

~~~
kr7
The output of "apt-get moo" changes on special days (4/1, 12/25, 8/16, 11/7,
2/18). So if another program was using "apt-get moo" in its build script, the
build would not be reproducible. With the patch, the SOURCE_DATE_EPOCH
environment variable can be set to make "apt-get moo" deterministic.

I don't think anything actually uses "apt-get moo" in its build script.

This kind of patch makes more sense for build tools like "ar" (static library
creator). By default, "ar" injects a timestamp into the output file, so the
binary is different each build. But, use the "D" flag and "ar" becomes
deterministic.

~~~
rzzzt
The time-dependent part can be seen here:
[https://github.com/Debian/apt/blob/master/apt-
private/privat...](https://github.com/Debian/apt/blob/master/apt-
private/private-moo.cc#L164)

~~~
kr7
There is a second part above too:

[https://github.com/Debian/apt/blob/master/apt-
private/privat...](https://github.com/Debian/apt/blob/master/apt-
private/private-moo.cc#L33)

------
Piskvorrr
Hilarious, yes. Except this: "The followers advice is dropping the curly
brackets for these one-line ifs to make them all happy."

Did I just read a code review advocating for #gotofail, just to avoid a minor
formatting nitpick?

~~~
omginternets
What exactly is the risk here?

~~~
stonemetal
Here? Not much but as a style choice it is what lead to an SSL bug in iOS.

[https://www.imperialviolet.org/2014/02/22/applebug.html](https://www.imperialviolet.org/2014/02/22/applebug.html)

------
the_duke
David Kalnischkies response is the most hilarious code review I've ever read.

~~~
ja30278
It's quite funny, but..

" The followers advice is dropping the curly brackets for these one-line ifs
to make them all happy. "

I have never understood why anyone would do this. It's a bug waiting to happen
(as goto fail showed), for truly marginal benefit

    
    
        if (foo)
          bar();
    
        if (foo) { 
          bar();
        }

~~~
__david__
Because one takes an extra line. For something that's effectively an error
condition. There's so reason errors should take up so much vertical code space
(which is at a premium even today, given how wide monitors are). This is one
of my primary quibbles with golang, and why I will never give in to the
community's slavish devotion to "go fmt @

~~~
nitrogen
Try rotating your screen 90 degrees.

~~~
chris_wot
Do you know how weird that makes me look when I'm coding on my laptop at the
airport?

~~~
nitrogen
No doubt it's quite weird, but I am of the opinion that hardware should serve
the code and coder, not the other way around. Maybe use a portrait orientation
tablet with a bt keyboard for travel. I think there could be a small market
for laptops with a portrait mode, too.

------
dabber
Related bug:

[https://bugs.launchpad.net/ubuntu/+source/apt/+bug/56125](https://bugs.launchpad.net/ubuntu/+source/apt/+bug/56125)

~~~
jordigh
I am sad that my contribution to this bug has been dropped from Debian:

[https://bugs.debian.org/cgi-
bin/bugreport.cgi?bug=413725](https://bugs.debian.org/cgi-
bin/bugreport.cgi?bug=413725)

------
syassami
apt-get install cowsay - for all your mooing desires.

~~~
fennecfoxen
fortune | cowsay | lolcat

------
pksadiq
There is also:

    
    
      ip moo

~~~
kworker
PETA approved.

------
hellofunk
Can I just say.. Holy cow!

