Closed Bug 1913469 Opened 5 months ago Closed 5 months ago

error: unused import: `gecko_profiler_category` when building with --disable-gecko-profiler

Categories

(Core :: Gecko Profiler, defect, P5)

defect

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: gerard-majax)

Details

Attachments

(1 file)

Assignee: nobody → lissyx+mozillians
Status: NEW → ASSIGNED
Attachment #9419412 - Attachment description: WIP: Bug 1913469 - Fix --disable-gecko-profiler → Bug 1913469 - Fix --disable-gecko-profiler r?emilio!

Backed out for causing build bustages related to gecko-profiler.

[task 2024-08-20T09:45:02.162Z] 09:45:02     INFO -     Compiling webrender_bindings v0.1.0 (/builds/worker/checkouts/gecko/gfx/webrender_bindings)
[task 2024-08-20T09:45:02.165Z] 09:45:02     INFO -       Running `CARGO=/builds/worker/fetches/rustc/bin/cargo CARGO_CRATE_NAME=webrender_bindings CARGO_MANIFEST_DIR=/builds/worker/checkouts/gecko/gfx/webrender_bindings CARGO_PKG_AUTHORS='The Mozilla Project Developers' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=MPL-2.0 CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=webrender_bindings CARGO_PKG_README='' CARGO_PKG_REPOSITORY='' CARGO_PKG_RUST_VERSION='' 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/release/deps /builds/worker/fetches/sccache/sccache /builds/worker/fetches/rustc/bin/rustc --crate-name webrender_bindings --edition=2015 gfx/webrender_bindings/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 metadata=775f6e4c6a83be55 -C extra-filename=-775f6e4c6a83be55 --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 app_units=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libapp_units-bd54d80329d8e6fb.rmeta --extern bincode=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libbincode-15566eaa0671b9d7.rmeta --extern dirs=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libdirs-e419beccb17eb0cc.rmeta --extern dwrote=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libdwrote-dbf069116612f3fb.rmeta --extern euclid=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libeuclid-cec9fa929cc81911.rmeta --extern fxhash=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libfxhash-03c354d699b52113.rmeta --extern gecko_profiler=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libgecko_profiler-2d0f8a91cee2970f.rmeta --extern gleam=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libgleam-ba3c78599062ec44.rmeta --extern log=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/liblog-e9c375a436df45ea.rmeta --extern nsstring=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libnsstring-bae694443496be7f.rmeta --extern num_cpus=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libnum_cpus-9b48ed74824220ac.rmeta --extern rayon=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/librayon-521aea77b51997aa.rmeta --extern remove_dir_all=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libremove_dir_all-dc0720e48a91f43b.rmeta --extern static_prefs=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libstatic_prefs-aa43feb5c98b667e.rmeta --extern swgl=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libswgl-e02c7a30660619af.rmeta --extern thin_vec=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libthin_vec-86eebf95064b20eb.rmeta --extern tracy_rs=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libtracy_rs-4209e5a0012c934c.rmeta --extern uuid=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libuuid-047ee481e08f7db0.rmeta --extern webrender=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libwebrender-2e72d304685418dc.rmeta --extern winapi=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libwinapi-e87d9b4e9b183835.rmeta --extern wr_malloc_size_of=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libwr_malloc_size_of-7a99139fd3cd3413.rmeta -C debuginfo=2 -C force-frame-pointers=yes -C control-flow-guard=yes -Dwarnings -Cembed-bitcode=yes -C codegen-units=1 -L native=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/build/swgl-f7ab0a3256b69856/out -L native=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/build/lmdb-rkv-sys-7d927bbf86a7d3e9/out -L native=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/build/whatsys-4d318463f4ade4fc/out`
[task 2024-08-20T09:45:02.165Z] 09:45:02     INFO -  warning: ignoring -C extra-filename flag due to -o flag
[task 2024-08-20T09:45:02.165Z] 09:45:02    ERROR -  error: cannot find macro `gecko_profiler_category` in this scope
[task 2024-08-20T09:45:02.165Z] 09:45:02     INFO -     --> gfx/webrender_bindings/src/moz2d_renderer.rs:514:13
[task 2024-08-20T09:45:02.165Z] 09:45:02     INFO -      |
[task 2024-08-20T09:45:02.165Z] 09:45:02     INFO -  514 |             gecko_profiler_category!(Graphics),
[task 2024-08-20T09:45:02.165Z] 09:45:02     INFO -      |             ^^^^^^^^^^^^^^^^^^^^^^^
[task 2024-08-20T09:45:02.165Z] 09:45:02     INFO -      |
[task 2024-08-20T09:45:02.166Z] 09:45:02     INFO -     ::: /builds/worker/checkouts/gecko/tools/profiler/rust-api/src/label.rs:65:1
[task 2024-08-20T09:45:02.166Z] 09:45:02     INFO -      |
[task 2024-08-20T09:45:02.166Z] 09:45:02     INFO -  65  | macro_rules! gecko_profiler_label {
[task 2024-08-20T09:45:02.166Z] 09:45:02     INFO -      | --------------------------------- similarly named macro `gecko_profiler_label` defined here
[task 2024-08-20T09:45:02.166Z] 09:45:02     INFO -      |
[task 2024-08-20T09:45:02.166Z] 09:45:02     INFO -  help: a macro with a similar name exists
[task 2024-08-20T09:45:02.166Z] 09:45:02     INFO -      |
[task 2024-08-20T09:45:02.166Z] 09:45:02     INFO -  514 |             gecko_profiler_label!(Graphics),
[task 2024-08-20T09:45:02.166Z] 09:45:02     INFO -      |             ~~~~~~~~~~~~~~~~~~~~
[task 2024-08-20T09:45:02.166Z] 09:45:02     INFO -  help: consider importing this macro
[task 2024-08-20T09:45:02.166Z] 09:45:02     INFO -      |
[task 2024-08-20T09:45:02.167Z] 09:45:02     INFO -  12  + use gecko_profiler::gecko_profiler_category;
[task 2024-08-20T09:45:02.167Z] 09:45:02     INFO -      |
[task 2024-08-20T09:45:02.167Z] 09:45:02     INFO -  warning: `webrender_bindings` (lib) generated 1 warning
[task 2024-08-20T09:45:02.167Z] 09:45:02    ERROR -  error: could not compile `webrender_bindings` (lib) due to 1 previous error; 1 warning emitted
[task 2024-08-20T09:45:02.167Z] 09:45:02     INFO -  Caused by:
[task 2024-08-20T09:45:02.170Z] 09:45:02     INFO -    process didn't exit successfully: `CARGO=/builds/worker/fetches/rustc/bin/cargo CARGO_CRATE_NAME=webrender_bindings CARGO_MANIFEST_DIR=/builds/worker/checkouts/gecko/gfx/webrender_bindings CARGO_PKG_AUTHORS='The Mozilla Project Developers' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=MPL-2.0 CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=webrender_bindings CARGO_PKG_README='' CARGO_PKG_REPOSITORY='' CARGO_PKG_RUST_VERSION='' 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/release/deps /builds/worker/fetches/sccache/sccache /builds/worker/fetches/rustc/bin/rustc --crate-name webrender_bindings --edition=2015 gfx/webrender_bindings/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 metadata=775f6e4c6a83be55 -C extra-filename=-775f6e4c6a83be55 --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 app_units=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libapp_units-bd54d80329d8e6fb.rmeta --extern bincode=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libbincode-15566eaa0671b9d7.rmeta --extern dirs=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libdirs-e419beccb17eb0cc.rmeta --extern dwrote=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libdwrote-dbf069116612f3fb.rmeta --extern euclid=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libeuclid-cec9fa929cc81911.rmeta --extern fxhash=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libfxhash-03c354d699b52113.rmeta --extern gecko_profiler=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libgecko_profiler-2d0f8a91cee2970f.rmeta --extern gleam=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libgleam-ba3c78599062ec44.rmeta --extern log=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/liblog-e9c375a436df45ea.rmeta --extern nsstring=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libnsstring-bae694443496be7f.rmeta --extern num_cpus=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libnum_cpus-9b48ed74824220ac.rmeta --extern rayon=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/librayon-521aea77b51997aa.rmeta --extern remove_dir_all=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libremove_dir_all-dc0720e48a91f43b.rmeta --extern static_prefs=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libstatic_prefs-aa43feb5c98b667e.rmeta --extern swgl=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libswgl-e02c7a30660619af.rmeta --extern thin_vec=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libthin_vec-86eebf95064b20eb.rmeta --extern tracy_rs=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libtracy_rs-4209e5a0012c934c.rmeta --extern uuid=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libuuid-047ee481e08f7db0.rmeta --extern webrender=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libwebrender-2e72d304685418dc.rmeta --extern winapi=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libwinapi-e87d9b4e9b183835.rmeta --extern wr_malloc_size_of=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/deps/libwr_malloc_size_of-7a99139fd3cd3413.rmeta -C debuginfo=2 -C force-frame-pointers=yes -C control-flow-guard=yes -Dwarnings -Cembed-bitcode=yes -C codegen-units=1 -L native=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/build/swgl-f7ab0a3256b69856/out -L native=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/build/lmdb-rkv-sys-7d927bbf86a7d3e9/out -L native=/builds/worker/workspace/obj-build/x86_64-pc-windows-msvc/release/build/whatsys-4d318463f4ade4fc/out` (exit status: 1)
[task 2024-08-20T09:45:02.170Z] 09:45:02    ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/makefiles/rust.mk:498: force-cargo-library-build] Error 101
[task 2024-08-20T09:45:02.170Z] 09:45:02     INFO -  gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/toolkit/library/rust'
[task 2024-08-20T09:45:02.170Z] 09:45:02     INFO -  gmake[4]: Target 'target-objects' not remade because of errors.
[task 2024-08-20T09:45:02.171Z] 09:45:02    ERROR -  gmake[3]: *** [/builds/worker/checkouts/gecko/config/recurse.mk:72: toolkit/library/rust/target-objects] Error 2
[task 2024-08-20T09:45:02.171Z] 09:45:02     INFO -  gmake[3]: Target 'recurse_compile' not remade because of errors.
[task 2024-08-20T09:45:02.171Z] 09:45:02    ERROR -  gmake[2]: *** [/builds/worker/checkouts/gecko/config/recurse.mk:34: compile] Error 2
[task 2024-08-20T09:45:02.171Z] 09:45:02    ERROR -  gmake[1]: *** [/builds/worker/checkouts/gecko/config/rules.mk:359: default] Error 2
[task 2024-08-20T09:45:02.171Z] 09:45:02     INFO -  gmake[1]: Entering directory '/builds/worker/workspace/obj-build'
[task 2024-08-20T09:45:02.171Z] 09:45:02     INFO -  /builds/worker/fetches/sccache/sccache --show-adv-stats --stats-format=json > '/builds/worker/artifacts/sccache-stats.json'
[task 2024-08-20T09:45:02.171Z] 09:45:02     INFO -  gmake[1]: Leaving directory '/builds/worker/workspace/obj-build'
Flags: needinfo?(lissyx+mozillians)
Flags: needinfo?(lissyx+mozillians)

weird, how can this fix the --disable-gecko-profiler case and fail build when we have the profiler enabled ... is this feature not exposed?

It's because there is no gecko_profiler feature inside the webrender_bindings crate, it's a feature of gkrust-shared. That's why your cfg will always return false. I think the best way to solve this warning is to remove this import from the top, and directly use the full path inside the marker macro, like:

gecko_profiler::gecko_profiler_category!(Graphics),

(In reply to Nazım Can Altınova [:canova][:canaltinova on phabricator] from comment #6)

It's because there is no gecko_profiler feature inside the webrender_bindings crate, it's a feature of gkrust-shared. That's why your cfg will always return false. I think the best way to solve this warning is to remove this import from the top, and directly use the full path inside the marker macro, like:

gecko_profiler::gecko_profiler_category!(Graphics),

I assumed what was in gkrust-shared was exposed in all xul ?

(In reply to :gerard-majax from comment #7)

I assumed what was in gkrust-shared was exposed in all xul ?

Unfortunately (afaik) you can't share a feature to a crate's dependencies automatically. You can do that manually by creating a new gecko_profiler feature inside webrender_bindings toml and then adding it to this array (like webrender_bindings/gecko_profiler, similar to how we do for the profiler rust-api crate) but that's more work and it means that every other crate has to add this feature manually, which is counter intuitive/productive imho.

Your suggestion works and is simpler for that case, I agree

Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: