Closed Bug 1632776 Opened 5 years ago Closed 4 years ago

autocfg tests don't work properly on Windows PGO builds

Categories

(Firefox Build System :: General, defect, P5)

defect

Tracking

(firefox75 unaffected, firefox76 unaffected, firefox77 wontfix, firefox87 fixed)

RESOLVED FIXED
87 Branch
Tracking Status
firefox75 --- unaffected
firefox76 --- unaffected
firefox77 --- wontfix
firefox87 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: glandium)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Filed by: archaeopteryx [at] coole-files.de
Parsed log: https://treeherder.mozilla.org/logviewer.html#?job_id=299010711&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/LMUl2YVwRpWiOAHFlwkBcg/runs/0/artifacts/public/logs/live_backing.log


This message is part of all successful Windows instrumentation tasks and Treeherder picks it up as failure line because it's logged with ERROR level. Can this be logged with a different level if it's expected and not fatal? Thank you.

[task 2020-04-23T12:55:07.892Z] 12:55:07 INFO - [hashbrown 0.7.1] cargo:rerun-if-changed=build.rs
[task 2020-04-23T12:55:07.892Z] 12:55:07 INFO - [hashbrown 0.7.1] error: Profile-guided optimization does not yet work in conjunction with -Cpanic=unwind on Windows when targeting MSVC. See https://github.com/rust-lang/rust/issues/61002 for details.
[task 2020-04-23T12:55:07.892Z] 12:55:07 INFO - [hashbrown 0.7.1]
[task 2020-04-23T12:55:07.892Z] 12:55:07 INFO - Compiling ffi-support v0.4.0
[task 2020-04-23T12:55:07.894Z] 12:55:07 INFO - Running CARGO_PKG_HOMEPAGE= CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION=0.4.0 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_REPOSITORY='https://github.com/mozilla/application-services' CARGO_PKG_VERSION_PRE= CARGO_PKG_NAME=ffi-support CARGO_PKG_AUTHORS='Thom Chiovoloni <tchiovoloni@mozilla.com>' CARGO=/builds/worker/fetches/rustc/bin/cargo CARGO_MANIFEST_DIR=/builds/worker/checkouts/gecko/third_party/rust/ffi-support CARGO_PKG_VERSION_MINOR=4 LD_LIBRARY_PATH='/builds/worker/workspace/obj-build/release/deps:/builds/worker/fetches/rustc/lib' CARGO_PKG_DESCRIPTION='A crate to help expose Rust functions over the FFI.' /builds/worker/fetches/rustc/bin/rustc --edition=2018 --crate-name ffi_support /builds/worker/checkouts/gecko/third_party/rust/ffi-support/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C panic=abort --cfg 'feature="default"' -C metadata=684000eb2e253f67 -C extra-filename=-684000eb2e253f67 --out-dir /builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps --target x86_64-pc-windows-msvc -C linker=/builds/worker/checkouts/gecko/build/cargo-linker -L dependency=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps -L dependency=/builds/worker/workspace/obj-build/release/deps --extern lazy_static=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/liblazy_static-bd6dd9879d308357.rmeta --extern log=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/liblog-5c89d94462311ce4.rmeta --cap-lints warn -C opt-level=2 -C debuginfo=2 -C force-frame-pointers=yes -Dwarnings -C profile-generate=/builds/worker/workspace/obj-build -C codegen-units=1
[task 2020-04-23T12:55:07.894Z] 12:55:07 ERROR - [hashbrown 0.7.1] error: aborting due to previous error
[task 2020-04-23T12:55:07.894Z] 12:55:07 INFO - [hashbrown 0.7.1]
[task 2020-04-23T12:55:07.894Z] 12:55:07 INFO - [hashbrown 0.7.1] error: Profile-guided optimization does not yet work in conjunction with -Cpanic=unwind on Windows when targeting MSVC. See https://github.com/rust-lang/rust/issues/61002 for details.
[task 2020-04-23T12:55:07.894Z] 12:55:07 INFO - [hashbrown 0.7.1]
[task 2020-04-23T12:55:07.894Z] 12:55:07 ERROR - [hashbrown 0.7.1] error: aborting due to previous error
[task 2020-04-23T12:55:07.894Z] 12:55:07 INFO - [hashbrown 0.7.1]
[task 2020-04-23T12:55:07.894Z] 12:55:07 INFO - [hashbrown 0.7.1] warning: autocfg could not probe for std

Has Regression Range: --- → yes

Sorry, I don’t know much about PGO or why bug 1631721 would affect it. Redirecting per https://wiki.mozilla.org/Modules/Core#Build_Config

Flags: needinfo?(simon.sapin) → needinfo?(mh+mozilla)

Huh, but we should not be building with panic=unwind...

Ah, based on looking at the log with some context it appears that this message comes from the execution of hashbrown’s build script which uses the autocfg crate which in turns shells out to rustc to query its version number. It looks like that invocation of rustc is failing. Presumably that’s what prints the error message about PGO.

I don’t know what component turns this into an ERROR, though, since compilation of hashbrown and downstream crates seem to succeed in that log.

That hashbrown thing is a red herring.

Flags: needinfo?(mh+mozilla)

Oh, missed the part where you're saying it's on green builds. Yeah, I've seen this today.

Presumably, autocfg is passing too many flags to rustc, one of which is the one for PGO, and thanks to the rust issue linked in the error message, rustc emits an error in that case.

And actually reading https://github.com/cuviper/autocfg/blob/1.0.0/src/version.rs#L27-L30 it seems it doesn't pass any. So this must come from RUSTC_FLAGS in the environment, that rustc doesn't ignore when passed --version.

The RUSTFLAGS environment variable is read (and turned into explicit arguments) by Cargo, not rustc:

However, the log also contains a autocfg could not probe for `std` message which indicates that what fails is autocfg’s "sanity check" which does read RUSTFLAGS.

In that code we see that autocfg prints "warning: autocfg could not probe for `std`\n" to the build script’s stderr. Normally Cargo does not print stderr from build script to its own stdrr. But in the TC log that line is not only present, but prefixed by [task 2020-04-23T12:55:07.894Z] 12:55:07 INFO - [hashbrown 0.7.1]. What’s responsible for this? I something in Gecko’s build system actively parsing the $CARGO_TARGET_DIR/release/build/hashbrown-*/output file and looking for lines with "error" in it?

The first and last log lines quoted here are from the first and last meaningful source lines in https://github.com/rust-lang/hashbrown/blob/v0.7.1/build.rs The ffi-support bit is probably something unrelated running concurrently.

[task 2020-04-23T12:55:07.892Z] 12:55:07     INFO -  [hashbrown 0.7.1] cargo:rerun-if-changed=build.rs
[task 2020-04-23T12:55:07.892Z] 12:55:07     INFO -  [hashbrown 0.7.1] error: Profile-guided optimization does not yet work in conjunction with `-Cpanic=unwind` on Windows when targeting MSVC. See https://github.com/rust-lang/rust/issues/61002 for details.
[task 2020-04-23T12:55:07.892Z] 12:55:07     INFO -  [hashbrown 0.7.1]
[task 2020-04-23T12:55:07.892Z] 12:55:07     INFO -     Compiling ffi-support v0.4.0
[task 2020-04-23T12:55:07.894Z] 12:55:07     INFO -       Running `CARGO_PKG_HOMEPAGE= CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION=0.4.0 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_REPOSITORY='https://github.com/mozilla/application-services' CARGO_PKG_VERSION_PRE= CARGO_PKG_NAME=ffi-support CARGO_PKG_AUTHORS='Thom Chiovoloni <tchiovoloni@mozilla.com>' CARGO=/builds/worker/fetches/rustc/bin/cargo CARGO_MANIFEST_DIR=/builds/worker/checkouts/gecko/third_party/rust/ffi-support CARGO_PKG_VERSION_MINOR=4 LD_LIBRARY_PATH='/builds/worker/workspace/obj-build/release/deps:/builds/worker/fetches/rustc/lib' CARGO_PKG_DESCRIPTION='A crate to help expose Rust functions over the FFI.' /builds/worker/fetches/rustc/bin/rustc --edition=2018 --crate-name ffi_support /builds/worker/checkouts/gecko/third_party/rust/ffi-support/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C panic=abort --cfg 'feature="default"' -C metadata=684000eb2e253f67 -C extra-filename=-684000eb2e253f67 --out-dir /builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps --target x86_64-pc-windows-msvc -C linker=/builds/worker/checkouts/gecko/build/cargo-linker -L dependency=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps -L dependency=/builds/worker/workspace/obj-build/release/deps --extern lazy_static=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/liblazy_static-bd6dd9879d308357.rmeta --extern log=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/liblog-5c89d94462311ce4.rmeta --cap-lints warn -C opt-level=2 -C debuginfo=2 -C force-frame-pointers=yes -Dwarnings -C profile-generate=/builds/worker/workspace/obj-build -C codegen-units=1`
[task 2020-04-23T12:55:07.894Z] 12:55:07    ERROR -  [hashbrown 0.7.1] error: aborting due to previous error
[task 2020-04-23T12:55:07.894Z] 12:55:07     INFO -  [hashbrown 0.7.1]
[task 2020-04-23T12:55:07.894Z] 12:55:07     INFO -  [hashbrown 0.7.1] error: Profile-guided optimization does not yet work in conjunction with `-Cpanic=unwind` on Windows when targeting MSVC. See https://github.com/rust-lang/rust/issues/61002 for details.
[task 2020-04-23T12:55:07.894Z] 12:55:07     INFO -  [hashbrown 0.7.1]
[task 2020-04-23T12:55:07.894Z] 12:55:07    ERROR -  [hashbrown 0.7.1] error: aborting due to previous error
[task 2020-04-23T12:55:07.894Z] 12:55:07     INFO -  [hashbrown 0.7.1]
[task 2020-04-23T12:55:07.894Z] 12:55:07     INFO -  [hashbrown 0.7.1] warning: autocfg could not probe for `std`
[task 2020-04-23T12:55:07.894Z] 12:55:07     INFO -  [hashbrown 0.7.1] cargo:rustc-cfg=has_extern_crate_alloc

cargo does print build script output with -v.

TIL. When I try it I see lines such as:

[hashbrown 0.7.1] cargo:rustc-cfg=has_extern_crate_alloc

What component is responsible for classifying lines as INFO v.s. ERROR? The bug description seems to be about that:

Can this be logged with a different level if it's expected and not fatal?

Very clearly, there's a bug in autocfg that should be fixed. Also, hashbrown could switch to rustc_version instead.

Set release status flags based on info from the regressing bug 1631721

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Keywords: leave-open
Resolution: INCOMPLETE → ---
Assignee: nobody → mh+mozilla
Component: CSS Parsing and Computation → General
Product: Core → Firefox Build System
Blocks: 1688784
Summary: Perma Windows instr | [hashbrown 0.7.1] error: aborting due to previous error → autocfg tests don't work properly on Windows PGO builds
Keywords: leave-open
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/f1c0d2ec9876 Work around autocfg tests failing on Windows PGO builds. r=firefox-build-system-reviewers,sheehan,mhentges
Status: REOPENED → RESOLVED
Closed: 5 years ago4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: