Closed Bug 1485396 Opened 6 years ago Closed 6 years ago

Can't disable unified compilation when enabling the CompileDB backend

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: bbouvier, Assigned: bbouvier)

Details

Attachments

(1 file)

STR:

- set FILES_PER_UNIFIED_FILE = 1 js/src/moz.build
- try to build the JS shell after configuring with this line:

/code/mozilla-inbound/js/src/configure \
    --enable-debug \
    --disable-optimize \
    --with-ccache \
    --without-intl-api \
    --enable-linker=lld \
    --enable-build-backends=CompileDB,RecursiveMake

Observed:

There's an error that clearly indicates an issue because of CompileDB (note the file name of the file where the error occurs):

Traceback (most recent call last):
  File "/home/ben/mozilla/repo/js/src/../../configure.py", line 123, in <module>
    sys.exit(main(sys.argv))
  File "/home/ben/mozilla/repo/js/src/../../configure.py", line 34, in main
    return config_status(config)
  File "/home/ben/mozilla/repo/js/src/../../configure.py", line 118, in config_status
    return config_status(args=[], **encode(sanitized_config, encoding))
  File "/home/ben/mozilla/repo/python/mozbuild/mozbuild/config_status.py", line 146, in config_status
    the_backend.consume(definitions)
  File "/home/ben/mozilla/repo/python/mozbuild/mozbuild/backend/base.py", line 128, in consume
    if (not self.consume_object(obj) and
  File "/home/ben/mozilla/repo/python/mozbuild/mozbuild/compilation/database.py", line 56, in consume_object
    consumed = CommonBackend.consume_object(self, obj)
  File "/home/ben/mozilla/repo/python/mozbuild/mozbuild/backend/common.py", line 158, in consume_object
    self._process_unified_sources(obj)
  File "/home/ben/mozilla/repo/python/mozbuild/mozbuild/compilation/database.py", line 131, in _process_unified_sources
    for f in obj.unified_source_mapping:
AttributeError: unified_source_mapping
Attached patch fix.patchSplinter Review
I've cargo-culted what the other backends do, and it seems to work fine.
Assignee: nobody → bbouvier
Status: NEW → ASSIGNED
Attachment #9003401 - Flags: review?(nfroyd)
Comment on attachment 9003401 [details] [diff] [review]
fix.patch

Review of attachment 9003401 [details] [diff] [review]:
-----------------------------------------------------------------

Seems reasonable, r=me assuming the answer to the below is affirmative.

::: python/mozbuild/mozbuild/compilation/database.py
@@ +128,5 @@
>      def _process_unified_sources(self, obj):
> +        if not obj.have_unified_mapping:
> +            for f in list(sorted(obj.files)):
> +                self._build_db_line(obj.objdir, obj.relsrcdir, obj.config, f,
> +                                    obj.canonical_suffix)

Just to confirm here, if FILES_PER_UNIFIED_FILE is 1, we don't actually generate the Unified*.cpp files, and just use the "regular" .cpp files?  So this line correctly uses the files the compiler actually compiles?
Attachment #9003401 - Flags: review?(nfroyd) → review+
Pushed by bbouvier@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7e63c084f309
Handle non-unified builds for CompileDB too; r=froydnj
https://hg.mozilla.org/mozilla-central/rev/7e63c084f309
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: