Closed Bug 1000726 Opened 8 years ago Closed 8 years ago

Add support for -Zi -Fd in sccache

Categories

(Firefox Build System :: General, defect)

All
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla32

People

(Reporter: glandium, Assigned: glandium)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Currently, sccache relies on -Z7 on windows, which puts debug info in the object file, while we normally use -Zi in firefox build.
Blocks: 1000713
Depends on: 1000730
Assignee: nobody → mh+mozilla
Attachment #8411595 - Flags: review?(mshal)
Comment on attachment 8411595 [details] [diff] [review]
Add support for -Zi -Fd with MSVC

>+        # -Fd is not taken into account unless -Zi is given
>+        if debug_info:
>+            # -Zi without -Fd defaults to vcxxx.pdb (where xxx depends on the
>+            # MSVC version), and that's used for all compilations with the same
>+            # working directory. We can't cache such a pdb.
>+            if not pdb:
>+                raise CannotCacheError()
>+            output['pdb'] = pdb

Why can't we cache the default vcxxx.pdb, but -Fdgenerated.pdb (from config/rules.mk) is ok? Isn't that also used for all compilations in the same directory?

>+        may_cache = True
>+        if 'pdb' in parsed_args['output']:
>+            pdb = parsed_args['output']['pdb']
>+            pdb = os.path.join(cwd, pdb) if cwd else pdb
>+            # If the pdb exists, we don't know if it's shared with another
>+            # compilation, and if it is, we can't cache. Sadly, this is racy.
>+            if os.path.exists(pdb):
>+                may_cache = False

I'm a bit confused between this and the above code. If we let -Fdgenerated.pdb through, does that mean that the first .cpp file in a directory that gets compiled will pull generated.pdb from the cache? And then all other files in the directory will see that generated.pdb already exists, and force a recompile since may_cache=False?
(In reply to Michael Shal [:mshal] from comment #2)
> I'm a bit confused between this and the above code. If we let
> -Fdgenerated.pdb through, does that mean that the first .cpp file in a
> directory that gets compiled will pull generated.pdb from the cache? And
> then all other files in the directory will see that generated.pdb already
> exists, and force a recompile since may_cache=False?

yes.
Attachment #8411595 - Flags: review?(mshal) → review+
Blocks: 1002614
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.