minor fixes for make dist

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

minor fixes for make dist

Dimitrios Apostolou
Hello list,

attached is a patch that addresses several minor issues - in my
opinion - of make dist.

First, it removes the special flags used for the compressors. Why?
Because:
: xz -e
unreasonably slow for little to no benefit
: bzip2 -9
is the default, no need to set it explicitly
: xz/lzip -9
hinders decompression of tarballs on low RAM systems (my experience is
that with less than 100MB free RAM, it starts swapping.
: gzip -9
Much slower, very little benefit over the default -6. Overall it might
be the only case where it's acceptable, as gzip has low requirements in
general so "much slower" is not *that* slow. But we have better
algorithms for achieving much better compression ratio than gzip -9.

Overall what I'm suggesting is to trust the author defaults, unless
overriden by the user.

Another issue fixed here is that I try to respect the environment passed
to make. If GZIP is set, now it is not overriden in any way. Options to
gzip can be passed by setting the environment variable desribed in its
man page, either in the environment, or in the makefile. Similar for the
other compressors (except lzip that does not support environment
settings). Side effect is that the makefile variable GZIP_ENV is removed
as I tried to keep things in symmetry, but this may break weird
pre-existing use cases.

Additionally I completely removed passing of flags to decompressors. A
decompressor always generates the same result.

Regarding "tar", I followed the same logic as with the compressors and
I'm utilising TAR_OPTIONS to affect GNU tar's behaviour. I also added a
couple of options as defaults, namely "--owner=0 --group=0" to avoid
disclosing buildsystem's UIDs and GIDs and make tarballs closer to
identical even if generated from different users. Again this might break
pre-existing uses that need this info, but variable can be easily set to
empty when calling "make dist".

Finally some variables have been quoted to ensure they will work with
spaces. This was already the case in other parts of the file. It still
is mixed though for important variables, notably "distdir", which is
a separate issue, I believe.

So what do you think?
Regards,
Dimitris

P.S. Please keep me CC'd as I'm not subscribed.

distdir.am.2.diff (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: minor fixes for make dist

Dimitrios Apostolou
By the way, it seems I'm missing an important piece of the puzzle
regarding how automake operates. Can someone explain the following?

  ?LZIP?DIST_TARGETS += dist-lzip
  ?XZ?DIST_TARGETS += dist-xz
  ?SHAR?DIST_TARGETS += dist-shar
  ?BZIP2?DIST_TARGETS += dist-bzip2
  ?GZIP?DIST_TARGETS += dist-gzip
  ?ZIP?DIST_TARGETS += dist-zip
  ?COMPRESS?DIST_TARGETS += dist-tarZ

What is this syntax? I can't seem to find it in the manual.

Thanks,
Dimitris


Reply | Threaded
Open this post in threaded view
|

Re: minor fixes for make dist

Jack Kelly-4
Dimitrios Apostolou <[hidden email]> writes:

> By the way, it seems I'm missing an important piece of the puzzle
> regarding how automake operates. Can someone explain the following?
>
>  ?LZIP?DIST_TARGETS += dist-lzip
>  ?XZ?DIST_TARGETS += dist-xz
>  ?SHAR?DIST_TARGETS += dist-shar
>  ?BZIP2?DIST_TARGETS += dist-bzip2
>  ?GZIP?DIST_TARGETS += dist-gzip
>  ?ZIP?DIST_TARGETS += dist-zip
>  ?COMPRESS?DIST_TARGETS += dist-tarZ
>
> What is this syntax? I can't seem to find it in the manual.

It seems to be an internal thing used at `Makefile.in' generation
time. See `sub transform' in `automake.in'.

-- Jack

Reply | Threaded
Open this post in threaded view
|

Re: minor fixes for make dist

Dimitrios Apostolou
On Fri, 20 Jan 2017, Jack Kelly wrote:

> Dimitrios Apostolou <[hidden email]> writes:
>
>> By the way, it seems I'm missing an important piece of the puzzle
>> regarding how automake operates. Can someone explain the following?
>>
>>  ?LZIP?DIST_TARGETS += dist-lzip
>>  ?XZ?DIST_TARGETS += dist-xz
>>  ?SHAR?DIST_TARGETS += dist-shar
>>  ?BZIP2?DIST_TARGETS += dist-bzip2
>>  ?GZIP?DIST_TARGETS += dist-gzip
>>  ?ZIP?DIST_TARGETS += dist-zip
>>  ?COMPRESS?DIST_TARGETS += dist-tarZ
>>
>> What is this syntax? I can't seem to find it in the manual.
>
> It seems to be an internal thing used at `Makefile.in' generation
> time. See `sub transform' in `automake.in'.

Indeed. And I can also see the routines in /usr/bin/automake, as it is a
perl script. Thanks for pointing to the right direction!

Dimitris