Skip to content

Commit

Permalink
ad-hoc sign all binaries on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
mbektas committed Oct 26, 2023
1 parent 70fb4b1 commit 2add103
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
4 changes: 1 addition & 3 deletions Release.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ In order to change the JupyterLab version bundled with the application:
yarn create_env_installer:osx-arm64 && yarn update_binary_sign_list --platform osx-arm64
```

4. If python version is updated in [`env_installer/jlab_server.yaml`](env_installer/jlab_server.yaml), also update `pythonBin` variables in [`util.ts`](src/main/utils.ts) that are used in code signing related methods.

5. Update `ipywidgets` python package version in [`env_installer/jlab_server.yaml`](env_installer/jlab_server.yaml) if there is a compatible newer version available.
4. Update `ipywidgets` python package version in [`env_installer/jlab_server.yaml`](env_installer/jlab_server.yaml) if there is a compatible newer version available.

Note that after updating the bundled JupyterLab version, it is necessary to bump JupyterLab Desktop version using `tbump` as described in the section below. Run `check_version_match` script before committing the changes to ensure version integrity.

Expand Down
11 changes: 4 additions & 7 deletions src/main/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@ export function createCommandScriptInEnv(
back to ad-hoc signed.
*/
export function createUnsignScriptInEnv(envPath: string): string {
const pythonBin = 'bin/python3.8';
const appDir = getAppDir();
const signListFile = path.join(
appDir,
Expand All @@ -510,17 +509,15 @@ export function createUnsignScriptInEnv(envPath: string): string {
const signList: string[] = [];

fileContents.split(/\r?\n/).forEach(line => {
if (line && line !== pythonBin) {
if (line) {
signList.push(`"${line}"`);
}
});

// remove hardened runtime flag, convert to ad-hoc
const removeRuntimeFlagCommand = `codesign -s - -o 0x2 -f ${pythonBin}`;

return `cd ${envPath} && codesign --remove-signature ${signList.join(
// sign all binaries with ad-hoc signature
return `cd ${envPath} && codesign -s - -o 0x2 -f ${signList.join(
' '
)} && ${removeRuntimeFlagCommand} && cd -`;
)} && cd -`;
}

export function getLogFilePath(processType: 'main' | 'renderer' = 'main') {
Expand Down

0 comments on commit 2add103

Please sign in to comment.