Closed Bug 1663841 Opened 5 years ago Closed 3 years ago

Failure to compile on Windows debug

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: jya, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Didn't pull from central in 2 weeks following PTO.

It no longer build for me.

 0:29.17   = note: lld-link: error: undefined symbol: __declspec(dllimport) _CrtDbgReport
 0:29.17           >>> referenced by C:\Users\jyavenard\Work\Mozilla\gecko\third_party\rust\glslopt\glsl-optimizer\src\compiler\glsl\lower_precision.cpp:716
 0:29.17           >>>               libglslopt-5e51d66771817707.rlib(lower_precision.o):(bool __cdecl lower_precision(struct exec_list *))
 0:29.17           >>> referenced by C:\Users\jyavenard\Work\Mozilla\gecko\third_party\rust\glslopt\glsl-optimizer\src\compiler\glsl\lower_precision.cpp:716
 0:29.17           >>>               libglslopt-5e51d66771817707.rlib(lower_precision.o):(bool __cdecl lower_precision(struct exec_list *))
 0:29.17           >>> referenced by C:\Users\jyavenard\Work\Mozilla\gecko\third_party\rust\glslopt\glsl-optimizer\src\compiler\glsl\lower_precision.cpp:187
 0:29.17           >>>               libglslopt-5e51d66771817707.rlib(lower_precision.o):(public: static void __cdecl `anonymous namespace'::find_lowerable_rvalues_visitor::stack_enter(class ir_instruction *, void *))
 0:29.17           >>> referenced 15 more times
 0:29.17           lld-link: error: undefined symbol: __declspec(dllimport) _invalid_parameter
 0:29.17           >>> referenced by C:\Users\jyavenard\Work\Mozilla\gecko\third_party\rust\glslopt\glsl-optimizer\src\compiler\glsl\lower_precision.cpp:716
 0:29.17           >>>               libglslopt-5e51d66771817707.rlib(lower_precision.o):(bool __cdecl lower_precision(struct exec_list *))
 0:29.17           >>> referenced by C:\Users\jyavenard\Work\Mozilla\gecko\third_party\rust\glslopt\glsl-optimizer\src\compiler\glsl\lower_precision.cpp:716
 0:29.17           >>>               libglslopt-5e51d66771817707.rlib(lower_precision.o):(bool __cdecl lower_precision(struct exec_list *))
 0:29.17           >>> referenced by C:\Users\jyavenard\Work\Mozilla\gecko\third_party\rust\glslopt\glsl-optimizer\src\compiler\glsl\lower_precision.cpp:187
 0:29.17           >>>               libglslopt-5e51d66771817707.rlib(lower_precision.o):(public: static void __cdecl `anonymous namespace'::find_lowerable_rvalues_visitor::stack_enter(class ir_instruction *, void *))
 0:29.17           >>> referenced 15 more times

Reverting bug 1661045 and bug 1659066, allows to compile

I would guess this is from bug 1659066 rather than 1661045. Mike, is there an additional thing we need to #define in glslopt's build.rs to prevent it try to link to these symbols, or an additional library we need to add to find them?

Flags: needinfo?(mh+mozilla)

I don't reproduce. What's your mozconfig?

Flags: needinfo?(mh+mozilla) → needinfo?(jyavenard)

(In reply to Jamie Nicol [:jnicol] from comment #1)

I would guess this is from bug 1659066 rather than 1661045. Mike, is there an additional thing we need to #define in glslopt's build.rs to prevent it try to link to these symbols, or an additional library we need to add to find them?

No, I was getting the linkage error with just 1661045 reverted.

Flags: needinfo?(jyavenard)

(In reply to Mike Hommey [:glandium] from comment #2)

I don't reproduce. What's your mozconfig?

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj-ff-dbg

ac_add_options --target=x86_64-pc-mingw32
ac_add_options --host=x86_64-pc-mingw32

ac_add_options --enable-debug
ac_add_options --enable-debug-symbols
ac_add_options --enable-eme=widevine
ac_add_options --enable-rust-debug

#disable jemalloc for debugging memory overwrite
ac_add_options --disable-jemalloc

ac_add_options --disable-launcher-process
ac_add_options --disable-sandbox

#remove if too slow
ac_add_options --disable-optimize

mk_add_options 'export CARGO_INCREMENTAL=1'

ac_add_options --with-ccache=c:/Users/jyavenard/.mozbuild/sccache/sccache.exe

I still can't reproduce. Try with SCCACHE_RECACHE=1, or disabling sccache.

Flags: needinfo?(jyavenard)

I use VS 2017 if that's something that matters.

(In reply to Mike Hommey [:glandium] from comment #5)

I still can't reproduce. Try with SCCACHE_RECACHE=1, or disabling sccache.

Nope.

Still the same linkage error :(

VS2017, ./mach bootstrap made as of this morning.
tried both with SCCACHE_RECACHE=1 and removing sccache config from mozbuild

I see that the bug with VS2019 has now been fixed, I may just revert to that instead.

Flags: needinfo?(jyavenard)

Installed VS2019, tried again. and same error :(

Attached file build.log

Full log after clearing sccache , uninstalling VS2017, installing VS2019, deleted ~/.rustup ~/.mozbuild ~/.cargo

line 2608 is the linkage error.

Attached file mozconfig
Attachment #9175453 - Attachment mime type: application/octet-stream → application/text-plain
Attachment #9175453 - Attachment mime type: application/text-plain → text/plain
Attachment #9175452 - Attachment mime type: application/octet-stream → text/plain

0:28.68 checking rustc version... 1.46.0

CI is currently using 1.43.0, can you try that?

Ok, I can confirm that the line causing the issue is:
ac_add_options --disable-optimize

Commenting this one and it compiles.

(In reply to :dmajor from comment #11)

0:28.68 checking rustc version... 1.46.0

CI is currently using 1.43.0, can you try that?

this didn't help.

0:59.99 js/src> checking for rustc... c:/Users/jyavenard/.cargo/bin/rustc.exe
0:60.00 js/src> checking for cargo... c:/Users/jyavenard/.cargo/bin/cargo.exe
1:00.07 js/src> Actually using 'C:\Users\jyavenard.rustup\toolchains\1.43.0-x86_64-pc-windows-msvc\bin\rustc.exe'
1:00.16 js/src> Actually using 'C:\Users\jyavenard.rustup\toolchains\1.43.0-x86_64-pc-windows-msvc\bin\cargo.exe'
1:00.18 js/src> checking rustc version... 1.43.0
1:00.20 js/src> checking cargo version... 1.43.0

I can only compile if the option ac_add_options --disable-optimize isn't used.

looks like I also need to remove ac_add_options --disable-jemalloc

It's weird, because I got a compilation success with this one once. Or maybe I just didn't fully clobber between two builds.

Anyhow, after dozens of clobber/build

the issue is with ac_add_options --enable-rust-debug

I don't know if this is still necessary for debugging rust code from C++. for now I can remove that

Has Regression Range: --- → yes

We have no-opt builds now on automation, so I suppose this is not a problem anymore.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: