Ticket #1263 (closed cage: fixed)

Opened 12 years ago

Last modified 12 years ago

Determine configuration value for 'platform' prior to gen::platform

Reported by: jkeenan Owned by: jkeenan
Priority: normal Milestone:
Component: configure Version: 1.7.0
Severity: medium Keywords: platform
Cc: Language:
Patch status: applied Platform: all

Description

This ticket picks up an idea originally discussed in TT #1194. Parrot configuration step gen::platform creates platform-specific files. It contains logic to determine what value the string for platform should hold.

 65 sub _get_platform {
 66     my $self = shift;
 67     my ($conf, $verbose) = @_;
 68     my $platform = lc ( $conf->data->get_p5('OSNAME') );
 69 
 70     $platform = "win32" if $platform =~ /^msys/;
 71     $platform = "win32" if $platform =~ /^mingw/;
 72     $platform =~ s/^ms//;
 73 
 74     if ( ( split m/-/, $conf->data->get_p5('archname'), 2 )[0] eq 'ia64' ) {
 75         $platform = 'ia64';
 76     }
 77 
 78     $platform = 'generic' unless -d "config/gen/platform/$platform";
 79 
 80     print " platform='$platform' " if $verbose;
 81     return $platform;
 82 }

The fact that we are only determining this value in the second-last configuration step is inconsistent with the design (such as it is) of our configuration system. Parrot configuration values ought to be determined in init, inter, or auto steps. The gen steps should not be making any determinations of config values. Rather, they should simply be spitting out files based on values determined in steps of the first three types.

It would be better if a value for platform were determined much earlier in the configuration process -- most likely in config/auto/arch.pm, as that is the place where cpuarch and osname get their final determination. (True, there may be shortcomings in the way auto::arch determines those values; cf. TT #423. But that does not gainsay the point of this ticket.)

I will create a branch to develop and test this feature revision.

Thank you very much.

kid51

Change History

Changed 12 years ago by jkeenan

  • status changed from new to assigned

Changed 12 years ago by jkeenan

  • patch set to applied

Work was done in platform_determine_earlier branch. This was merged into trunk at r42434.

Will keep ticket open for two days to record any problems.

Thank you very much.

kid51

Changed 12 years ago by jkeenan

  • status changed from assigned to closed
  • resolution set to fixed

No complaints. Closing ticket.

Note: See TracTickets for help on using tickets.