chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] Make CHICKEN build process deterministic


From: Kooda
Subject: [Chicken-hackers] [PATCH] Make CHICKEN build process deterministic
Date: Sun, 05 Jun 2016 14:13:53 +0200
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/24.4 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Hello,

I’ve been looking, in the past few days, at how to make CHICKEN
produce C files deterministically.

My goal here is to make it easier for package managers like Guix to
ship CHICKEN, as well as help us see how compiler changes affect the
generated output. I’m also highly interested in getting the same
binaries each time I compile a CHICKEN project.

So, here is a patch that does just that. I tried to make it as little
as possible and may have missed a few things.

The main problem was that the symbol hash table used a random seed,
which made the symbol order in the C files random. That’s what the new
deterministic-build unit addresses.

The other main source of non-determinism was the mention of the build
host and date at the top of the generated C files. I removed that
entirely as it doesn’t seem really useful.

I have left two identifiers untouched yet, unique-id in c-backend.scm
and make-random-name in support.scm. Both use (current-seconds) which
I want to remove.

Though it seems unique-id isn’t used anywhere, can I remove it
entirely?

About make-random-name, would it be ok to just remove the
current-seconds call or replace it with something else?

I also changed the default `ar` invocation options to make it generate
the same .a file each time it’s called with the same files, but sadly
the deterministic option doesn’t exist on Apple computers.

I hope all of this isn’t too messy. Please tell me what you think
about this change, I don’t want to impose anything.

If the change is accepted, I’ll make a new version of the patch and
port everything to chicken-5 as soon as I know what to do with the
remaining two identifiers.

Thanks in advance!


Attachment: 0001-Make-CHICKEN-build-process-deterministic.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]