From 466651ed90708602280fb48fe97d7f63d344fa58 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Mon, 30 Jan 2017 09:13:03 +1000 Subject: [PATCH 1/3] Update to latest espeak-ng master (#6717) --- .gitignore | 2 +- include/espeak | 2 +- nvdaHelper/espeak/config.h | 2 ++ nvdaHelper/espeak/sconscript | 6 +++--- source/installer.py | 4 ++-- source/synthDrivers/_espeak.py | 2 +- source/synthDrivers/espeak.py | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index db02e690dac..2870047edac 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ dist *.dll *.exe *.manifest -source/synthDrivers/espeak-data +source/synthDrivers/espeak-ng-data source/lib source/lib64 source/typelibs diff --git a/include/espeak b/include/espeak index 11b1a7b30c3..e095f008fa3 160000 --- a/include/espeak +++ b/include/espeak @@ -1 +1 @@ -Subproject commit 11b1a7b30c36018aff821b16f9446a076ac2f875 +Subproject commit e095f008fa3f8389e57bd7c434cdbf333702fae2 diff --git a/nvdaHelper/espeak/config.h b/nvdaHelper/espeak/config.h index ad115434e7f..301c6aaad41 100644 --- a/nvdaHelper/espeak/config.h +++ b/nvdaHelper/espeak/config.h @@ -6,3 +6,5 @@ // Espeak features #define INCLUDE_KLATT 1 #define HAVE_SONIC_H 1 + +#define PACKAGE_VERSION "1.49.1 dev" diff --git a/nvdaHelper/espeak/sconscript b/nvdaHelper/espeak/sconscript index a5f43d1bf12..18b6b493415 100644 --- a/nvdaHelper/espeak/sconscript +++ b/nvdaHelper/espeak/sconscript @@ -123,7 +123,7 @@ espeakLib=env.SharedLibrary( LIBS=['advapi32'], ) -phonemeData=env.espeak_compilePhonemeData(espeakRepo.Dir('espeak-data'),espeakRepo.Dir('phsource')) +phonemeData=env.espeak_compilePhonemeData(espeakRepo.Dir('espeak-ng-data'),espeakRepo.Dir('phsource')) env.Depends(phonemeData,espeakLib) # Move any extra dictionaries into dictsource for compilation @@ -135,7 +135,7 @@ dictSourcePath=espeakRepo.Dir('dictsource').abspath for f in env.Glob(os.path.join(dictSourcePath,'*_rules')): lang=f.name.split('_')[0] if lang in missingDicts: continue - dictFile=env.Command(espeakRepo.Dir('espeak-data').File(lang+'_dict'),f,espeak_compileDict_buildAction) + dictFile=env.Command(espeakRepo.Dir('espeak-ng-data').File(lang+'_dict'),f,espeak_compileDict_buildAction) dictDeps=env.Glob(os.path.join(espeakRepo.abspath,'dictsource',lang+'_*')) dictDeps.remove(f) env.Depends(dictFile,dictDeps) @@ -144,4 +144,4 @@ for f in env.Glob(os.path.join(dictSourcePath,'*_rules')): env.SideEffect('_espeak_compileDict',dictFile) env.Install(synthDriversDir,espeakLib) -env.RecursiveInstall(synthDriversDir.Dir('espeak-data'),espeakRepo.Dir('espeak-data').abspath) +env.RecursiveInstall(synthDriversDir.Dir('espeak-ng-data'),espeakRepo.Dir('espeak-ng-data').abspath) diff --git a/source/installer.py b/source/installer.py index 515fea09e23..82ecb3f29ef 100644 --- a/source/installer.py +++ b/source/installer.py @@ -136,9 +136,9 @@ def copyUserConfig(destPath): tryCopyFile(sourceFilePath,destFilePath) def removeOldProgramFiles(destPath): - # #3181: Remove espeak-data\voices except for variants. + # #3181: Remove espeak-ng-data\voices except for variants. # Otherwise, there will be duplicates if voices have been moved in this new eSpeak version. - root = os.path.join(destPath, "synthDrivers", "espeak-data", "voices") + root = os.path.join(destPath, "synthDrivers", "espeak-ng-data", "voices") try: files = set(os.listdir(root)) except OSError: diff --git a/source/synthDrivers/_espeak.py b/source/synthDrivers/_espeak.py index 128fc01250a..69a1e4b5311 100755 --- a/source/synthDrivers/_espeak.py +++ b/source/synthDrivers/_espeak.py @@ -308,7 +308,7 @@ def info(): return espeakDLL.espeak_Info() def getVariantDict(): - dir='synthDrivers\\espeak-data\\voices\\!v' + dir='synthDrivers\\espeak-ng-data\\voices\\!v' # Translators: name of the default espeak varient. variantDict={"none": pgettext("espeakVarient", "none")} for fileName in os.listdir(dir): diff --git a/source/synthDrivers/espeak.py b/source/synthDrivers/espeak.py index 807dd83e745..2f0b0a5220c 100644 --- a/source/synthDrivers/espeak.py +++ b/source/synthDrivers/espeak.py @@ -37,7 +37,7 @@ def check(cls): def __init__(self): _espeak.initialize() - log.info("Using eSpeak version %s" % _espeak.info()) + log.info("Using eSpeak NG version %s" % _espeak.info()) lang=languageHandler.getLanguage() _espeak.setVoiceByLanguage(lang) self._language=lang From 13f973a6e178602973f0705e967f723ee3a0d594 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Mon, 30 Jan 2017 09:16:28 +1000 Subject: [PATCH 2/3] Update What's new. --- user_docs/en/changes.t2t | 1 + 1 file changed, 1 insertion(+) diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index caccaf39089..c4edd9f93ac 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -19,6 +19,7 @@ - A check box has been added to the braille settings dialog to allow enabling/disabling braille cursor blinking. Previously a value of zero was used to achieve this. (#6470) - Profiles and configuration files are now automatically upgraded to meet the requirements of schema modifications. If there is an error during upgrade, a notification is shown, the configuration is reset, and the old configuration file is available in the NVDA log at 'Info' level. (#6470) - Support for reading and navigating books in Kindle for PC version 1.19, including access to links, footnotes, graphics, highlighted text and user notes. Please see the Kindle for PC section of the NVDA User Guide for further information. (#6247, #6638) +- Upgraded eSpeak-NG to commit e095f008fa3f838 == Bug Fixes == From 08af4cef7e83fa33ada0678b495af44b00d8c843 Mon Sep 17 00:00:00 2001 From: James Teh Date: Mon, 30 Jan 2017 16:38:15 +1000 Subject: [PATCH 3/3] Upload appropriate debug symbols to Mozilla crash-stats for branch snapshots and releases (but not try builds). (PR #6816, issue #6646) --- appveyor.yml | 7 +++ appveyor/mozillaSyms.py | 105 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 appveyor/mozillaSyms.py diff --git a/appveyor.yml b/appveyor.yml index f255d7ebeed..3e7009511ed 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,6 +13,8 @@ environment: PY_PYTHON: 2.7-32 encFileKey: secure: ekOvuyywHuDdGZmRmoj+b3jfrq39A2xlx4RD5ZUGd/8= + mozillaSymsAuthToken: + secure: Dz24ukUM3Ho0soTDwJEYaw0fNY3yzfVp3Vf+y8I+Uh4wiSYibWJxOANacceGmfIU symstore: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\symstore.exe init: @@ -93,6 +95,7 @@ deploy_script: - ps: | if ($env:versionType) { # Not a try build. + # Notify our server. $exe = Get-ChildItem -Name output\*.exe $hash = (Get-FileHash "output\$exe" -Algorithm SHA1).Hash.ToLower() $data = @{ @@ -105,4 +108,8 @@ deploy_script: artifacts=$artifacts } ConvertTo-Json -InputObject $data -Compress | ssh nvaccess@exbi.nvaccess.org nvdaAppveyorHook + # Upload symbols to Mozilla. + Start-FileDownload https://github.com/mozilla/gecko-dev/raw/master/toolkit/crashreporter/tools/win32/dump_syms_vc1800.exe -FileName appveyor\dump_syms.exe + py -m pip install requests + py appveyor\mozillaSyms.py } diff --git a/appveyor/mozillaSyms.py b/appveyor/mozillaSyms.py new file mode 100644 index 00000000000..146741cfe6c --- /dev/null +++ b/appveyor/mozillaSyms.py @@ -0,0 +1,105 @@ +# Based on code from https://gist.github.com/luser/2ad32d290f224782fcfc + +"""Script to convert and upload appropriate NVDA debug symbols to Mozilla crash-stats. +This should just be run as a script with no arguments. +It expects the crash-stats auth token to be placed in the mozillaSymsAuthToken environment variable. +To update the list of symbols uploaded to Mozilla, see the DLL_NAMES constant below. +""" + +from __future__ import print_function +import argparse +import os +import subprocess +import sys +import zipfile +import requests + +SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) +DUMP_SYMS = os.path.join(SCRIPT_DIR, "dump_syms.exe") +NVDA_SOURCE = os.path.join(os.path.dirname(SCRIPT_DIR), "source") +NVDA_LIB = os.path.join(NVDA_SOURCE, "lib") +NVDA_LIB64 = NVDA_LIB + "64" +ZIP_FILE = os.path.join(SCRIPT_DIR, "mozillaSyms.zip") +URL = 'https://crash-stats.mozilla.com/symbols/upload' + +# The dlls for which symbols are to be uploaded to Mozilla. +# This only needs to include dlls injected into Mozilla products. +DLL_NAMES = [ + "IAccessible2Proxy.dll", + "minHook.dll", + "nvdaHelperRemote.dll", + "VBufBackend_adobeFlash.dll", + "VBufBackend_gecko_ia2.dll", +] +DLL_FILES = [f + for dll in DLL_NAMES + # We need both the 32 bit and 64 bit symbols. + for f in (os.path.join(NVDA_LIB, dll), os.path.join(NVDA_LIB64, dll))] + +class ProcError(Exception): + def __init__(self, returncode, stderr): + self.returncode = returncode + self.stderr = stderr + +def check_output(command): + proc = subprocess.Popen(command, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + stdout, stderr = proc.communicate() + if proc.returncode != 0: + raise ProcError(proc.returncode, stderr) + return stdout + +def processFile(path): + try: + stdout = check_output([DUMP_SYMS, path]) + except ProcError as e: + print('Error: running "%s %s": %s' % (DUMP_SYMS, path, e.stderr)) + return None, None, None + bits = stdout.splitlines()[0].split(' ', 4) + if len(bits) != 5: + return None, None, None + _, platform, cpu_arch, debug_id, debug_file = bits + # debug_file will have a .pdb extension; e.g. nvdaHelperRemote.dll.pdb. + # The output file format should have a .sym extension instead. + # Strip .pdb and add .sym. + sym_file = debug_file[:-4] + '.sym' + filename = os.path.join(debug_file, debug_id, sym_file) + debug_filename = os.path.join(debug_file, debug_id, debug_file) + return filename, stdout, debug_filename + +def generate(): + count = 0 + with zipfile.ZipFile(ZIP_FILE, 'w', zipfile.ZIP_DEFLATED) as zf: + for f in DLL_FILES: + filename, contents, debug_filename = processFile(f) + if not (filename and contents): + print('Error dumping symbols') + raise RuntimeError + zf.writestr(filename, contents) + count += 1 + print('Added %d files to %s' % (count, ZIP_FILE)) + +def upload(): + r = requests.post(URL, + files={'symbols.zip': open(ZIP_FILE, 'rb')}, + headers={'Auth-Token': os.getenv('mozillaSymsAuthToken')}, + allow_redirects=False + ) + if r.status_code >= 200 and r.status_code < 300: + print('Uploaded successfully!') + elif r.status_code < 400: + print('Error: bad auth token? (%d)' % r.status_code) + raise RuntimeError + else: + print('Error: %d' % r.status_code) + print(r.text) + raise RuntimeError + return 0 + +if __name__ == '__main__': + try: + generate() + upload() + except RuntimeError: + sys.exit(1)