Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use NQP prefix for finding profiler template #608

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/vm/moar/HLL/Backend.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ my sub literal_subst(str $source, str $pattern, $replacement) {

class HLL::Backend::MoarVM {
our %moar_config := nqp::backendconfig();

my sub read_ui32($fh, $buf?) {
unless $buf { $buf := nqp::create($NQPBuf) }
nqp::readfh($fh, $buf, 4);
Expand Down Expand Up @@ -691,7 +691,7 @@ class HLL::Backend::MoarVM {
my str $template;

if !$want_json && !$want_sql {
my $temppath := nqp::backendconfig()<prefix> ~ '/share/nqp/lib/profiler/template.html';
my $temppath := nqpconfig()<prefix> ~ '/share/nqp/lib/profiler/template.html';
$template := try slurp('src/vm/moar/profiler/template.html');
unless $template {
$template := try slurp($temppath);
Expand Down
8 changes: 8 additions & 0 deletions tools/lib/NQP/Config/NQP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ sub configure_misc {

$config->{moar_stage0} = $self->nfp( "src/vm/moar/stage0", no_quote => 1 );
$config->{jvm_stage0} = $self->nfp( "src/vm/jvm/stage0", no_quote => 1 );

# TODO: Use the template infrastructure from nqp-configure?
open my $configfile, '>', 'src/core/Config.nqp';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must not autogenerate anything in src. It actually belongs to gen/.

print $configfile "# This file is generated automatically by $0\n";
print $configfile "sub nqpconfig() {\n";
print $configfile " nqp::hash('prefix', '$config->{prefix}');\n";
print $configfile "}\n";
close $configfile;
}

sub configure_moar_backend {
Expand Down
1 change: 1 addition & 0 deletions tools/templates/Makefile-common.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ COMMON_HLL_SOURCES = \
HLL_COMBINED = NQPHLL.nqp

CORE_SETTING_SOURCES = \
@nfp(src/core/Config.nqp)@ \
@nfp(src/core/NativeTypes.nqp)@ \
@nfp(src/core/NQPRoutine.nqp)@ \
@nfp(src/core/NQPMu.nqp)@ \
Expand Down