Closed Bug 1787268 Opened 2 years ago Closed 2 years ago

ipcclientcerts no longer needs once_cell

Categories

(Core :: Security: PSM, enhancement, P5)

enhancement

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: jschanck, Assigned: jschanck)

References

Details

Attachments

(1 file)

Mutex::new is a const fn in Rust 1.63. So the MANAGER global in ipcclientcerts can be declared as:

static MANAGER: Mutex<Option<Manager<Backend>>> = Mutex::new(None);
Pushed by jschanck@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8feed89ecea4
avoid once_cell in ipcclientcerts. r=keeler

Backed out for causing build bustages.
So far, the only affected platform is Linux x64 debug.

Push with failures

Failure log

Backout link

[task 2022-08-26T22:28:12.831Z] 22:28:12     INFO -    --> /builds/worker/checkouts/gecko/third_party/rust/pkcs11/src/lib.rs:86:10
[task 2022-08-26T22:28:12.831Z] 22:28:12     INFO -     |
[task 2022-08-26T22:28:12.831Z] 22:28:12     INFO -  86 | #[derive(Debug)]
[task 2022-08-26T22:28:12.831Z] 22:28:12     INFO -     |          ^^^^^
[task 2022-08-26T22:28:12.831Z] 22:28:12     INFO -     = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
[task 2022-08-26T22:28:12.831Z] 22:28:12     INFO -     Compiling rsclientcerts v0.1.0 (/builds/worker/checkouts/gecko/security/manager/ssl/rsclientcerts)
[task 2022-08-26T22:28:12.831Z] 22:28:12     INFO -  warning: `pkcs11` (lib) generated 7 warnings
[task 2022-08-26T22:28:12.831Z] 22:28:12     INFO -       Running `CARGO=/builds/worker/fetches/rustc/bin/cargo CARGO_CRATE_NAME=rsclientcerts CARGO_MANIFEST_DIR=/builds/worker/checkouts/gecko/security/manager/ssl/rsclientcerts CARGO_PKG_AUTHORS='Dana Keeler <dkeeler@mozilla.com>' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=rsclientcerts CARGO_PKG_REPOSITORY='' CARGO_PKG_VERSION=0.1.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/builds/worker/workspace/obj-build/debug/deps:/builds/worker/fetches/rustc/lib:/builds/worker/workspace/obj-build/dist/bin' /builds/worker/fetches/sccache/sccache /builds/worker/fetches/rustc/bin/rustc --crate-name rsclientcerts --edition=2018 security/manager/ssl/rsclientcerts/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C panic=abort -C embed-bitcode=no -C debuginfo=2 -C debug-assertions=on -C metadata=f314def42241419f -C extra-filename=-f314def42241419f --out-dir /builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps --target x86_64-unknown-linux-gnu -C linker=/builds/worker/checkouts/gecko/build/cargo-linker -L dependency=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps -L dependency=/builds/worker/workspace/obj-build/debug/deps --extern byteorder=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps/libbyteorder-69c3d5a3c2369536.rmeta --extern pkcs11=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps/libpkcs11-a80d89714e12f8a2.rmeta -C debuginfo=2 -C force-frame-pointers=yes -Dwarnings -Aproc-macro-back-compat -C codegen-units=1 -L native=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/build/libloading-754c0e45fadc80c8/out`
[task 2022-08-26T22:28:12.831Z] 22:28:12     INFO -     Compiling ipcclientcerts-static v0.1.0 (/builds/worker/checkouts/gecko/security/manager/ssl/ipcclientcerts)
[task 2022-08-26T22:28:12.831Z] 22:28:12     INFO -       Running `CARGO=/builds/worker/fetches/rustc/bin/cargo CARGO_CRATE_NAME=ipcclientcerts_static CARGO_MANIFEST_DIR=/builds/worker/checkouts/gecko/security/manager/ssl/ipcclientcerts CARGO_PKG_AUTHORS='Dana Keeler <dkeeler@mozilla.com>' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=ipcclientcerts-static CARGO_PKG_REPOSITORY='' CARGO_PKG_VERSION=0.1.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='/builds/worker/workspace/obj-build/debug/deps:/builds/worker/fetches/rustc/lib:/builds/worker/workspace/obj-build/dist/bin' /builds/worker/fetches/sccache/sccache /builds/worker/fetches/rustc/bin/rustc --crate-name ipcclientcerts_static --edition=2018 security/manager/ssl/ipcclientcerts/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type staticlib --emit=dep-info,link -C opt-level=2 -C panic=abort -C embed-bitcode=no -C debuginfo=2 -C debug-assertions=on -C metadata=5922931f0e439281 -C extra-filename=-5922931f0e439281 --out-dir /builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps --target x86_64-unknown-linux-gnu -C linker=/builds/worker/checkouts/gecko/build/cargo-linker -L dependency=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps -L dependency=/builds/worker/workspace/obj-build/debug/deps --extern byteorder=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps/libbyteorder-69c3d5a3c2369536.rlib --extern pkcs11=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps/libpkcs11-a80d89714e12f8a2.rlib --extern rsclientcerts=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps/librsclientcerts-f314def42241419f.rlib --extern sha2=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps/libsha2-03fb79a7ee669de0.rlib -C debuginfo=2 -C force-frame-pointers=yes -Dwarnings -Aproc-macro-back-compat -C codegen-units=1 -L native=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/build/libloading-754c0e45fadc80c8/out`
[task 2022-08-26T22:28:12.832Z] 22:28:12    ERROR -  error[E0015]: cannot call non-const fn `Mutex::<Option<Manager<Backend>>>::new` in statics
[task 2022-08-26T22:28:12.832Z] 22:28:12     INFO -    --> security/manager/ssl/ipcclientcerts/src/lib.rs:53:51
[task 2022-08-26T22:28:12.832Z] 22:28:12     INFO -     |
[task 2022-08-26T22:28:12.832Z] 22:28:12     INFO -  53 | static MANAGER: Mutex<Option<Manager<Backend>>> = Mutex::new(None);
[task 2022-08-26T22:28:12.832Z] 22:28:12     INFO -     |                                                   ^^^^^^^^^^^^^^^^
[task 2022-08-26T22:28:12.832Z] 22:28:12     INFO -     |
[task 2022-08-26T22:28:12.832Z] 22:28:12     INFO -     = note: calls in statics are limited to constant functions, tuple structs and tuple variants
[task 2022-08-26T22:28:12.832Z] 22:28:12     INFO -  For more information about this error, try `rustc --explain E0015`.
[task 2022-08-26T22:28:12.832Z] 22:28:12     INFO -  error: could not compile `ipcclientcerts-static` due to previous error
[task 2022-08-26T22:28:12.832Z] 22:28:12     INFO -  Caused by:
[task 2022-08-26T22:28:12.834Z] 22:28:12     INFO -    process didn't exit successfully: `CARGO=/builds/worker/fetches/rustc/bin/cargo CARGO_CRATE_NAME=ipcclientcerts_static CARGO_MANIFEST_DIR=/builds/worker/checkouts/gecko/security/manager/ssl/ipcclientcerts CARGO_PKG_AUTHORS='Dana Keeler <dkeeler@mozilla.com>' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=ipcclientcerts-static CARGO_PKG_REPOSITORY='' CARGO_PKG_VERSION=0.1.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='/builds/worker/workspace/obj-build/debug/deps:/builds/worker/fetches/rustc/lib:/builds/worker/workspace/obj-build/dist/bin' /builds/worker/fetches/sccache/sccache /builds/worker/fetches/rustc/bin/rustc --crate-name ipcclientcerts_static --edition=2018 security/manager/ssl/ipcclientcerts/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type staticlib --emit=dep-info,link -C opt-level=2 -C panic=abort -C embed-bitcode=no -C debuginfo=2 -C debug-assertions=on -C metadata=5922931f0e439281 -C extra-filename=-5922931f0e439281 --out-dir /builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps --target x86_64-unknown-linux-gnu -C linker=/builds/worker/checkouts/gecko/build/cargo-linker -L dependency=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps -L dependency=/builds/worker/workspace/obj-build/debug/deps --extern byteorder=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps/libbyteorder-69c3d5a3c2369536.rlib --extern pkcs11=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps/libpkcs11-a80d89714e12f8a2.rlib --extern rsclientcerts=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps/librsclientcerts-f314def42241419f.rlib --extern sha2=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/deps/libsha2-03fb79a7ee669de0.rlib -C debuginfo=2 -C force-frame-pointers=yes -Dwarnings -Aproc-macro-back-compat -C codegen-units=1 -L native=/builds/worker/workspace/obj-build/x86_64-unknown-linux-gnu/debug/build/libloading-754c0e45fadc80c8/out` (exit status: 1)
[task 2022-08-26T22:28:12.834Z] 22:28:12    ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/makefiles/rust.mk:433: force-cargo-library-build] Error 101
[task 2022-08-26T22:28:12.834Z] 22:28:12     INFO -  gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/security/manager/ssl/ipcclientcerts'
[task 2022-08-26T22:28:12.834Z] 22:28:12    ERROR -  gmake[3]: *** [/builds/worker/checkouts/gecko/config/recurse.mk:72: security/manager/ssl/ipcclientcerts/target] Error 2
[task 2022-08-26T22:28:12.834Z] 22:28:12     INFO -  gmake[3]: *** Waiting for unfinished jobs....
[task 2022-08-26T22:28:12.835Z] 22:28:12     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/config/external/icu/i18n'
Flags: needinfo?(jschanck)

Hmm, I thought all of our builders would be on rust 1.63 because of Bug 1783782. We can wait to land this.

Depends on: 1783782
Flags: needinfo?(jschanck)

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:jschanck, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.

Flags: needinfo?(jschanck)
Flags: needinfo?(dkeeler)

We're waiting on all of the builders to use rust 1.63. John - might be a good idea to figure out what's going on with that.

Flags: needinfo?(dkeeler)

We actually have to wait for an MSRV bump.

Flags: needinfo?(jschanck)
Status: NEW → ASSIGNED
Depends on: 1797869
No longer depends on: 1783782
Pushed by jschanck@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/608c357542ac
avoid once_cell in ipcclientcerts. r=keeler
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: