Stefano Lattarini skrev 2011-12-13 18:17: > oOn Monday 12 December 2011, Peter Rosin wrote: >> Hi! >> > Hi Peter. > >> I noticed that the changes to "make dist-xz" to default to -e fixed >> the xz.test on MinGW, but that lzma.test still fails (lzma: (stdin): Not >> enough memory). >> > [BTW: thanks for your continuous testing with Cygwin and MinGW!] > >> Hoping to fix the last fail in the testsuite, I looked >> into adding something like LZMA_OPT or something to "make dist-lzma". >> But in my cursory googling, I could not get my grips around what variable >> to use. Does anyone know? >> > I don't, but I have another consideration: since lzma seems to be supersed > by xz [1][2], couldn't we simply deprecate the `dist-lzma' option in this > 11.1.2 version, and remove it altogether from the next major (or even minor) > version? WDYT?
That seems a bit drastic to me. >> However, what I did find was that there is a variable named XZ_DEFAULT. >> Shouldn't that be considered before "forcing" -e when XZ_OPT is missing? >> > From the xz manpage: > > XZ_DEFAULTS > User-specific or system-wide default options. Typically this is > set in a shell initialization script to enable xz's memory usage > limiter by default. Excluding shell initialization scripts and > similar special cases, scripts must never set or unset XZ_DEFAULTS. > > So XZ_DEFAULTS is mostly meant to allow the user to set default memory > usage limiters; since we don't touch such a setting in our use of > XZ_OPT, I say we should be pretty safe. Moreover: > > XZ_OPT > This is for passing options to xz when it is not possible to > set the options directly on the xz command line ... > Scripts may use XZ_OPT e.g. to set script-specific default > compression options. It is still recommended to allow users > to override XZ_OPT if that is reasonable ... > > and our use of XZ_OPT seems consistent with the advice given here. Yes, I guess you are right. I looked a bit further and it seems newer lzma compressors, probably those implemented as symlinks to the xz binary, also respond to XZ_DEFAULTS and XZ_OPT. So, I can make the lzma.test pass with XZ_DEFAULTS=--memlimit=250MiB in the environment. I wonder how long that workaround will last... However, older lzma binaries probably don't look at the XZ variables. So, copying the XZ_OPT code from dist-xz to dist-lzma is probably a no-no. Cheers, Peter