Skip to content

Commit 7bb8a35

Browse files
authored
Ensure file permissions when building for Linux and set sha length for test builds
1 parent 8fee010 commit 7bb8a35

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

reproducible-builds/docker-entrypoint.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ echo "BUILD_TYPE: ${BUILD_TYPE}"
3434
# UNIX timestamp will be generated at the time of the build, and is non-deterministic.
3535
echo "SOURCE_DATE_EPOCH: ${SOURCE_DATE_EPOCH}"
3636

37-
# Ensure consistent permissions for files copied via electron builder extraResources
38-
umask 0022
39-
4037
pnpm install --frozen-lockfile
4138
pnpm run clean-transpile
4239
cd sticker-creator

scripts/prepare_tagged_version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if (release !== 'alpha' && release !== 'axolotl' && release !== 'adhoc') {
1818

1919
const { generateTaggedVersion } = require('../ts/util/version.js');
2020

21-
const shortSha = execSync('git rev-parse --short HEAD')
21+
const shortSha = execSync('git rev-parse --short=9 HEAD')
2222
.toString('utf8')
2323
.replace(/[\n\r]/g, '');
2424

ts/scripts/after-pack.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import type { AfterPackContext } from 'electron-builder';
55
import { afterPack as fuseElectron } from './fuse-electron.js';
66
import { afterPack as copyPacks } from './copy-language-packs.js';
77
import { afterPack as pruneMacOSRelease } from './prune-macos-release.js';
8+
import { afterPack as ensureLinuxFilePermissions } from './ensure-linux-file-permissions.js';
89

910
export async function afterPack(context: AfterPackContext): Promise<void> {
1011
await pruneMacOSRelease(context);
1112
await fuseElectron(context);
1213
await copyPacks(context);
14+
await ensureLinuxFilePermissions(context);
1315
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright 2025 Signal Messenger, LLC
2+
// SPDX-License-Identifier: AGPL-3.0-only
3+
4+
import path from 'node:path';
5+
import { execSync } from 'node:child_process';
6+
import type { AfterPackContext } from 'electron-builder';
7+
8+
const FILES = [
9+
'resources/org.signalapp.enable-backups.policy',
10+
'resources/org.signalapp.view-aep.policy',
11+
];
12+
13+
export async function afterPack({
14+
appOutDir,
15+
electronPlatformName,
16+
}: AfterPackContext): Promise<void> {
17+
if (electronPlatformName !== 'linux') {
18+
return;
19+
}
20+
21+
console.log('Ensuring Linux file permissions');
22+
23+
for (const file of FILES) {
24+
const filePath = path.join(appOutDir, file);
25+
// u+rw g+r o+r
26+
const command = `chmod 644 "${filePath}"`;
27+
console.log(`Running: ${command}`);
28+
execSync(command);
29+
}
30+
}

0 commit comments

Comments
 (0)