Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UBERF-5694: Attempt to fix build cache #4757

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions common/config/rush/command-line.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,18 @@
],
"commands": [
{
"commandKind": "bulk",
"commandKind": "phased",
"name": "build:watch",
"summary": "Build and watch",
"phases": ["_phase:build", "_phase:validate"],
"description": "Perform build with tsc and watch for changes with rush",
"enableParallelism": true,
"incremental": true,
"ignoreMissingScript": true,
"watchForChanges": true,
"safeForSimultaneousRushProcesses": true,
"disableBuildCache": false
"watchOptions": {
"alwaysWatch": true,
"watchPhases": ["_phase:build", "_phase:validate"]
}
},
{
"commandKind": "bulk",
Expand Down Expand Up @@ -130,7 +132,7 @@
"phases": ["_phase:validate"],
"summary": "validate",
"enableParallelism": true,
"incremental": true
"incremental": true
},
{
"commandKind": "phased",
Expand Down
2 changes: 1 addition & 1 deletion common/config/rush/experiments.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* If true, build caching will respect the allowWarningsInSuccessfulBuild flag and cache builds with warnings.
* This will not replay warnings from the cached build.
*/
// "buildCacheWithAllowWarningsInSuccessfulBuild": true,
"buildCacheWithAllowWarningsInSuccessfulBuild": true,

/**
* If true, the phased commands feature is enabled. To use this feature, create a "phased" command
Expand Down
4 changes: 2 additions & 2 deletions dev/tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"docker:build": "docker build -t hardcoreeng/tool .",
"docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/tool staging",
"docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/tool",
"run-local": "cross-env SERVER_SECRET=secret MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin MINIO_ENDPOINT=localhost MONGO_URL=mongodb://localhost:27017 TRANSACTOR_URL=ws://localhost:3333 TELEGRAM_DATABASE=telegram-service ELASTIC_URL=http://localhost:9200 REKONI_URL=http://localhost:4004 MODEL_VERSION=$(node ../../common/scripts/show_version.js) GIT_REVISION=$(git describe --all --long) node -r ts-node/register --max-old-space-size=18000 ./src/__start.ts",
"run": "cross-env node -r ts-node/register --max-old-space-size=8000 MODEL_VERSION=$(node ../../common/scripts/show_version.js) ./src/__start.ts",
"run-local": "rush bundle --to @hcengineering/tool >/dev/null && cross-env SERVER_SECRET=secret MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin MINIO_ENDPOINT=localhost MONGO_URL=mongodb://localhost:27017 TRANSACTOR_URL=ws://localhost:3333 TELEGRAM_DATABASE=telegram-service ELASTIC_URL=http://localhost:9200 REKONI_URL=http://localhost:4004 MODEL_VERSION=$(node ../../common/scripts/show_version.js) GIT_REVISION=$(git describe --all --long) node --max-old-space-size=18000 ./bundle/bundle.js",
"run": "rush bundle --to @hcengineering/tool >/dev/null && cross-env node --max-old-space-size=8000 ./bundle/bundle.js",
"upgrade": "rushx run-local upgrade",
"format": "format src",
"test": "jest --passWithNoTests --silent --forceExit",
Expand Down
16 changes: 8 additions & 8 deletions packages/platform-rig/bin/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ const { spawn } = require('child_process')
const esbuild = require('esbuild')
const { copy } = require('esbuild-plugin-copy')

async function execProcess(cmd, logFile, args) {
async function execProcess(cmd, logFile, args, buildDir= '.build') {
let compileRoot = dirname(dirname(process.argv[1]))
console.log('Running from',)
console.log("Compiling...\n", process.cwd(), args)

if (!existsSync(join(process.cwd(), '.build'))) {
mkdirSync(join(process.cwd(), '.build'))
if (!existsSync(join(process.cwd(), buildDir))) {
mkdirSync(join(process.cwd(), buildDir))
}

const compileOut = spawn(cmd, args)

const stdoutFilePath = `.build/${logFile}.log`
const stderrFilePath = `.build/${logFile}-err.log`
const stdoutFilePath = `${buildDir}/${logFile}.log`
const stderrFilePath = `${buildDir}/${logFile}-err.log`


const outPromise = new Promise((resolve) => {
Expand Down Expand Up @@ -159,14 +159,14 @@ async function validateTSC(st) {
}
await execProcess(
'tsc',
'tsc',
'validate',
[
'-pretty',
"--emitDeclarationOnly",
"--incremental",
"--incremental",
"--tsBuildInfoFile", ".validate/tsBuildInfoFile.info",
"--declarationDir", "types",
...args.splice(1)
])
], '.validate')
}

4 changes: 3 additions & 1 deletion packages/platform-rig/bin/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ if( filesToCheck.length > 0 ) {
}

console.log(`running eslint ${filesToCheck.length}`)
const eslint = spawnSync(join(process.cwd(), 'node_modules/.bin/eslint'), ["--color", "--fix", ...filesToCheck])
const eslint = spawnSync(join(process.cwd(), 'node_modules/.bin/eslint'), ["--color", "--fix", ...filesToCheck], {
env: {...process.env, NODE_ENV: '--max-old-space-size=4096' },
})
if(eslint.stdout != null) {
writeFileSync('.format/eslint.log', eslint.stdout)
if( prettier.status === null || prettier.status === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"temp/**",
"lib/**",
"**/*.svelte",
".build/**"
".build/**",
".validate/**",
".format/**",
"types"
],
"disableBuildCacheForProject": false,

Expand All @@ -26,8 +29,7 @@
},
{
"operationName": "_phase:build",
"outputFolderNames": ["lib", ".build"],
"disableBuildCacheForOperation": true
"outputFolderNames": ["lib", ".build"]
},
{
"operationName": "_phase:validate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"rush-logs/**",
"coverage/**",
".rush/**",
".build/**"
".build/**",
".validate/**",
".format/**",
"types"
],
"disableBuildCacheForProject": false,

Expand All @@ -27,8 +30,7 @@
},
{
"operationName": "_phase:build",
"outputFolderNames": ["lib", ".build"],
"disableBuildCacheForOperation": true
"outputFolderNames": ["lib", ".build"]
},
{
"operationName": "_phase:validate",
Expand Down
8 changes: 5 additions & 3 deletions packages/platform-rig/profiles/model/config/rush-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"temp/**",
"lib/**",
"coverage/**",
".build/**"
".build/**",
".validate/**",
".format/**",
"types"
],
"disableBuildCacheForProject": false,

Expand All @@ -22,8 +25,7 @@
},
{
"operationName": "_phase:build",
"outputFolderNames": ["lib", ".build"],
"disableBuildCacheForOperation": true
"outputFolderNames": ["lib", ".build"]
},
{
"operationName": "_phase:validate",
Expand Down
8 changes: 5 additions & 3 deletions packages/platform-rig/profiles/node/config/rush-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"temp/**",
"lib/**",
"coverage/**",
".build/**"
".build/**",
".validate/**",
".format/**",
"types"
],
"disableBuildCacheForProject": false,

Expand All @@ -26,8 +29,7 @@
},
{
"operationName": "_phase:build",
"outputFolderNames": ["lib", ".build"],
"disableBuildCacheForOperation": true
"outputFolderNames": ["lib", ".build"]
},
{
"operationName": "_phase:validate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
"rush-logs/**",
"coverage/**",
".rush/**",
".build/**"
".build/**",
".validate/**",
".format/**",
"types",
"dist"
],
"disableBuildCacheForProject": false,

Expand All @@ -32,8 +36,7 @@
},
{
"operationName": "_phase:build",
"outputFolderNames": ["lib", ".build"],
"disableBuildCacheForOperation": true
"outputFolderNames": ["lib", ".build"]
},
{
"operationName": "_phase:validate",
Expand Down
8 changes: 5 additions & 3 deletions packages/platform-rig/profiles/ui/config/rush-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
".build/**",
"coverage/**",
"**/*.svelte",
".build/**"
".build/**",
".validate/**",
".format/**",
"types"
],
"disableBuildCacheForProject": false,

Expand All @@ -23,8 +26,7 @@
},
{
"operationName": "_phase:build",
"outputFolderNames": ["lib", ".build"],
"disableBuildCacheForOperation": true
"outputFolderNames": ["lib", ".build"]
},
{
"operationName": "_phase:validate",
Expand Down
2 changes: 1 addition & 1 deletion rush.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* path segment in the "$schema" field for all your Rush config files. This will ensure
* correct error-underlining and tab-completion for editors such as VS Code.
*/
"rushVersion": "5.113.4",
"rushVersion": "5.115.0",

/**
* The next field selects which package manager should be installed and determines its version.
Expand Down
Loading