Open Bug 1505283 Opened 7 years ago Updated 2 years ago

Bootstrap should check cbindgen in cargo and suggest uninstalling it

Categories

(Firefox Build System :: Bootstrap Configuration, defect, P4)

defect

Tracking

(Not tracked)

People

(Reporter: arai, Unassigned)

References

Details

(Keywords: in-triage)

After bug 1482923 fixed, cbindgen is now installed under {MOZBUILD_STATE_PATH}/cbindgen/cbindgen, instead of cargo. but the configure script tries to use binary installed by cargo if it exists. and cbindgen in cargo is no more updated, so it's kept outdated and build fails even after running mach bootstrap. Either bootstrap or configure script should warn about it and suggest uninstalling old cbindgen from cargo. (or maybe directly use the cbindgen installed by bootstrap, instead of searching in the PATH)
Keywords: in-triage
Priority: -- → P4
Should we consider having MOZBUILD_STATE_PATH earlier in the search path? Or does that break people wanting to test out compilers in other directories?

For what it's worth, I just spent a good hour or so dealing with cbindgen errors this morning. I believe it was the issue outlined here of a cargo installed cbindgen.

 0:58.16 Traceback (most recent call last):
 0:58.16   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
 0:58.16     "__main__", fname, loader, pkg_name)
 0:58.16   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
 0:58.16     exec code in run_globals
 0:58.16   File "/Users/gregorytatum/dev/gecko/python/mozbuild/mozbuild/action/file_generate.py", line 110, in <module>
 0:58.16     sys.exit(main(sys.argv[1:]))
 0:58.16   File "/Users/gregorytatum/dev/gecko/python/mozbuild/mozbuild/action/file_generate.py", line 70, in main
 0:58.19     ret = module.__dict__[method](output, *args.additional_arguments, **kwargs)
 0:58.19   File "/Users/gregorytatum/dev/gecko/layout/style/RunCbindgen.py", line 28, in generate
 0:58.19     raise TypeError("cbindgen failed: %s" % stderr)
 0:58.19 TypeError: cbindgen failed: ERROR: Couldn't execute `cargo metadata` with manifest "/Users/gregorytatum/dev/gecko/toolkit/library/rust/Cargo.toml": Json(Error("EOF while parsing a value", line: 1, column: 0))
 0:58.19 ERROR: Couldn't generate bindings for /Users/gregorytatum/dev/gecko/toolkit/library/rust.
 0:58.19 Traceback (most recent call last):
 0:58.19   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
 0:58.19     "__main__", fname, loader, pkg_name)
 0:58.19   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
 0:58.19     exec code in run_globals
 0:58.19   File "/Users/gregorytatum/dev/gecko/python/mozbuild/mozbuild/action/file_generate.py", line 110, in <module>
 0:58.19     sys.exit(main(sys.argv[1:]))
 0:58.19   File "/Users/gregorytatum/dev/gecko/python/mozbuild/mozbuild/action/file_generate.py", line 70, in main
 0:58.19     ret = module.__dict__[method](output, *args.additional_arguments, **kwargs)
 0:58.19   File "/Users/gregorytatum/dev/gecko/layout/style/RunCbindgen.py", line 28, in generate
 0:58.19     raise TypeError("cbindgen failed: %s" % stderr)
 0:58.19 TypeError: cbindgen failed: ERROR: Couldn't execute `cargo metadata` with manifest "/Users/gregorytatum/dev/gecko/toolkit/library/rust/Cargo.toml": Json(Error("EOF while parsing a value", line: 1, column: 0))
 0:58.19 ERROR: Couldn't generate bindings for /Users/gregorytatum/dev/gecko/toolkit/library/rust.
 0:58.19 make[4]: *** [.deps/ServoStyleConsts.h.stub] Error 1
 0:58.19 make[4]: *** Waiting for unfinished jobs....
 0:58.20 make[4]: *** [.deps/webrender_ffi_generated.h.stub] Error 1
 0:58.20 make[3]: *** [gfx/webrender_bindings/export] Error 2
 0:58.20 make[3]: *** Waiting for unfinished jobs....
 0:58.20 security/ct/tests/gtest/rsa-signer-ec-spki-sth.inc.stub
 0:58.20 media/libdav1d/8bd_looprestoration_tmpl.c.stub
 0:58.26 security/ct/tests/gtest/ec-signer-rsa-spki-sth.inc.stub
 0:58.26 media/libdav1d/8bd_lr_apply_tmpl.c.stub
 0:58.49 media/libdav1d/8bd_mc_tmpl.c.stub
 0:58.53 media/libdav1d/8bd_recon_tmpl.c.stub
 1:01.70 make[3]: *** [layout/style/export] Error 2
 1:18.25 make[2]: *** [export] Error 2
 1:18.25 make[1]: *** [default] Error 2
 1:18.25 make: *** [build] Error 2
 1:18.28 0 compiler warnings present.```

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: General → Bootstrap Configuration
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.