Skip to content

Commit

Permalink
Merge pull request #5295 from rakudo/ugexe/may-precomp-environment-va…
Browse files Browse the repository at this point in the history
…riable

Add support for RAKUDO_NO_PRECOMPILATION environment variable
  • Loading branch information
ugexe committed Aug 5, 2023
2 parents e4b4bde + 6750ab3 commit 1d100f8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core.c/CompUnit/PrecompilationRepository.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ role CompUnit::PrecompilationRepository {

method load(CompUnit::PrecompilationId $id --> Nil) { }

method may-precomp(--> True) {
# would be a good place to check an environment variable
has Bool $!may-precomp;
method may-precomp(--> Bool:D) {
nqp::if(
nqp::defined($!may-precomp),
$!may-precomp,
($!may-precomp := !nqp::hllbool(nqp::if(nqp::atkey(%*ENV,'RAKUDO_NO_PRECOMPILATION'), 1, 0)))
)
}
}

Expand Down

0 comments on commit 1d100f8

Please sign in to comment.