Skip to content

Commit 5f1ad2b

Browse files
committed
[CI] Disable moon cache for build (#238404)
## Summary Kibana's build seems to be breaking on a `yarn` command, it's not quite clear how/why, but this attempts to disable cache for that step, to get it working. (cherry picked from commit f9749b5)
1 parent 5594b8e commit 5f1ad2b

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

kbn_pm/src/commands/build_shared_packages.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import { run } from '../lib/spawn.mjs';
1111

12-
/** @type {import("../lib/command").Command} */
12+
/** @type {import('../lib/command').Command} */
1313
export const command = {
1414
name: 'build-shared',
1515
intro: 'Builds shared packages with webpack',
@@ -35,6 +35,10 @@ export const command = {
3535
[':build-webpack'].concat(!cache ? ['-u'] : []).concat(dist ? ['--', '--dist'] : []),
3636
{
3737
pipe: !quiet,
38+
env: {
39+
...process.env,
40+
...(!cache ? { MOON_CACHE: 'off' } : {}),
41+
},
3842
}
3943
);
4044

src/dev/build/tasks/build_packages_task.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export const BuildPackages: Task = {
109109
await buildWebpackBundles({
110110
quiet: false,
111111
dist: true,
112+
noCache: true,
112113
});
113114

114115
const transformConfig: TransformConfig = {
@@ -307,8 +308,20 @@ export const BuildPackages: Task = {
307308
},
308309
};
309310

310-
export async function buildWebpackBundles({ quiet, dist }: { quiet: boolean; dist: boolean }) {
311-
const options = [quiet ? ['--quiet'] : [], dist ? ['--dist'] : []].flat();
311+
export async function buildWebpackBundles({
312+
quiet,
313+
dist,
314+
noCache,
315+
}: {
316+
quiet: boolean;
317+
dist: boolean;
318+
noCache?: boolean;
319+
}) {
320+
const options = [
321+
quiet ? ['--quiet'] : [],
322+
dist ? ['--dist'] : [],
323+
noCache ? ['--no-cache'] : [],
324+
].flat();
312325
const stdio: StdioOption[] = quiet
313326
? ['ignore', 'pipe', 'pipe']
314327
: ['inherit', 'inherit', 'inherit'];

0 commit comments

Comments
 (0)