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
build system improvements #917
Comments
From @moritzRakudo's build system is currently suboptimal in various ways. At least 1) 2) 3) 4) Currently calling 'make' twice in a row invokes dynpmc.pl on the -- |
From ascent-perl@azor.plI've attached patch. Few comments about your points: 1. I used die, instead of warning. I think this will be better. |
From ascent-perl@azor.plrt64868.patchdiff --git a/Configure.pl b/Configure.pl
index 0d98d59..de61435 100644
--- a/Configure.pl
+++ b/Configure.pl
@@ -9,7 +9,7 @@ use Getopt::Long;
MAIN: {
my %options;
GetOptions(\%options, 'help!', 'parrot-config=s',
- 'gen-parrot!', 'gen-parrot-option=s@');
+ 'gen-parrot!', 'gen-parrot-option=s@', 'check-parrot-revision!');
# Print help if it's requested
if ($options{'help'}) {
@@ -17,16 +17,6 @@ MAIN: {
exit(0);
}
- # Update/generate parrot build if needed
- if ($options{'gen-parrot'}) {
- my @opts = @{ $options{'gen-parrot-option'} || [] };
- my @command = ($^X, "build/gen_parrot.pl", @opts);
-
- print "Generating Parrot ...\n";
- print "@command\n\n";
- system @command;
- }
-
# Get a list of parrot-configs to invoke.
my @parrot_config_exe = qw(
parrot/parrot_config
@@ -38,6 +28,38 @@ MAIN: {
@parrot_config_exe = ($options{'parrot-config'});
}
+ # Check used by Makefile to be sure that Parrot revision is okay.
+ if ($options{'check-parrot-revision'}) {
+ my $parrot_revision;
+ for my $exe (@parrot_config_exe) {
+ no warnings;
+ if (open my $PARROT_CONFIG, '-|', "$exe revision") {
+ while (<$PARROT_CONFIG>) {
+ y/\r\n//d;
+ $parrot_revision = $_;
+ }
+ close $PARROT_CONFIG;
+ last if $parrot_revision;
+ }
+ }
+
+ if ($parrot_revision && minimal_parrot_revision() > $parrot_revision) {
+ print "\nwarning: Parrot is out of date... re-run Configure.pl with --gen-parrot option.\n\n";
+ }
+
+ exit(0);
+ }
+
+ # Update/generate parrot build if needed
+ if ($options{'gen-parrot'}) {
+ my @opts = @{ $options{'gen-parrot-option'} || [] };
+ my @command = ($^X, "build/gen_parrot.pl", @opts);
+
+ print "Generating Parrot ...\n";
+ print "@command\n\n";
+ system @command;
+ }
+
# Get configuration information from parrot_config
my %config = read_parrot_config(@parrot_config_exe);
unless (%config) {
@@ -50,6 +72,19 @@ the location of parrot_config.
END
}
+ # Check if Parrot revision isn't too old
+ my $min_parrot_rev = minimal_parrot_revision();
+
+ printf "\nFound Parrot r%d (needed at least: r%d)\n", $config{revision}, $min_parrot_rev;
+
+ if ($min_parrot_rev > $config{revision}) {
+ die <<'END';
+Your Parrot is too old!
+To automatically checkout (svn) and build a copy of parrot,
+try re-running Configure.pl with the '--gen-parrot' option.
+END
+ }
+
# Create the Makefile using the information we just got
create_makefile(%config);
@@ -119,6 +154,11 @@ sub slurp {
return $maketext;
}
+sub minimal_parrot_revision {
+ my $rev = slurp('build/PARROT_REVISION');
+ $rev =~ y/\r\n//d;
+ return $rev;
+}
# Print some help text.
sub print_help {
diff --git a/build/Makefile.in b/build/Makefile.in
index ebf1a82..901ce00 100644
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -333,7 +333,8 @@ help:
@echo " help: Print this help message."
@echo ""
-Makefile: build/Makefile.in
+Makefile: build/Makefile.in build/PARROT_REVISION
+ @$(PERL) Configure.pl --check-parrot-revision
@echo ""
@echo "warning: Makefile is out of date... re-run Configure.pl"
@echo ""
diff --git a/build/gen_parrot.pl b/build/gen_parrot.pl
index 23b548b..b356299 100644
--- a/build/gen_parrot.pl
+++ b/build/gen_parrot.pl
@@ -42,6 +42,9 @@ close $REQ;
}
}
+print "Cleaning up Rakudo...\n";
+system(qw(make clean));
+
print "Checking out Parrot r$required via svn...\n";
system(qw(svn checkout -r), $required , qw(https://svn.parrot.org/parrot/trunk parrot));
|
The RT System itself - Status changed from 'new' to 'open' |
From @pmichaudThanks for the patch. I ultimately decided to refactor things slightly a. Configure.pl always checks for a parrot that is >= PARROT_REVISION. b. Running Configure.pl performs a "make clean" (to remove any left-over c. Any changes to the build environment issues a warning that the d. The "make parrot" target now simply calls Configure.pl with --gen-parrot. This resolves the issue from the original post as follows: 1. Configure.pl now dies with a helpful message if the version of Parrot 2. The Makefile is considered "out of date" if any of the build 3. 'make parrot' now simply calls Configure.pl --gen-parrot, which will 4. The Makefile dependencies that would cause dynpmc.pl to be executed Closing ticket, if any further problems arise, feel free to reopen this Thanks! Pm |
1 similar comment
From @pmichaudThanks for the patch. I ultimately decided to refactor things slightly a. Configure.pl always checks for a parrot that is >= PARROT_REVISION. b. Running Configure.pl performs a "make clean" (to remove any left-over c. Any changes to the build environment issues a warning that the d. The "make parrot" target now simply calls Configure.pl with --gen-parrot. This resolves the issue from the original post as follows: 1. Configure.pl now dies with a helpful message if the version of Parrot 2. The Makefile is considered "out of date" if any of the build 3. 'make parrot' now simply calls Configure.pl --gen-parrot, which will 4. The Makefile dependencies that would cause dynpmc.pl to be executed Closing ticket, if any further problems arise, feel free to reopen this Thanks! Pm |
@pmichaud - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#64868 (status was 'resolved')
Searchable as RT64868$
The text was updated successfully, but these errors were encountered: