Fix acknowledgments for 7.1.x

This commit is contained in:
ayumi-signal 2024-03-01 17:08:39 -08:00 committed by GitHub
parent 72b75a0bfd
commit 7451d54ece
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 12354 deletions

View file

@ -50,12 +50,6 @@ jobs:
- run: yarn lint
- run: yarn lint-deps
- run: yarn lint-license-comments
- name: Check acknowledgments file is up to date
run: yarn build:acknowledgments
env:
REQUIRE_SIGNAL_LIB_FILES: 1
- run: git diff --exit-code
- name: Update cached .eslintcache and tsconfig.tsbuildinfo

View file

@ -44,7 +44,3 @@ Gruntfile.js
# bad matches
!patch-package/node_modules/yaml/dist/doc
# used for build:acknowledgements
!@signalapp/libsignal-client/dist/acknowledgments.md
!@signalapp/ringrtc/dist/acknowledgments.md

File diff suppressed because it is too large Load diff

View file

@ -7,19 +7,15 @@ const { join } = require('path');
const pMap = require('p-map');
const prettier = require('prettier');
// During development, you might use local versions of dependencies which are missing
// acknowledgment files. In this case we'll skip rebuilding the acknowledgment files.
// Enable this flag to throw an error.
const REQUIRE_SIGNAL_LIB_FILES = Boolean(process.env.REQUIRE_SIGNAL_LIB_FILES);
const {
dependencies = {},
optionalDependencies = {},
} = require('../package.json');
const SIGNAL_LIBS = ['@signalapp/libsignal-client', '@signalapp/ringrtc'];
const SKIPPED_DEPENDENCIES = new Set(SIGNAL_LIBS);
const SKIPPED_DEPENDENCIES = new Set([
'@signalapp/libsignal-client',
'@signalapp/ringrtc',
]);
const rootDir = join(__dirname, '..');
const nodeModulesPath = join(rootDir, 'node_modules');
@ -74,37 +70,6 @@ async function getMarkdownForDependency(dependencyName) {
].join('\n');
}
async function getMarkdownForSignalLib(dependencyName) {
const dependencyRootPath = join(nodeModulesPath, dependencyName);
const licenseFilePath = join(
dependencyRootPath,
'dist',
'acknowledgments.md'
);
let licenseBody;
try {
licenseBody = await fs.promises.readFile(licenseFilePath, 'utf8');
} catch (err) {
if (err) {
if (err.code === 'ENOENT' && !REQUIRE_SIGNAL_LIB_FILES) {
console.warn(
`Missing acknowledgments file for ${dependencyName}. Skipping generation of acknowledgments.`
);
process.exit(0);
}
throw err;
}
}
return [
`# Acknowledgements for ${dependencyName}`,
'',
licenseBody.replace(/^# Acknowledgments/, '').trim(),
].join('\n');
}
async function main() {
assert.deepStrictEqual(
Object.keys(optionalDependencies),
@ -129,16 +94,6 @@ async function main() {
}
);
// For our libraries copy the respective acknowledgement lists
const markdownsFromSignalLibs = await pMap(
SIGNAL_LIBS,
getMarkdownForSignalLib,
{
concurrency: 100,
timeout: 1000 * 60 * 2,
}
);
const unformattedOutput = [
'<!-- Copyright 2020 Signal Messenger, LLC -->',
'<!-- SPDX-License-Identifier: AGPL-3.0-only -->',
@ -151,8 +106,6 @@ async function main() {
'## Kyber Patent License',
'',
'<https://csrc.nist.gov/csrc/media/Projects/post-quantum-cryptography/documents/selected-algos-2022/nist-pqc-license-summary-and-excerpts.pdf>',
'',
markdownsFromSignalLibs.join('\n\n'),
].join('\n');
const prettierConfig = await prettier.resolveConfig(destinationPath);