Skip to content

Commit

Permalink
Use a different name for githead.log in nosend or nostatus modes
Browse files Browse the repository at this point in the history
This means that the file won't be used by run_branches.pl for up-to-date
checks on the next run, and the branch run will do a git-based
up-to-date check instead. Thus, the branch doesn't need a forced run any
more.

This effectively reverts 0c31f3e and 793a2ca

Per gripe from Tom Lane

Discussion: https://postgr.es/m/3951994.1691190865@sss.pgh.pa.us
  • Loading branch information
adunstan committed Aug 5, 2023
1 parent 9a9634e commit ec4cf43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
3 changes: 2 additions & 1 deletion PGBuild/SCM.pm
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,8 @@ sub check_access
sub log_id
{
my $self = shift;
writelog('githead', [ $self->{headref} ])
my $name = shift || 'githead';
writelog($name, [ $self->{headref} ])
if $self->{headref};
return;
}
Expand Down
15 changes: 4 additions & 11 deletions run_build.pl
Original file line number Diff line number Diff line change
Expand Up @@ -564,15 +564,6 @@ BEGIN
unlink $forcefile;
}

# if it's not a regular run, make sure we force the next run
# this run could defeat the up-to-date checks
# unless it's in testmode, which uses a different prefix
if (($nosend || $nostatus) && !$from_source && !$testmode)
{
open(my $fh, '>', $forcefile) || die "opening $forcefile: $!";
close($fh);
}

# try to allow core files to be produced.
# another way would be for the calling environment
# to call ulimit. We do this in an eval so failure is
Expand Down Expand Up @@ -777,6 +768,8 @@ END

$ENV{PGUSER} = 'buildfarm';

my $idname = ($nosend || $nostatus) ? 'ns-githead' : 'githead';

if ($from_source_clean)
{
die "configure step needed for --from-source-clean"
Expand Down Expand Up @@ -872,7 +865,7 @@ END
# if no build required do nothing
if ($last_status && !@filtered_files && !$modules_need_run)
{
$scm->log_id(); # update the githead.log for up-to-date checks
$scm->log_id($idname); # update the githead.log for up-to-date checks
print time_str(),
"No build required: last status = ", scalar(gmtime($last_status)),
" GMT, current snapshot = ", scalar(gmtime($current_snap)), " GMT,",
Expand All @@ -893,7 +886,7 @@ END
cleanlogs() unless ($from_source_clean || !step_wanted('configure'));

writelog('SCM-checkout', $savescmlog) unless $from_source;
$scm->log_id() unless $from_source;
$scm->log_id($idname) unless $from_source;

# copy/create according to vpath/scm settings

Expand Down

0 comments on commit ec4cf43

Please sign in to comment.