From 126e2f316148c12fc22c384776fc16c57628d4e7 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Wed, 12 Apr 2023 11:08:49 +0200 Subject: [PATCH 1/3] rebuild with electron + ubuntu-latest Signed-off-by: Akos Kitta --- .github/workflows/build.yml | 5 ++--- electron/build/template-package.json | 7 ++----- electron/packager/index.js | 4 ---- package.json | 1 - yarn.lock | 25 +------------------------ 5 files changed, 5 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d26c26def..6e0b515ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,8 +42,8 @@ jobs: - os: windows-2019 certificate-secret: WINDOWS_SIGNING_CERTIFICATE_PFX # Name of the secret that contains the certificate. certificate-password-secret: WINDOWS_SIGNING_CERTIFICATE_PASSWORD # Name of the secret that contains the certificate password. - certificate-extension: pfx # File extension for the certificate. - - os: ubuntu-18.04 # https://github.com/arduino/arduino-ide/issues/259 + certificate-extension: pfx # File extension for the certificate. + - os: ubuntu-latest - os: macos-latest # APPLE_SIGNING_CERTIFICATE_P12 secret was produced by following the procedure from: # https://www.kencochrane.com/2020/08/01/build-and-sign-golang-binaries-for-macos-with-github-actions/#exporting-the-developer-certificate @@ -104,7 +104,6 @@ jobs: if [ "${{ runner.OS }}" = "Windows" ]; then npm config set msvs_version 2017 --global fi - npx node-gyp install yarn --cwd ./electron/packager/ yarn --cwd ./electron/packager/ package diff --git a/electron/build/template-package.json b/electron/build/template-package.json index f3692a416..47c6764dd 100644 --- a/electron/build/template-package.json +++ b/electron/build/template-package.json @@ -2,8 +2,7 @@ "main": "scripts/arduino-ide-electron-main.js", "author": "Arduino SA", "resolutions": { - "**/fs-extra": "^4.0.3", - "electron-builder": "23.0.2" + "**/fs-extra": "^4.0.3" }, "dependencies": { "node-log-rotate": "^0.1.5" @@ -11,7 +10,7 @@ "devDependencies": { "@theia/cli": "1.31.1", "cross-env": "^7.0.2", - "electron-builder": "23.3.3", + "electron-builder": "23.6.0", "electron-notarize": "^1.1.1", "is-ci": "^2.0.0", "ncp": "^2.0.0", @@ -19,7 +18,6 @@ }, "scripts": { "build": "yarn download:plugins && theia build --mode production && yarn patch", - "rebuild": "yarn theia rebuild:electron", "package": "cross-env DEBUG=* && electron-builder --publish=never", "download:plugins": "theia download:plugins", "patch": "ncp ./patch/backend/main.js ./src-gen/backend/main.js" @@ -47,7 +45,6 @@ "asar": false, "detectUpdateChannel": false, "generateUpdatesFilesForAllChannels": true, - "npmRebuild": false, "directories": { "buildResources": "resources" }, diff --git a/electron/packager/index.js b/electron/packager/index.js index 65c82d8df..103f90261 100644 --- a/electron/packager/index.js +++ b/electron/packager/index.js @@ -261,10 +261,6 @@ ${fs `yarn --cwd ${join(repoRoot, 'electron', 'build')} build`, `Building the ${productName} application` ); - exec( - `yarn --cwd ${join(repoRoot, 'electron', 'build')} rebuild`, - 'Rebuilding native dependencies' - ); //------------------------------------------------------------------------------+ // Create a throw away dotenv file which we use to feed the builder with input. | diff --git a/package.json b/package.json index 2e97fea6e..6f5dbce9b 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "jsdom": "^11.5.1", "lerna": "^6.1.0", "lint-staged": "^11.0.0", - "node-gyp": "^9.3.0", "prettier": "^2.3.1", "reflect-metadata": "^0.1.10", "rimraf": "^2.6.1", diff --git a/yarn.lock b/yarn.lock index 44833b671..05e2563c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4003,7 +4003,7 @@ abab@^2.0.0, abab@^2.0.5: resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== -abbrev@1, abbrev@^1.0.0: +abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== @@ -11088,22 +11088,6 @@ node-gyp@^9.0.0: tar "^6.1.2" which "^2.0.2" -node-gyp@^9.3.0: - version "9.3.0" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-9.3.0.tgz#f8eefe77f0ad8edb3b3b898409b53e697642b319" - integrity sha512-A6rJWfXFz7TQNjpldJ915WFb1LnhO4lIve3ANPbWreuEoLoKlFT3sxIepPBkLhM27crW8YmN+pjlgbasH6cH/Q== - dependencies: - env-paths "^2.2.0" - glob "^7.1.4" - graceful-fs "^4.2.6" - make-fetch-happen "^10.0.3" - nopt "^6.0.0" - npmlog "^6.0.0" - rimraf "^3.0.2" - semver "^7.3.5" - tar "^6.1.2" - which "^2.0.2" - node-pty@0.11.0-beta17: version "0.11.0-beta17" resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.11.0-beta17.tgz#7df6a60dced6bf7a3a282b65cf51980c68954af6" @@ -11133,13 +11117,6 @@ nopt@^5.0.0: dependencies: abbrev "1" -nopt@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-6.0.0.tgz#245801d8ebf409c6df22ab9d95b65e1309cdb16d" - integrity sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g== - dependencies: - abbrev "^1.0.0" - normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" From b09d543464f6dabe54fc7494a5386e2e2f4e0963 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Wed, 12 Apr 2023 12:27:20 +0200 Subject: [PATCH 2/3] force nsfw@2.2.4 Signed-off-by: Akos Kitta --- electron/build/template-package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/electron/build/template-package.json b/electron/build/template-package.json index 47c6764dd..1b0214131 100644 --- a/electron/build/template-package.json +++ b/electron/build/template-package.json @@ -2,7 +2,8 @@ "main": "scripts/arduino-ide-electron-main.js", "author": "Arduino SA", "resolutions": { - "**/fs-extra": "^4.0.3" + "**/fs-extra": "^4.0.3", + "nsfw": "^2.2.4" }, "dependencies": { "node-log-rotate": "^0.1.5" From 4a8d3ca8036ba23c8b8eff5d64a7161711b3acb4 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Wed, 12 Apr 2023 13:44:50 +0200 Subject: [PATCH 3/3] restore node-gyp "preinstall" Signed-off-by: Akos Kitta --- .github/workflows/build.yml | 1 + package.json | 5 +++- yarn.lock | 52 ++++++++++++++++++++++++------------- 3 files changed, 39 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e0b515ae..7aa9c8fb8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,6 +104,7 @@ jobs: if [ "${{ runner.OS }}" = "Windows" ]; then npm config set msvs_version 2017 --global fi + npx node-gyp install yarn --cwd ./electron/packager/ yarn --cwd ./electron/packager/ package diff --git a/package.json b/package.json index 6f5dbce9b..c99ca0acf 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,15 @@ "engines": { "node": ">=16.0.0 <17" }, + "resolutions": { + "nsfw": "^2.2.4" + }, "devDependencies": { "@theia/cli": "1.31.1", "@types/jsdom": "^11.0.4", "@types/sinon": "^2.3.5", "@typescript-eslint/eslint-plugin": "^4.27.0", "@typescript-eslint/parser": "^4.27.0", - "cross-env": "^7.0.2", "eslint": "^7.28.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^3.4.0", @@ -27,6 +29,7 @@ "jsdom": "^11.5.1", "lerna": "^6.1.0", "lint-staged": "^11.0.0", + "node-gyp": "^9.3.0", "prettier": "^2.3.1", "reflect-metadata": "^0.1.10", "rimraf": "^2.6.1", diff --git a/yarn.lock b/yarn.lock index 05e2563c8..0fe22f685 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4003,7 +4003,7 @@ abab@^2.0.0, abab@^2.0.5: resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== -abbrev@1: +abbrev@1, abbrev@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== @@ -5994,13 +5994,6 @@ create-frame@^1.0.0: isobject "^3.0.0" lazy-cache "^2.0.2" -cross-env@^7.0.2: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" - integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw== - dependencies: - cross-spawn "^7.0.1" - cross-fetch@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" @@ -11025,11 +11018,6 @@ node-abi@^2.21.0, node-abi@^2.7.0: dependencies: semver "^5.4.1" -node-addon-api@*: - version "5.0.0" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.0.0.tgz#7d7e6f9ef89043befdb20c1989c905ebde18c501" - integrity sha512-CvkDw2OEnme7ybCykJpVcKH+uAOLV2qLqiyla128dN9TkEWfrYmxG6C2boDe5KcNQqZF3orkqzGgOMvZ/JNekA== - node-addon-api@^3.0.0, node-addon-api@^3.0.2, node-addon-api@^3.1.0, node-addon-api@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161" @@ -11040,6 +11028,11 @@ node-addon-api@^4.3.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f" integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ== +node-addon-api@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.1.0.tgz#49da1ca055e109a23d537e9de43c09cca21eb762" + integrity sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA== + node-api-version@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/node-api-version/-/node-api-version-0.1.4.tgz#1ed46a485e462d55d66b5aa1fe2821720dedf080" @@ -11088,6 +11081,22 @@ node-gyp@^9.0.0: tar "^6.1.2" which "^2.0.2" +node-gyp@^9.3.0: + version "9.3.1" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-9.3.1.tgz#1e19f5f290afcc9c46973d68700cbd21a96192e4" + integrity sha512-4Q16ZCqq3g8awk6UplT7AuxQ35XN4R/yf/+wSAwcBUAjg7l58RTactWaP8fIDTi0FzI7YcVLujwExakZlfWkXg== + dependencies: + env-paths "^2.2.0" + glob "^7.1.4" + graceful-fs "^4.2.6" + make-fetch-happen "^10.0.3" + nopt "^6.0.0" + npmlog "^6.0.0" + rimraf "^3.0.2" + semver "^7.3.5" + tar "^6.1.2" + which "^2.0.2" + node-pty@0.11.0-beta17: version "0.11.0-beta17" resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.11.0-beta17.tgz#7df6a60dced6bf7a3a282b65cf51980c68954af6" @@ -11117,6 +11126,13 @@ nopt@^5.0.0: dependencies: abbrev "1" +nopt@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-6.0.0.tgz#245801d8ebf409c6df22ab9d95b65e1309cdb16d" + integrity sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g== + dependencies: + abbrev "^1.0.0" + normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -11313,12 +11329,12 @@ npmlog@^6.0.0, npmlog@^6.0.2: gauge "^4.0.3" set-blocking "^2.0.0" -nsfw@^2.1.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/nsfw/-/nsfw-2.2.2.tgz#9fc64a0ca4bc38e180dd74935e0f295913e2153f" - integrity sha512-a2xt1Nx8Sz+E8eA5Ehgb3UONlrk1s5TpeoVh1XiqS0AI0wI94B7x4qoh6C11rNNX4fPOc3iC/wh4mcY9GWOgOQ== +nsfw@^2.1.2, nsfw@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/nsfw/-/nsfw-2.2.4.tgz#4ed94544a63fc843b7e3ccff6668dce13d27a33a" + integrity sha512-sTRNa7VYAiy5ARP8etIBfkIfxU0METW40UinDnv0epQMe1pzj285HdXKRKkdrV3rRzMNcuNZn2foTNszV0x+OA== dependencies: - node-addon-api "*" + node-addon-api "^5.0.0" number-is-nan@^1.0.0: version "1.0.1"