Closed Bug 1520393 Opened 2 years ago Closed 2 years ago

Refactor build/moz.configure/memory.configure


(Firefox Build System :: General, enhancement)

Not set


(firefox66 fixed)

Tracking Status
firefox66 --- fixed


(Reporter: glandium, Assigned: glandium)


(Blocks 1 open bug)



(1 file)

No description provided.
Back when those were added, option defaults could not indirectly depend
on `target` or `host`, but that changed with bug 1322025.

As a side effect, this allows to turn them into straight js_options
without resorting to the manual add_old_configure_arg.
Blocks: 1520395
Pushed by
Use proper defaults for --enable-jemalloc and --enable-replace-malloc. r=nalexander

Push with failures:

Failure log:

Backout link:

[task 2019-01-17T00:27:40.703Z] 00:27:40 INFO - checking whether the target C compiler can be used... yes
[task 2019-01-17T00:27:40.706Z] 00:27:40 ERROR - Traceback (most recent call last):
[task 2019-01-17T00:27:40.707Z] 00:27:40 INFO - File "/builds/worker/workspace/build/src/", line 123, in <module>
[task 2019-01-17T00:27:40.707Z] 00:27:40 INFO - sys.exit(main(sys.argv))
[task 2019-01-17T00:27:40.707Z] 00:27:40 INFO - File "/builds/worker/workspace/build/src/", line 29, in main
[task 2019-01-17T00:27:40.707Z] 00:27:40 INFO -, 'moz.configure'))
[task 2019-01-17T00:27:40.707Z] 00:27:40 INFO - File "/builds/worker/workspace/build/src/python/mozbuild/mozbuild/configure/", line 444, in run
[task 2019-01-17T00:27:40.707Z] 00:27:40 INFO - implied_option.caller[2]))
[task 2019-01-17T00:27:40.707Z] 00:27:40 INFO - mozbuild.configure.ConfigureError: --enable-jemalloc, emitted from /builds/worker/workspace/build/src/toolkit/moz.configure line 108, is unknown.
[task 2019-01-17T00:27:40.743Z] 00:27:40 INFO - *** Fix above errors and then restart with
[task 2019-01-17T00:27:40.743Z] 00:27:40 INFO - "./mach build"
[task 2019-01-17T00:27:40.743Z] 00:27:40 INFO - recipe for target 'configure' failed
[task 2019-01-17T00:27:40.743Z] 00:27:40 INFO - make: *** [configure] Error 1
[task 2019-01-17T00:27:40.814Z] 00:27:40 ERROR - Return code: 2
[task 2019-01-17T00:27:40.814Z] 00:27:40 WARNING - setting return code to 2
[task 2019-01-17T00:27:40.814Z] 00:27:40 FATAL - 'mach build -v' did not run successfully. Please check log for errors.
[task 2019-01-17T00:27:40.814Z] 00:27:40 FATAL - Running post_fatal callback...
[task 2019-01-17T00:27:40.814Z] 00:27:40 FATAL - Exiting -1

Flags: needinfo?(mh+mozilla)

The problem is that the use of --enable-jemalloc in a when makes it handled before implied options can be handled, so by the time the imply_option('--enable-jemalloc', dmd) runs, --enable-jemalloc is not allowed anymore :( This is a flaw in the way things run in the sandbox and would need some rearchitecturing. In the meanwhile, I guess we can rewrite this without a when='--enable-jemalloc' or when=something_that_depends_on_it.

Flags: needinfo?(mh+mozilla)

Aha! in fact the problem is not with when, but with the fact that the default for --enable-replace-malloc has a dependency on --enable-jemalloc. Which would also require some refactoring to be allowed.

BUT, since --enable-replace-malloc was made when='--enable-jemalloc', the default has an implicit dependency on --enable-jemalloc, so it doesn't need an explicit one! So just removing the --enable-jemalloc dependency from replace_malloc_default solves the problem. Considering how trivial this is, I'll just reland without a new round of review.

Pushed by
Use proper defaults for --enable-jemalloc and --enable-replace-malloc. r=nalexander

Aha! there's a bug in how when is handled. Will file it separately.

Flags: needinfo?(mh+mozilla)

Filed bug 1520718.

Depends on: 1520718
Pushed by
Use proper defaults for --enable-jemalloc and --enable-replace-malloc. r=nalexander
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.