Add preSign step to make readonly file from GraalVM readable. (https://github.com/enso-org/ide/pull/1848)

Original commit: b358aca513
This commit is contained in:
Dmitry Bushev 2021-10-15 01:28:46 +03:00 committed by GitHub
parent 927935b90d
commit 358710f4eb
3 changed files with 29 additions and 0 deletions

View File

@ -120,6 +120,7 @@ config.build = {
},
publish: [],
afterAllArtifactBuild: 'tasks/computeHashes.js',
afterPack: 'tasks/prepareToSign.js',
// Notarizing has been disabled due to reasons described in the relevant issue:
// https://github.com/enso-org/ide/issues/1839
// afterSign: "tasks/notarize.js",

View File

@ -0,0 +1,13 @@
const { beforeSign } = require('./signArchives')
// ================
// === Callback ===
// ================
exports.default = async function (context) {
if (context.electronPlatformName === 'darwin') {
beforeSign()
}
}

View File

@ -13,6 +13,7 @@
dependency.
This script should be removed once the engine is signed.
**/
const fs = require('fs')
const path = require('path')
const child_process = require('child_process')
const { dist } = require('../../../../../build/paths')
@ -258,6 +259,18 @@ const extra = [
`enso/runtime/${GRAALVM}/Contents/Home/languages/R/library/survival/libs/survival.so`,
]
// The list of readonly files in the GraalVM distribution.
const readonly = [
`enso/runtime/${GRAALVM}/Contents/Home/lib/server/classes.jsa`,
]
function beforeSign() {
for (let file of readonly) {
const target = path.join(resRoot, file)
fs.chmodSync(target, 0o644)
}
}
exports.default = async function () {
// Sign archives.
for (let toSignData of toSign) {
@ -275,3 +288,5 @@ exports.default = async function () {
// Finally re-sign the top-level enso.
sign(path.join(contentRoot, 'MacOs/Enso'))
}
module.exports = { beforeSign }