From 48f904ac2739691f52faa1f8efc5b849cb8ec97e Mon Sep 17 00:00:00 2001 From: Alexandre Lissy Date: Tue, 7 Jul 2020 19:17:39 +0200 Subject: [PATCH] Fix #3127: Adjust PATH for electronjs/windows with electron-builder --- native_client/javascript/index.ts | 8 +++++++- taskcluster/.shared.yml | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/native_client/javascript/index.ts b/native_client/javascript/index.ts index d0eb7d81..988cbfd5 100644 --- a/native_client/javascript/index.ts +++ b/native_client/javascript/index.ts @@ -8,7 +8,13 @@ const binding_path = binary.find(path.resolve(path.join(__dirname, 'package.json // @loader_path/../ but we can change the PATH to include the proper directory // for the dynamic linker if (process.platform === 'win32') { - const dslib_path = path.resolve(path.join(binding_path, '../..')); + var dslib_path = path.resolve(path.join(binding_path, '../..')); + // electron-builder does weird magic hand-in-hand with electronjs, + // and messes with the path where we expect things to be for the Windows + // linker. + if ('electron' in process.versions) { + dslib_path = dslib_path.replace("app.asar", "app.asar.unpacked"); + } var oldPath = process.env.PATH; process.env['PATH'] = `${dslib_path};${process.env.PATH}`; } diff --git a/taskcluster/.shared.yml b/taskcluster/.shared.yml index 076a8061..00e2346c 100644 --- a/taskcluster/.shared.yml +++ b/taskcluster/.shared.yml @@ -163,11 +163,11 @@ system: url: "https://community-tc.services.mozilla.com/api/index/v1/task/project.deepspeech.tensorflow.pip.r2.2.518c1.1.bf55d362bb11e973b8f5.1.a3e5bf44d.1.android-armv7/artifacts/public/home.tar.xz" namespace: "project.deepspeech.tensorflow.pip.r2.2.518c1.1.bf55d362bb11e973b8f5.1.a3e5bf44d.1.android-armv7" win_amd64_cpu: - url: "https://community-tc.services.mozilla.com/api/index/v1/task/project.deepspeech.tensorflow.pip.r2.2.518c1d04bf55d362bb11e973b8f5d0aa3e5bf44d.0.win/artifacts/public/home.tar.xz" - namespace: "project.deepspeech.tensorflow.pip.r2.2.518c1d04bf55d362bb11e973b8f5d0aa3e5bf44d.0.win" + url: "https://community-tc.services.mozilla.com/api/index/v1/task/project.deepspeech.tensorflow.pip.r2.2.518c1d04bf55d362bb11e973b8f5d0aa3e5bf44d.1.win/artifacts/public/home.tar.xz" + namespace: "project.deepspeech.tensorflow.pip.r2.2.518c1d04bf55d362bb11e973b8f5d0aa3e5bf44d.1.win" win_amd64_cuda: - url: "https://community-tc.services.mozilla.com/api/index/v1/task/project.deepspeech.tensorflow.pip.r2.2.518c1d04bf55d362bb11e973b8f5d0aa3e5bf44d.0.win-cuda/artifacts/public/home.tar.xz" - namespace: "project.deepspeech.tensorflow.pip.r2.2.518c1d04bf55d362bb11e973b8f5d0aa3e5bf44d.0.win-cuda" + url: "https://community-tc.services.mozilla.com/api/index/v1/task/project.deepspeech.tensorflow.pip.r2.2.518c1d04bf55d362bb11e973b8f5d0aa3e5bf44d.1.win-cuda/artifacts/public/home.tar.xz" + namespace: "project.deepspeech.tensorflow.pip.r2.2.518c1d04bf55d362bb11e973b8f5d0aa3e5bf44d.1.win-cuda" username: 'build-user' homedir: linux: '/home/build-user'