[Debian-med-packaging] Bug#834139: ncbi-tools6: please add support for SOURCE_DATE_EPOCH

Sascha Steinbiss satta at debian.org
Fri Aug 12 13:00:29 UTC 2016


Hi Andreas,

> feel free to do a team upload if nobody insists explicitly.

I would but I must admit I'm not sure how to integrate my patch into the
patch system used in this repo. To test it in my local reproducibility
pipeline I migrated my local version to quilt (with the previous
.diff.gz as a separate patch), but I'm a bit reluctant to make such
stylistic changes in a package not primarily maintained by me.
Do you have a pointer to a resource teaching me how to use the old patch
system?

Cheers
Sascha

> On Fri, Aug 12, 2016 at 12:03:24PM +0000, Sascha Steinbiss wrote:
>> Source: ncbi-tools6
>> Severity: wishlist
>> Tags: patch
>> User: reproducible-builds at lists.alioth.debian.org
>> Usertags: timestamps
>>
>>
>> Dear Maintainer,
>>
>> while trying to make the metastudent-data package reproducible, I noticed that
>> the binary package contains BLAST index files which embed timestamps
>> representing the index build time. I have attached a patch to libncbi6 that
>> adds support for SOURCE_DATE_EPOCH [1]  to avoid embedding the current time
>> and date into generated index files.
>> I hope that this will make the build of packages including BLAST indexes in
>> their artifacts reproducible.
>>
>> Thanks and kind regards
>> Sascha
>>
>> [1] https://reproducible-builds.org/specs/source-date-epoch
> 
>> Description: add support for SOURCE_DATE_EPOCH
>>  BLAST index files embed the date and time of their generation. This patch
>>  adds support for SOURCE_DATE_EPOCH (see public specification at
>>  https://reproducible-builds.org/specs/source-date-epoch/) to formatdb.
>> Author: Sascha Steinbiss <satta at debian.org>
>> --- a/corelib/ncbitime.c
>> +++ b/corelib/ncbitime.c
>> @@ -77,6 +77,7 @@
>>  #include <ncbi.h>
>>  #include <ncbithr.h>
>>  #include <ncbiwin.h>
>> +#include <stdlib.h>
>>  
>>  #ifdef OS_UNIX
>>  #include <sys/times.h>
>> @@ -108,8 +109,14 @@
>>  *****************************************************************************/
>>  NLM_EXTERN Nlm_Boolean LIBCALL  Nlm_GetDayTime (Nlm_DayTimePtr dtp)
>>  {
>> +  const char *sde = getenv("SOURCE_DATE_EPOCH");
>>  #if (defined(SOLARIS_THREADS_AVAIL)  ||  defined(POSIX_THREADS_AVAIL)  ||  defined(WIN32)) && !defined(OS_UNIX_DARWIN)
>> -  time_t t = time( NULL );
>> +  time_t t;
>> +  if (sde) {
>> +    t = strtoul(sde, NULL, 0);
>> +   } else {
>> +    t = time( NULL );
>> +   }
>>  #ifdef WIN32
>>    static TNlmMutex localtime_lock;
>>    if (NlmMutexLockEx( &localtime_lock ) != 0)
>> @@ -125,7 +132,11 @@
>>    time_t ltime;
>>    struct tm *dt;
>>    Nlm_MemFill ((Nlm_VoidPtr) dtp, 0, sizeof(Nlm_DayTime));
>> -	time(&ltime);
>> +  if (sde) {
>> +    ltime = strtoul(sde, NULL, 0);
>> +  } else {
>> +    time(&ltime);
>> +  }
>>    if ((dt = localtime (&ltime)) != NULL)
>>   	{
>>          Nlm_MemCopy ((Nlm_VoidPtr) dtp, (Nlm_VoidPtr) dt, sizeof (struct tm));
> 
>> _______________________________________________
>> Debian-med-packaging mailing list
>> Debian-med-packaging at lists.alioth.debian.org
>> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-packaging
> 
> 


-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 



More information about the Debian-med-packaging mailing list