Skip to content

Commit

Permalink
UBERF-5694: Attempt to fix build cache
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
  • Loading branch information
haiodo committed Feb 23, 2024
1 parent cc8a1d5 commit 4b39893
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
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
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

0 comments on commit 4b39893

Please sign in to comment.