Closed Bug 408811 Opened 12 years ago Closed 12 years ago

warning in Bootstrap::Stage (Use of uninitialized value in hash element)

Categories

(Release Engineering :: General, defect, P2, minor)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: nthomas, Assigned: nthomas)

References

Details

Attachments

(2 files, 1 obsolete file)

I saw this during Tb1.5.0.14 staging, but it's also present in Fx2.0.0.11 and Fx3.0b1 staging logs (but at different line numbers). eg:

log: WARNING: Unknown file type in tree: /data/cltbld/firefox-2.0.0.11/batch1/prestage-trimmed/win32_signing_rc1.log
Use of uninitialized value in hash element at Bootstrap/Step/Stage.pm line 644.
log: Deleting unwanted locale deliverable: /data/cltbld/firefox-2.0.0.11/batch1/prestage-trimmed/win32_signing_rc1.log
log: WARNING: Unknown file type in tree: /data/cltbld/firefox-2.0.0.11/batch1/prestage-trimmed/linux_info.txt
Use of uninitialized value in hash element at Bootstrap/Step/Stage.pm line 644.
log: Deleting unwanted locale deliverable: /data/cltbld/firefox-2.0.0.11/batch1/prestage-trimmed/linux_info.txt
...
log: WARNING: Unknown file type in tree: /data/cltbld/firefox-2.0.0.11/batch1/prestage-trimmed/macosx_info.txt
Use of uninitialized value in hash element at Bootstrap/Step/Stage.pm line 644.
log: Deleting unwanted locale deliverable: /data/cltbld/firefox-2.0.0.11/batch1/prestage-trimmed/macosx_info.txt
...
log: WARNING: Unknown file type in tree: /data/cltbld/firefox-2.0.0.11/batch1/prestage-trimmed/win32_info.txt
Use of uninitialized value in hash element at Bootstrap/Step/Stage.pm line 644.
log: Deleting unwanted locale deliverable: /data/cltbld/firefox-2.0.0.11/batch1/prestage-trimmed/win32_info.txt

It's this code (in Stage.pm, IsValidLocaleDeliverable()), barfing on files that don't fit our preconceptions of the filename:

    .... # a bunch of other tests on files that ship, similar to this elsif
    } elsif ($dirent =~ /\.mar/) {
        # e.g. firefox-2.0.0.2.tr.win32.[partial,complete].mar
        $locale = $parts[$partsCount - 4];
        $platform = $DELIVERABLE_TO_PLATFORM{$parts[$partsCount - 3]};
    } else {
        $this->Log(msg => "WARNING: Unknown file type in tree: $dirent");
    }

--> foreach my $allowedPlatform (@{$this->{'localeManifest'}->{$locale}}) {
        return 1 if ($allowedPlatform eq $platform);
    }

The --> indicates the line the error occurs on (644 in rev1.23 for RELEASE_AUTOMATION_M6_1, 655 in rev 1.26 - the current tip). The problem is that $locale and $platform are not defined when we hit the else clause with the BuildID files and the win32 signing log.
This is one approach to fix it, but we could also "return 0" in the else block in comment #0 if we want a blanket exclusion for new files. What do you prefer Rob ?
Assignee: nobody → nrthomas
Status: NEW → ASSIGNED
Attachment #293655 - Flags: review?(rhelmer)
Oops, hardcoded rc1 in there, instead of rc\d+
Attachment #293655 - Attachment is obsolete: true
Attachment #293656 - Flags: review?(rhelmer)
Attachment #293655 - Flags: review?(rhelmer)
Attachment #293656 - Flags: review?(rhelmer) → review+
(In reply to comment #1)
> Created an attachment (id=293655) [details]
> Add BuildID and signing log to list of excluded files
> 
> This is one approach to fix it, but we could also "return 0" in the else block
> in comment #0 if we want a blanket exclusion for new files. What do you prefer
> Rob ?

I think we should at least make it so encountering new files isn't a syntax error. Since we don't know what to do, we should probably make it fatal.
Comment on attachment 293656 [details] [diff] [review]
[checked in] Add BuildID and signing log to list of excluded files - but don't hardcode rc1

Checking in Bootstrap/Step/Stage.pm;
/cvsroot/mozilla/tools/release/Bootstrap/Step/Stage.pm,v  <--  Stage.pm
new revision: 1.27; previous revision: 1.26
done
Attachment #293656 - Attachment description: Add BuildID and signing log to list of excluded files - but don't hardcode rc1 → [checked in] Add BuildID and signing log to list of excluded files - but don't hardcode rc1
Comment #3 is still to be done. Feel free to grab it if you have time.
This just converts the existing warning into something fatal. Stage::Execute exits after populating prestage-trimmed.
Attachment #299209 - Flags: review?(rhelmer)
Attachment #299209 - Flags: review?(rhelmer) → review+
Comment on attachment 299209 [details] [diff] [review]
[checked in] Crash and burn on files that are unexpected

Checking in Bootstrap/Step/Stage.pm;
/cvsroot/mozilla/tools/release/Bootstrap/Step/Stage.pm,v  <--  Stage.pm
new revision: 1.34; previous revision: 1.33
done
Attachment #299209 - Attachment description: Crash and burn on files that are unexpected → [checked in] Crash and burn on files that are unexpected
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: mozilla.org → Release Engineering
You need to log in before you can comment on or make changes to this bug.