Commit Graph

103 Commits

Author SHA1 Message Date
Ted Mielczarek
44a6436fb8 bug 1255485 - build PROGRAMs directly in dist/bin instead of copying them. r=nalexander
Historically we built all our binaries in directories in the objdir, then
symlinked them into dist/bin. Some binaries needed to be copied instead
so that certain relative path lookups work properly, so we resorted to
sprinkling `NSDISTMODE=copy` around Makefiles.

This change makes it so we build PROGRAMs (not any other sort of targets)
directly in dist/bin instead. We could do the same for our other targets
with a little more work.

There were several places in the tree that were copying built binaries to
some other place and needed fixup to match the new location of binaries.

On Windows pdb files are left in the objdir where the program was
originally linked. symbolstore.py needs to locate the pdb file both to
determine whether it should dump symbols for a binary and also to copy
the pdb file into the symbol package. We fix this by simply looking for
the pdb file in the current working directory if it isn't present next
to the binary, which matches how we invoke symbolstore.py.

MozReview-Commit-ID: 8TOD1uTXD5e
2018-01-10 14:26:12 -05:00
Mike Hommey
4b96ec0d30 Bug 1434453 - Use the full changeset in breakpad symbols. r=nalexander
For consistency with when MOZ_SOURCE_CHANGESET is set, and because while
slim, there is a chance of conflict with short forms that don't exist
with the full form that could bite us in the long run.
2018-02-01 10:52:58 +09:00
Gurzau Raul
ebeea06a65 Backed out 5 changesets (bug 1255485) for mochitest failures on test/mochitest/test_hangui.xul
Backed out changeset 90b7449882b6 (bug 1255485)
Backed out changeset 5672cf8d324b (bug 1255485)
Backed out changeset ed6dd4aefadb (bug 1255485)
Backed out changeset 0ba36c0feddb (bug 1255485)
Backed out changeset 51af06b6123c (bug 1255485)
2018-01-23 02:01:43 +02:00
Ted Mielczarek
47e236d7d3 bug 1255485 - build PROGRAMs directly in dist/bin instead of copying them. r=nalexander
Historically we built all our binaries in directories in the objdir, then
symlinked them into dist/bin. Some binaries needed to be copied instead
so that certain relative path lookups work properly, so we resorted to
sprinkling `NSDISTMODE=copy` around Makefiles.

This change makes it so we build PROGRAMs (not any other sort of targets)
directly in dist/bin instead. We could do the same for our other targets
with a little more work.

There were several places in the tree that were copying built binaries to
some other place and needed fixup to match the new location of binaries.

On Windows pdb files are left in the objdir where the program was
originally linked. symbolstore.py needs to locate the pdb file both to
determine whether it should dump symbols for a binary and also to copy
the pdb file into the symbol package. We fix this by simply looking for
the pdb file in the current working directory if it isn't present next
to the binary, which matches how we invoke symbolstore.py.

MozReview-Commit-ID: 8TOD1uTXD5e
2018-01-10 14:26:12 -05:00
Nathan Froyd
d562522c74 Bug 1401226 - don't throw away errors from running file in symbolstore.py; r=ted.mielczarek
We want symbolstore.py to fail, preferably loudly, if we can't find the
necessary tools, and throwing away errors here runs counter to that
goal.  Dumper is a base class for Dumper_Win32, where we probably don't
have file(1), but Dumper_Win32 shouldn't be calling RunFileCommand.
2017-11-09 13:52:47 -04:00
David Major
6b0906ff8d Bug 1405713 - Reorder sourcepath normalization to fix srcsrv. r=ted 2017-10-10 09:19:00 -04:00
Ted Mielczarek
64e8dc5996 bug 1392312 - fix filename mapping in symbolstore.py on Windows. r=chmanchester
symbolstore.py processes filenames in FILE lines of symbol files to encode
information about the source repository they came from, or to mark
known generated source files. It also reads the dist/include install
manifest so it can map header files from there back to their source locations.

These mappings were broken on Windows because symbolstore.py first passes
filenames into `FixFilenameCase`, which calls `GetFinalPathNameByHandleW`,
which breaks things in two ways:
1) It returns paths with an uppercase drive letter, and source paths from
   elsewhere have a lowercase drive letter.
2) It resolves symlinks, and on Taskcluster Windows builds the whole build
   is done within a symlinked directory so paths directly from the srcdir
   and objdir won't match those canonicalized paths.

This patch adds a `normpath` function to symbolstore.py and moves the
contents of `FixFilenameCase` into it on Windows, and just makes it
an alias for `os.path.normpath` everywhere else. It then uses it everywhere
we deal with paths that will be compared against source file paths from symbol
files so that all paths are canonicalized the same and we can do simple
string matching from there.

Additionally, this patch adds a check to the functional test to verify
that header files from dist/include are correctly mapped to the source
repository. Unfortunately there is still not a test for generated files
because they only appear in the libxul symbol file, and dumping symbols
from libxul is too slow to invoke as part of a unit test.

MozReview-Commit-ID: Dx3z1BZcIvc
2017-08-23 13:14:37 -04:00
Ted Mielczarek
1792106136 bug 1259832 - replace generated source file names in symbol files. r=chmanchester
Now that builds are uploading generated source files to an S3 bucket,
symbolstore.py can alter the FILE lines in symbol files to record the
URLs where those generated source files can be found. We currently record
files from the hg repository as `hg:<repo>:<path>:<revision>`, so here we
record generated files as `s3:<bucket>:<path>:` and expect that Socorro
will map that to the S3 bucket in a sensible way.

This patch does not change source server indexing, which allows Microsoft
debuggers to fetch source files for a build. That will be handled in a
followup.

MozReview-Commit-ID: 1g14smF0fo8
2017-08-09 14:36:52 -04:00
Ted Mielczarek
84b3dc1ede bug 1388820 - remove repo manifest support from symbolstore.py. r=chmanchester
MozReview-Commit-ID: LbDc6YKGpqX
2017-08-09 13:36:07 -04:00
Wes Kocher
36250dc5a4 Backed out changeset 6b4f89f34b11 (bug 1388820) for apparently scheduling nightlies on every push/platform a=backout
MozReview-Commit-ID: GtNGyHS3m7f
2017-08-16 17:26:21 -07:00
Wes Kocher
2d6c41ece5 Backed out 4 changesets (bug 1259832) for apparently scheduling nightlies on every push/platform a=backout
Backed out changeset 7781a37a4db0 (bug 1259832)
Backed out changeset 73bf88110b38 (bug 1259832)
Backed out changeset 14d18d7cf454 (bug 1259832)
Backed out changeset a02695cbf576 (bug 1259832)

MozReview-Commit-ID: 4Tf6jBcvKLq
2017-08-16 17:26:08 -07:00
Ted Mielczarek
ebf095a598 bug 1259832 - replace generated source file names in symbol files. r=chmanchester
Now that builds are uploading generated source files to an S3 bucket,
symbolstore.py can alter the FILE lines in symbol files to record the
URLs where those generated source files can be found. We currently record
files from the hg repository as `hg:<repo>:<path>:<revision>`, so here we
record generated files as `s3:<bucket>:<path>:` and expect that Socorro
will map that to the S3 bucket in a sensible way.

This patch does not change source server indexing, which allows Microsoft
debuggers to fetch source files for a build. That will be handled in a
followup.

MozReview-Commit-ID: 1g14smF0fo8
2017-08-09 14:36:52 -04:00
Ted Mielczarek
d25dc7911d bug 1388820 - remove repo manifest support from symbolstore.py. r=chmanchester
MozReview-Commit-ID: LbDc6YKGpqX
2017-08-09 13:36:07 -04:00
Ralph Giles
0192a559e5 Bug 1385503 - Correct rust srcdir url again. r=gps
The 'src' subdir needs to be part of the path *after*
the blob/commit_id section of the url, so we need to
no strip it from the prefix when we match.

MozReview-Commit-ID: 9HA3a7d8kh4
2017-07-28 17:04:39 -07:00
Chris Manchester
8e1835bde2 Bug 1304042 - Fail the build if running dsymutil fails. r=mshal
MozReview-Commit-ID: 9ROIRpuoVGR
2017-07-13 11:57:50 -07:00
Ralph Giles
8dc95dd9b9 Bug 1379382 - Correct rust srcdir url. r=gps
We were prefix-matching the rust srcdir when hyperlinking
symbols, but then appending the relative source path to
the top level repo url, resulting in broken links.

Instead, link to the srcdir url at github.

MozReview-Commit-ID: 33tSMM96Vie
2017-07-08 08:00:27 -07:00
Ted Mielczarek
aa5c56ad8d bug 1275424 - hardcode Rust source paths in symbolstore.py. r=gps
This gives us source file names with repository info in our generated
symbol files, so that crash reports on crash-stats can link to the
correct source files for files from the Rust standard library.

I've hardcoded the source paths that the Rust project uses, which is
not my favorite thing, but there's no simple way to get this information
otherwise.

MozReview-Commit-ID: 6SeaMqH8xfc
2017-06-23 16:19:49 -04:00
Chris Manchester
2164601a78 Bug 1353090 - Remove code handling multiple files from symbolstore.py r=ted
MozReview-Commit-ID: 2vOP8iqYDW7
2017-04-26 22:32:27 -07:00
Chris Manchester
3590dcf431 Bug 1353090 - Convert output to use print in symbolstore.py r=ted
MozReview-Commit-ID: 4eoDTf9lX5w
2017-04-26 22:32:26 -07:00
Chris Manchester
05a9902f4a Bug 1337986 - Remove code handling parallelism from symbolstore.py r=ted
This removes handling of dumping symbols in parallel from symbolstore.py
and updates unit tests.
A prior commit made symbolstore.py handle a single file at a time, leaving
concurrency to be handled by make, so this is no longer needed.

MozReview-Commit-ID: C7IHdVHHjRH
2017-04-10 10:27:49 -07:00
Chris Manchester
dd7cb62d32 Bug 1337986 - Dump symbols during the compile tier. r=ted
This commit moves symbol dumping to the compile tier, to be run via "syms"
targets. Tracking files are used for the sake of incremental builds, because
dump_syms may genearate multiple outputs whose paths are not known ahead of
time.

Minimal changes to symbolstore.py are made here. More extensive
simplifications will be made in a future commit on the basis of symbolstore.py
handling one file at a time.

MozReview-Commit-ID: 3mOP8A6Y7iM
2017-02-10 08:34:08 -08:00
Chris Manchester
7c2f9c209a Bug 1337986 - Modify symbolstore.py to operate on dll/exe files. r=ted
This will be more convenient when we dump symbols from the compile tier.

MozReview-Commit-ID: Ltjq8ai5j0m
2017-04-10 10:27:49 -07:00
Ted Mielczarek
99aea7d239 bug 1329320 - replace makecab with rust-makecab in symbolstore. r=gps
It turns out that running makecab to compress PDB files takes a significant
amount of time in the buildsymbols step. I wrote an implementation of
makecab in Rust that implements only the subset of features we use and
it's significantly faster:
https://github.com/luser/rust-makecab

This patch adds a makecab check to moz.configure, adds a release build of
the makecab binary to the Windows tooltool manifests, points the build at
it from mozconfig.win-common, and changes symbolstore.py to use MAKECAB
from substs instead of calling `makecab.exe` directly.

MozReview-Commit-ID: 76FHLIZFCXS
2017-01-06 05:57:10 -05:00
Ted Mielczarek
a8b1dab074 bug 1316329 - follow symlinks for srcdir path in symbol dumping on windows. r=gps
If the srcdir is in a path containing a symlink on Windows, when
`FixFilenameCase` calls `GetFinalPathNameByHandleW` to normalize the case of
a source file it will get a path to the file with the symlink resolved.
This breaks our "is this file in the source repository" check.

This patch makes the code call `FixFilenameCase` for any srcdir arguments
that are passed to the script, so any symlinks will be resolved there
and the prefix matching will work.

MozReview-Commit-ID: 2UibW9XYWoK
2016-11-22 14:41:57 -05:00
Gregory Szorc
97d11f5f63 Bug 1307435 - Change compression level of symbols files; r=ted
Currently, we use the gzip default of 6. Our history with zlib tells
us that reducing the compression level to 5 or 4 often yields
significantly faster operations while only sacrificing a little
storage. Measurement here shows similar results.

On libxul.so.dbg:

level      time      compressed
6          21.0s     231,045,158
5          15.8s     232,926,435
4          12.2s     237,587,011
3          11.1s     245,104,157

Changing the level from 6 to 4 increases the size of the compressed
file by 6,541,853 bytes, or 2.83%. But it saves ~10s from the long
pole of builds in automation. And that's just from libxul.

When you factor in all compressed files, this change has a significant
impact on symbol generation.

Before: 221s wall; 150s CPU; 311,424,856 bytes
After:  192s wall; 130s CPU; 318,085,885 bytes

That's on my machine, which has a 4.0 GHz CPU. CPU time savings in
automation will likely be more significant.

MozReview-Commit-ID: 7CbRSZvUayj
2016-10-04 06:16:29 -07:00
Gregory Szorc
bd9a1a8187 Bug 1279048 - Check MOZ_SOURCE_REPO for repository URL; r=ted
MOZ_SOURCE_REPO is set by automation to indicate the URL of the current
repository. I'm not sure what SRCSRV_ROOT is from. Probably legacy.

Use MOZ_SOURCE_REPO instead of SRCSRV_ROOT.

MozReview-Commit-ID: IfCSiaqgJb5
2016-06-08 14:54:58 -07:00
Wes Kocher
9c2f15b1a5 Backed out changeset 229cd3b8bf5d (bug 1279048) for build bustage CLOSED TREE 2016-07-08 12:02:33 -07:00
Gregory Szorc
5e170a1816 Bug 1279048 - Check MOZ_SOURCE_REPO for repository URL; r=ted
MOZ_SOURCE_REPO is set by automation to indicate the URL of the current
repository. I'm not sure what SRCSRV_ROOT is from. Probably legacy.

Use MOZ_SOURCE_REPO instead of SRCSRV_ROOT.

MozReview-Commit-ID: IfCSiaqgJb5
2016-06-08 14:54:58 -07:00
Gregory Szorc
9ead7f37b4 Bug 1275672 - Remove accidental trailing /D from makecab.exe arguments; r=me
This was causing the "path" argument to get swallowed because makecab.exe
thought it was the argument to /D. Derp.

MozReview-Commit-ID: 6Bd3l7ISsPj
2016-05-31 09:09:03 -07:00
Gregory Szorc
718f8bb167 Bug 1275672 - Change symbols compression format to MSZIP; r=ted
makecab.exe has 3 options for compression: disable, MSZIP, and LZX.

Here is a breakdown of the 3 levels of compression for an opt 32-bit
build on my i7-6700K:

       directory size     full.zip   xul.pd_  `buildsymbols`
None     1,360 MB          227 MB     146 MB        49s
MSZIP      520 MB          221 MB     142 MB       113s
LZX        436 MB          169 MB     102 MB       248s

(The original size of xul.pdb is ~500 MB.)

This commit switches us to MSZIP as the compression format. This
makes `builsymbols` >2x faster while only increasing the full zip
archive size by ~31%. This feels like an appropriate trade-off.

The memory related flag has been removed because it only applies
to LZX compression.

It's worth noting that using `zip` to compress xul.pdb and xul.sym:

Level  Zip Size    xul.pdb Compressed   Time
9        160.6 MB      139.8 MB         76s
7        161.4 MB      140.5 MB         30s
5        164.7 MB      143.2 MB         16s
4        170.0 MB      147.3 MB         12s
3        176.4 MB      151.6 MB         11s

So "MSZIP" compression appears to be using level 9. If we could swap
in our own cab generator that uses a zlib compression level less
than 9, we'll make symbol generation significantly faster without
sacrificing too much size. I'm inclined to punt that to a follow-up
bug.

MozReview-Commit-ID: GbbClkn9PLN
2016-05-27 16:03:58 -07:00
Ted Mielczarek
adb16799fc bug 1156300 - symbolstore.py FixFilenameCase doesn't fix up directory names. r=gps
MozReview-Commit-ID: 2nEaouS1oHD
2016-04-11 08:53:42 -04:00
Ted Mielczarek
ed5c22bc25 bug 1069556 - sync to Breakpad c53ed143108948eb7e2d7ee77dc8c0d92050ce7c. r=glandium, benwa
This commit contains a few things:
* Update our copy of google-breakpad to upstream c53ed143108948eb7e2d7ee77dc8c0d92050ce7c
* Get rid of all but one local patch, fold a few related local patches into one
* Misc build fixup to sync with upstream--adding a few new moz.build files,
  source files
* The final bits of unhooking Breakpad from the profiler:
** Revert to only building toolkit/crashreporter if MOZ_CRASHREPORTER.
** Stop building bits of Breakpad that we only needed for the profiler.
** Remove a few bits of profiler code that were used to interface with Breakpad.
** Remove toolkit/crashreporter/breakpad-logging, which was only used to
   suppress Breakpad logging for the in-process stackwalker.
* Upstream removed their Android-compat sys/ucontext.h because the Android NDK
  added it, but the bionic we're using for Gonk builds is too old, so add a
  copy of the previous version of those files to
  toolkit/crashreporter/gonk-include to keep Gonk building.
* Consolidate moz.build files under toolkit/crashreporter/google-breakpad/client/linux
2016-01-27 09:39:53 -05:00
Gregory Szorc
93539c1e33 Bug 1207871 - Process files in descending file size order; r=ted
Large files take longer to process. Scheduling large files after smaller
files means there is a higher chance a large file may be a long pole
during processing.

This commit changes the scheduling logic to exhaustively obtain the set
of files to be processed. It then sorts them by descending file size and
schedules them in the resulting order, thus minimizing the chances for a
large file to be the long pole holding up processing completion.

On my machine this doesn't change wall execution time. However,
automation may be different. And the logic of the new behavior is sound.
2015-09-23 22:26:41 -04:00
Gregory Szorc
8fe2a5cb6e Bug 1175632 - Record how long each symbol file took to process; r=ted
As part of this an unused import was removed.
2015-10-26 15:58:15 -04:00
Ted Mielczarek
a1730b2850 bug 1217051 - Pipe dump_syms stderr to /dev/null. r=catlee 2015-10-21 12:54:16 -04:00
Ted Mielczarek
be6d8b059e bug 543111 - fix symbolstore.py to work properly for cross-compiled mac builds on linux. r=gps 2015-09-22 08:00:34 -04:00
Carsten "Tomcat" Book
49fb034d50 Backed out 4 changesets (bug 543111) for mac bustage on a CLOSED TREE
Backed out changeset 81f6fdc25862 (bug 543111)
Backed out changeset d1a73eaa6113 (bug 543111)
Backed out changeset 08c7f9ed5970 (bug 543111)
Backed out changeset 3b323ed3b20a (bug 543111)
2015-10-01 14:32:11 +02:00
Ted Mielczarek
8e75cbb955 bug 543111 - fix symbolstore.py to work properly for cross-compiled mac builds on linux. r=gps 2015-09-22 08:00:34 -04:00
Ted Mielczarek
5f7a9ee3fd bug 1164816 - Rewrite symbolstore.py to use concurrent.futures. r=gps
CLOSED TREE
2015-05-13 14:50:11 -04:00
Ted Mielczarek
36eecef232 bug 1164816 - Refactor symbolstore.py to remove WorkerInitializer. r=gps
concurrent.futures doesn't have a WorkerInitializer equivalent to what
multiprocessing.Pool has, so refactor things slightly to remove that dependency.
2015-05-13 14:14:08 -04:00
Ted Mielczarek
1c303cefa6 bug 528092 - Supply binaries from the symbol server. r=gps 2015-05-13 17:43:19 -04:00
Ted Mielczarek
2aacd69300 bug 1076848 - fix source server indexing for headers from dist/include. r=dmajor 2015-05-07 07:11:27 -04:00
Phil Ringnalda
ec3b0ffab5 Back out 2 changesets (bug 528092, bug 1076848) for introducing an extra 3 hour timeout to builds
CLOSED TREE

Backed out changeset b15dac9231ee (bug 528092)
Backed out changeset 5b1402a3d3ca (bug 1076848)
2015-05-11 19:52:19 -07:00
Ted Mielczarek
5de7b40546 bug 528092 - Supply binaries from the symbol server. r=gps 2010-09-03 13:19:41 -04:00
Ted Mielczarek
bb3a7f80d2 bug 1076848 - fix source server indexing for headers from dist/include. r=dmajor 2015-05-07 07:11:27 -04:00
Jim Mathies
fe09301188 bug 575919 - hide Windows error dialogs in symbolstore.py. r=ted 2015-03-11 20:02:43 -04:00
Ryan VanderMeulen
640ca66736 Merge m-c to inbound. a=merge 2015-01-30 12:32:49 -05:00
Todd Whiteman
8875f254af Bug 1124984 - Force the gzip call to run. r=ted 2015-01-22 19:36:00 -05:00
Todd Whiteman
e3a7df0c64 Bug 1124963 - Fix symbolstore.py script errors. r=ted 2015-01-22 17:52:00 +01:00
Ted Mielczarek
00efc66df9 bug 1045662 - add an extra normcase to symbolstore.py path handling to fix Windows. r=gps 2014-07-30 08:00:59 -04:00