diff --git a/e2e/nx-misc/src/watch.test.ts b/e2e/nx-misc/src/watch.test.ts index ea287ec4438f3..426361f2a0eb5 100644 --- a/e2e/nx-misc/src/watch.test.ts +++ b/e2e/nx-misc/src/watch.test.ts @@ -7,10 +7,15 @@ import { getStrippedEnvironmentVariables, updateJson, isVerboseE2ERun, + readFile, } from '@nx/e2e/utils'; import { spawn } from 'child_process'; import { join } from 'path'; -import { writeFileSync } from 'fs'; +import { writeFileSync, mkdtempSync } from 'fs'; +import { tmpdir } from 'os'; + +let cacheDirectory = mkdtempSync(join(tmpdir(), 'daemon')); +console.log('cache directory', cacheDirectory); async function writeFileForWatcher(path: string, content: string) { const e2ePath = join(tmpProjPath(), path); @@ -33,11 +38,17 @@ describe('Nx Watch', () => { env: { NX_DAEMON: 'true', NX_NATIVE_LOGGING: 'nx', + NX_PROJECT_GRAPH_CACHE_DIRECTORY: cacheDirectory, }, }); }); afterEach(() => { + if (process.env.NX_E2E_OUTPUT_DAEMON_LOGS === 'true') { + let daemonLog = readFile(join(cacheDirectory, 'd/daemon.log')); + const testName = expect.getState().currentTestName; + console.log(`${testName} daemon log: \n${daemonLog}`); + } runCLI('reset'); }); diff --git a/packages/nx/src/native/watch/utils.rs b/packages/nx/src/native/watch/utils.rs index 134550fa87727..23af392b9a900 100644 --- a/packages/nx/src/native/watch/utils.rs +++ b/packages/nx/src/native/watch/utils.rs @@ -52,7 +52,7 @@ pub(super) fn get_nx_ignore>(origin: P) -> Option { } pub(super) fn transform_event(watch_event: &Event) -> Option { - if cfg!(linux) { + if cfg!(target_os = "linux") { let tags = watch_event .tags .clone()