Revert build folder update to fix it properly (#22981)

* Revert "Disable publishing crash reports temporarily (#22950)"

This reverts commit 13a791d14e.

* Revert "Compile build folder (#22811)"

This reverts commit 2c07c09d0d.
This commit is contained in:
Cheena Malhotra
2023-05-05 08:50:23 -07:00
committed by GitHub
parent 70e756b82d
commit 9af7a049e6
33 changed files with 1467 additions and 1482 deletions

View File

@@ -16,13 +16,13 @@ const dep_lists_1 = require("./dep-lists");
// If true, we fail the build if there are new dependencies found during that task.
// The reference dependencies, which one has to update when the new dependencies
// are valid, are in dep-lists.ts
// const FAIL_BUILD_FOR_NEW_DEPENDENCIES: boolean = false;
const FAIL_BUILD_FOR_NEW_DEPENDENCIES = false;
function getDependencies(buildDir, applicationName, arch) {
// Get the files for which we want to find dependencies.
const nativeModulesPath = path.join(buildDir, 'resources', 'app', 'node_modules.asar.unpacked');
const findResult = (0, child_process_1.spawnSync)('find', [nativeModulesPath, '-name', '*.node']);
if (findResult.status) {
console.error(`Error finding files for ${arch}:`);
console.error('Error finding files:');
console.error(findResult.stderr.toString());
return [];
}
@@ -48,19 +48,18 @@ function getDependencies(buildDir, applicationName, arch) {
sortedDependencies = sortedDependencies.filter(dependency => {
return !dep_lists_1.bundledDeps.some(bundledDep => dependency.startsWith(bundledDep));
});
/* {{SQL CARBON EDIT}} - Not needed for SQL
const referenceGeneratedDeps = referenceGeneratedDepsByArch[arch];
const referenceGeneratedDeps = dep_lists_1.referenceGeneratedDepsByArch[arch];
if (JSON.stringify(sortedDependencies) !== JSON.stringify(referenceGeneratedDeps)) {
const failMessage = 'The dependencies list has changed. '
+ 'Printing newer dependencies list that one can use to compare against referenceGeneratedDeps:\n'
+ sortedDependencies.join('\n');
if (FAIL_BUILD_FOR_NEW_DEPENDENCIES) {
throw new Error(failMessage);
} else {
}
else {
console.warn(failMessage);
}
}
*/
return sortedDependencies;
}
exports.getDependencies = getDependencies;

View File

@@ -6,7 +6,7 @@
import { spawnSync } from 'child_process';
import { constants, statSync } from 'fs';
import path = require('path');
import { additionalDeps, bundledDeps } from './dep-lists';
import { additionalDeps, bundledDeps, referenceGeneratedDepsByArch } from './dep-lists';
import { ArchString } from './types';
// A flag that can easily be toggled.
@@ -16,14 +16,14 @@ import { ArchString } from './types';
// If true, we fail the build if there are new dependencies found during that task.
// The reference dependencies, which one has to update when the new dependencies
// are valid, are in dep-lists.ts
// const FAIL_BUILD_FOR_NEW_DEPENDENCIES: boolean = false;
const FAIL_BUILD_FOR_NEW_DEPENDENCIES: boolean = false;
export function getDependencies(buildDir: string, applicationName: string, arch: ArchString): string[] {
// Get the files for which we want to find dependencies.
const nativeModulesPath = path.join(buildDir, 'resources', 'app', 'node_modules.asar.unpacked');
const findResult = spawnSync('find', [nativeModulesPath, '-name', '*.node']);
if (findResult.status) {
console.error(`Error finding files for ${arch}:`);
console.error('Error finding files:');
console.error(findResult.stderr.toString());
return [];
}
@@ -57,7 +57,6 @@ export function getDependencies(buildDir: string, applicationName: string, arch:
return !bundledDeps.some(bundledDep => dependency.startsWith(bundledDep));
});
/* {{SQL CARBON EDIT}} - Not needed for SQL
const referenceGeneratedDeps = referenceGeneratedDepsByArch[arch];
if (JSON.stringify(sortedDependencies) !== JSON.stringify(referenceGeneratedDeps)) {
const failMessage = 'The dependencies list has changed. '
@@ -69,7 +68,7 @@ export function getDependencies(buildDir: string, applicationName: string, arch:
console.warn(failMessage);
}
}
*/
return sortedDependencies;
}