Honor the 'SOURCE_DATE_EPOCH' environment variable to allow for determinitic builds. --- a/Lib/py_compile.py +++ b/Lib/py_compile.py @@ -105,7 +105,10 @@ def compile(file, cfile=None, dfile=None, doraise=False): """ with open(file, 'U') as f: try: - timestamp = long(os.fstat(f.fileno()).st_mtime) + if 'SOURCE_DATE_EPOCH' in os.environ: + timestamp = long(os.environ['SOURCE_DATE_EPOCH']) + else: + timestamp = long(os.fstat(f.fileno()).st_mtime) except AttributeError: timestamp = long(os.stat(file).st_mtime) codestring = f.read() diff --git a/Python/import.c b/Python/import.c index e47ce63..7eecf9c 100644 --- a/Python/import.c +++ b/Python/import.c @@ -945,6 +945,11 @@ write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat, t /* Now write the true mtime (as a 32-bit field) */ fseek(fp, 4L, 0); assert(mtime <= 0xFFFFFFFF); + if (Py_GETENV("SOURCE_DATE_EPOCH") != NULL) { + const char *epoch = Py_GETENV("SOURCE_DATE_EPOCH"); + mtime = atoi(epoch); + } + PyMarshal_WriteLongToFile((long)mtime, fp, Py_MARSHAL_VERSION); fflush(fp); fclose(fp); /guix/tree/gnu/installer/final.scm?id=0607f890888d1212ed1005c067bab3e4b9759812'>treecommitdiff
path: root/gnu/installer/final.scm
AgeCommit message (Expand)Author
2019-04-28installer: User accounts can now have a "real name."...* gnu/installer/newt/user.scm (run-user-add-page): Add #:real-name. Add a label and entry for the real name and initialize the 'real-name' field of the <user> record. * gnu/installer/final.scm (create-user-database): Set the 'comment' field of the <user-account> record. Ludovic Courtès
2019-04-26installer: Take 'guix system init' exit code into account....This allows the installer to distinguish success from failure, and also ensures the shell that runs 'guix system init' exits upon completion. * gnu/installer/utils.scm (run-shell-command)[pause]: New procedure. Add "exec" before COMMAND in the script. Guard 'invoke' call and handle 'invoke-error?'. Add call to 'pause' on completion. * gnu/installer/final.scm (install-system): Remove 'false-if-exception'. Ludovic Courtès
2019-04-25installer: Ask for the root account password....Fixes <https://bugs.gnu.org/35399>. * gnu/installer/newt/user.scm (run-root-password-page): New procedure. * gnu/installer/user.scm (users->configuration): Filter out the "root" account. * gnu/installer/final.scm (create-user-database): Set 'uid' field in 'user-account' form. Ludovic Courtès
2019-04-25installer: Ask for user password and initialize /etc/shadow....Partly fixes <https://bugs.gnu.org/35399>. * gnu/installer/user.scm (<user>)[password]: New field. * gnu/installer/final.scm (%seed): New variable. (integer->alphanumeric-char, random-string) (create-user-database): New procedures. (install-system): Call 'create-user-database'. * gnu/installer/newt/final.scm (run-install-shell): Add #:users and pass it to 'install-system'. (run-final-page): Pass #:users to 'run-install-shell'. * gnu/installer/newt/user.scm (run-user-add-page): Add password entry. Pass its result as the 'password' field of <user>. Ludovic Courtès
2019-04-23installer: Run 'guix system init' with the right locale....* gnu/installer/utils.scm (run-shell-command): Add #:locale and honor it. * gnu/installer/newt/final.scm (run-install-shell): Add 'locale' parameter; pass it to 'install-system'. (run-final-page): Obtain locale from RESULT; pass it to 'run-install-shell'. * gnu/installer/final.scm (install-system): Add 'locale' parameter; pass it to 'run-shell-command'. Ludovic Courtès
2019-01-17installer: Add configuration formatter....* gnu/installer.scm (installer-steps): Add configuration-formatter procedures. * gnu/installer/final.scm: New file. * gnu/installer/locale.scm (locale->configuration): New exported procedure. * gnu/installer/newt.scm (newt-installer): Add final page. * gnu/installer/newt/final.scm: New file. * gnu/installer/record.scm (installer): Add final-page field. * gnu/installer/timezone.scm (posix-tz->configuration): New exported procedure. * gnu/installer/steps.scm (installer-step): Rename configuration-proc field to configuration-formatter. (%installer-configuration-file): New exported parameter, (%installer-target-dir): ditto, (%configuration-file-width): ditto, (format-configuration): new exported procedure, (configuration->file): new exported procedure. Mathieu Othacehe