Closed Bug 1520393 Opened 5 years ago Closed 5 years ago

Refactor build/moz.configure/memory.configure

Categories

(Firefox Build System :: General, enhancement)

enhancement
Not set
normal

Tracking

(firefox66 fixed)

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(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 mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/9a00f3b44547
Use proper defaults for --enable-jemalloc and --enable-replace-malloc. r=nalexander

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=busted&fromchange=9a00f3b44547afcdec22dc3d5bfe93e41c4ee843&tochange=b88b9b479e6369ffba51abf4d6e4d6844da5002c&selectedJob=222336039

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=222336039&repo=autoland&lineNumber=959

Backout link: https://hg.mozilla.org/integration/autoland/rev/b88b9b479e6369ffba51abf4d6e4d6844da5002c

[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/configure.py", 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/configure.py", line 29, in main
[task 2019-01-17T00:27:40.707Z] 00:27:40 INFO - sandbox.run(os.path.join(os.path.dirname(file), 'moz.configure'))
[task 2019-01-17T00:27:40.707Z] 00:27:40 INFO - File "/builds/worker/workspace/build/src/python/mozbuild/mozbuild/configure/init.py", 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 - client.mk:111: 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 mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/263e45bdcd59
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 mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/d08e4acf1e85
Use proper defaults for --enable-jemalloc and --enable-replace-malloc. r=nalexander
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.