Skip to content

Commit a2f6656

Browse files
committed
Make build of NQP modules reproducible
By replacing timestamps in the compilation unit's id with a counter and in construction of unique alt_nfs ids with the compilation unit's id, we get reproducible builds. Simple rebuilds without changes to the source will no longer lead to "Missing or wrong version of dependency" messages.
1 parent b0d57e1 commit a2f6656

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/NQP/Grammar.nqp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
grammar NQP::Grammar is HLL::Grammar {
2+
my $sc_id := 0;
23
method TOP() {
34
# Language braid.
45
my $*LANG := self;
@@ -23,7 +24,7 @@ grammar NQP::Grammar is HLL::Grammar {
2324
# with this compilation unit.
2425
my $file := nqp::getlexdyn('$?FILES');
2526
my $source_id := nqp::sha1(self.target()) ~
26-
(%*COMPILING<%?OPTIONS><stable-sc> ?? '' !! '-' ~ ~nqp::time_n());
27+
(%*COMPILING<%?OPTIONS><stable-sc> ?? '' !! '-' ~ ~($sc_id++));
2728
my $*W := nqp::isnull($file) ??
2829
NQP::World.new(:handle($source_id)) !!
2930
NQP::World.new(:handle($source_id), :description($file));

src/QRegex/P6Regex/Actions.nqp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ class QRegex::P6Regex::Actions is HLL::Actions {
946946
self.alt_nfas($code_obj, $block, $_);
947947
nqp::push(@alternatives, QRegex::NFA.new.addnode($_));
948948
}
949-
$ast.name(QAST::Node.unique('alt_nfa_') ~ '_' ~ ~nqp::time_n());
949+
$ast.name(QAST::Node.unique('alt_nfa_') ~ '_' ~ $*W.handle());
950950
self.store_regex_alt_nfa($code_obj, $block, $ast.name, @alternatives);
951951
}
952952
elsif $rxtype eq 'subcapture' || $rxtype eq 'quant' {

0 commit comments

Comments
 (0)