forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug 1259832 - package generated sources and upload them along with ot…
…her build artifacts. r=gps This change makes us upload an `$(PKG_BASENAME).generated-files.tar.gz` archive alongside other build artifacts which contains all the generated source files from the build. A change after this will introduce an `upload-generated-sources` task to take this artifact and upload the individual files to an S3 bucket. This will be used to provide links to generated source files when they appear in stack traces in crash reports. MozReview-Commit-ID: 6yQAdlZ5q3O --HG-- extra : rebase_source : d92fb17ae737d1360e9724997f6688e29bedef12 extra : source : 14d18d7cf454c4c3d0f6d49d1d01660e06e4be4b
- Loading branch information
Showing
14 changed files
with
89 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
|
||
MOZ_AUTOMATION_BUILD_SYMBOLS=0 | ||
MOZ_AUTOMATION_L10N_CHECK=0 | ||
MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
mobile/android/config/mozconfigs/android-api-15-gradle/nightly-artifact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
mobile/android/config/mozconfigs/android-api-15/debug-artifact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
mobile/android/config/mozconfigs/android-api-15/nightly-artifact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
python/mozbuild/mozbuild/action/package_generated_sources.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
from __future__ import absolute_import, print_function, unicode_literals | ||
|
||
import argparse | ||
import json | ||
import os.path | ||
import sys | ||
|
||
import buildconfig | ||
from mozpack.archive import create_tar_gz_from_files | ||
from mozbuild.generated_sources import get_generated_sources | ||
|
||
|
||
def main(argv): | ||
parser = argparse.ArgumentParser( | ||
description='Produce archive of generated sources') | ||
parser.add_argument('outputfile', help='File to write output to') | ||
args = parser.parse_args(argv) | ||
|
||
|
||
files = dict(get_generated_sources()) | ||
with open(args.outputfile, 'wb') as fh: | ||
create_tar_gz_from_files(fh, files, compresslevel=5) | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main(sys.argv[1:])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import json | ||
import os | ||
|
||
from mozpack.files import FileFinder | ||
import mozpack.path as mozpath | ||
|
||
|
||
def get_generated_sources(): | ||
''' | ||
Yield tuples of `(objdir-rel-path, file)` for generated source files | ||
in this objdir, where `file` is either an absolute path to the file or | ||
a `mozpack.File` instance. | ||
''' | ||
import buildconfig | ||
|
||
# First, get the list of generated sources produced by the build backend. | ||
gen_sources = os.path.join(buildconfig.topobjdir, 'generated-sources.json') | ||
with open(gen_sources, 'rb') as f: | ||
data = json.load(f) | ||
for f in data['sources']: | ||
yield f, mozpath.join(buildconfig.topobjdir, f) | ||
# Next, return all the files in $objdir/ipc/ipdl/_ipdlheaders. | ||
base = 'ipc/ipdl/_ipdlheaders' | ||
finder = FileFinder(mozpath.join(buildconfig.topobjdir, base)) | ||
for p, f in finder.find('**/*.h'): | ||
yield mozpath.join(base, p), f | ||
# Next, return any Rust source files that were generated into the Rust | ||
# object directory. | ||
rust_build_kind = 'debug' if buildconfig.substs.get('MOZ_DEBUG_RUST') else 'release' | ||
base = mozpath.join('toolkit/library', | ||
buildconfig.substs['RUST_TARGET'], | ||
rust_build_kind, | ||
'build') | ||
finder = FileFinder(mozpath.join(buildconfig.topobjdir, base)) | ||
for p, f in finder.find('**/*.rs'): | ||
yield mozpath.join(base, p), f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters