Closed jelly closed 8 months ago
[jelle@t14s][~/projects/cockpit-podman]%RSYNC=c make watch
tools/node-modules make_package_lock_json
NODE_ENV= ESBUILD_WATCH=true node build.js
Warning: Permanently added '[127.0.0.2]:2201' (ED25519) to the list of known hosts.
[watch] build finished, watching for changes...
^Cmake: *** [Makefile:98: watch] Interrupt
[jelle@t14s][~/projects/cockpit-podman]%ls dist
ls: cannot access 'dist': No such file or directory
[jelle@t14s][~/projects/cockpit-podman]%ls
bots@ cockpit-podman.spec Makefile org.cockpit-project.podman.metainfo.xml packaging/ plans/ src/ tools/
build.js HACKING.md metafile.json package.json packit.yaml po/ test/ Vagrantfile
cockpit-podman-64.4.g29060bb3.tar.xz LICENSE node_modules/ package-lock.json pkg/ README.md tmp/
[jelle@t14s][~/projects/cockpit-podman]%make
make package-lock.json && NODE_ENV= node build.js
make[1]: Entering directory '/home/jelle/projects/cockpit-podman'
tools/node-modules make_package_lock_json
make[1]: Leaving directory '/home/jelle/projects/cockpit-podman'
✘ [ERROR] No matching export in "src/PruneUnusedContainersModal.jsx" for import "PruneUnusedContainersModal"
src/Containers.jsx:40:9:
40 │ import { PruneUnusedContainersModal } from './PruneUnusedContainersModal.jsx';
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jelle/projects/cockpit-podman/src/PruneUnusedContainersModal.jsx
17:10 error 'ImageOptions' is defined but never used no-unused-vars
59:30 error 'setDeleteUserImages' is assigned a value but never used no-unused-vars
62:22 error 'setShifting' is assigned a value but never used no-unused-vars
72:13 error 'deleteSystemImages' is not defined no-undef
83:11 error 'isSystem' is assigned a value but never used no-unused-vars
84:11 error 'userImages' is assigned a value but never used no-unused-vars
84:24 error 'unusedImages' is not defined no-undef
85:11 error 'systemImages' is assigned a value but never used no-unused-vars
85:26 error 'unusedImages' is not defined no-undef
124:62 error 'deleteSystemImages' is not defined no-undef
✖ 10 problems (10 errors, 0 warnings)
✘ [ERROR] ESLint errors found [plugin eslintPlugin]
✘ [ERROR] ENOENT: no such file or directory, copyfile '/home/jelle/projects/cockpit-podman/src/manifest.json' -> '/home/jelle/projects/cockpit-podman/dist/manifest.json' [plugin plugin:copy]
This error came from the "onEnd" callback registered here:
/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1279:20:
1279 │ let promise = setup({
╵ ^
at setup (file:///home/jelle/projects/cockpit-podman/node_modules/esbuild-plugin-copy/dist/index.mjs:76:23)
at handlePlugins (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1279:21)
at buildOrContextImpl (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:968:5)
at Object.buildOrContext (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:776:5)
at /home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2172:68
at new Promise (<anonymous>)
at Object.context (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2172:27)
at Object.context (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2012:58)
at file:///home/jelle/projects/cockpit-podman/build.js:39:31
✘ [ERROR] ENOENT: no such file or directory, open '/home/jelle/projects/cockpit-podman/dist/po.cs.js' [plugin cockpitPoEsbuildPlugin]
/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1481:32:
1481 │ const value = await callback(result);
╵ ^
at Object.openSync (node:fs:585:3)
at Object.writeFileSync (node:fs:2229:35)
at file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:95:16
at new Promise (<anonymous>)
at buildFile (file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:49:12)
at file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:108:48
at Array.map (<anonymous>)
at run (file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:108:39)
at file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:115:41
at /home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1481:33
This error came from the "onEnd" callback registered here:
/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1279:20:
1279 │ let promise = setup({
╵ ^
at setup (file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:115:15)
at handlePlugins (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1279:21)
at buildOrContextImpl (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:968:5)
at Object.buildOrContext (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:776:5)
at /home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2172:68
at new Promise (<anonymous>)
at Object.context (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2172:27)
at Object.context (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2012:58)
at file:///home/jelle/projects/cockpit-podman/build.js:39:31
4 errors
/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1636
let error = new Error(`${text}${summary}`);
^
Error: Build failed with 4 errors:
src/Containers.jsx:40:9: ERROR: No matching export in "src/PruneUnusedContainersModal.jsx" for import "PruneUnusedContainersModal"
error: ESLint errors found
error: ENOENT: no such file or directory, copyfile '/home/jelle/projects/cockpit-podman/src/manifest.json' -> '/home/jelle/projects/cockpit-podman/dist/manifest.json'
/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1481:32: ERROR: [plugin: cockpitPoEsbuildPlugin] ENOENT: no such file or directory, open '/home/jelle/projects/cockpit-podman/dist/po.cs.js'
at failureErrorWithLog (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1636:15)
at /home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1048:25
at /home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1512:9
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errors: [
{
detail: undefined,
id: '',
location: {
column: 9,
file: 'src/Containers.jsx',
length: 26,
line: 40,
lineText: "import { PruneUnusedContainersModal } from './PruneUnusedContainersModal.jsx';",
namespace: '',
suggestion: ''
},
notes: [],
pluginName: '',
text: 'No matching export in "src/PruneUnusedContainersModal.jsx" for import "PruneUnusedContainersModal"'
},
{
id: '',
pluginName: 'eslintPlugin',
text: 'ESLint errors found',
location: null,
notes: [],
detail: -1
},
{
id: '',
pluginName: 'plugin:copy',
text: "ENOENT: no such file or directory, copyfile '/home/jelle/projects/cockpit-podman/src/manifest.json' -> '/home/jelle/projects/cockpit-podman/dist/manifest.json'",
location: null,
notes: [
{
text: 'This error came from the "onEnd" callback registered here:',
location: {
file: '/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js',
namespace: 'file',
line: 1279,
column: 20,
length: 0,
lineText: ' let promise = setup({\n' +
' at setup (file:///home/jelle/projects/cockpit-podman/node_modules/esbuild-plugin-copy/dist/index.mjs:76:23)\n' +
' at handlePlugins (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1279:21)\n' +
' at buildOrContextImpl (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:968:5)\n' +
' at Object.buildOrContext (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:776:5)\n' +
' at /home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2172:68\n' +
' at new Promise (<anonymous>)\n' +
' at Object.context (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2172:27)\n' +
' at Object.context (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2012:58)\n' +
' at file:///home/jelle/projects/cockpit-podman/build.js:39:31',
suggestion: ''
}
}
],
detail: 0
},
{
id: '',
pluginName: 'cockpitPoEsbuildPlugin',
text: "ENOENT: no such file or directory, open '/home/jelle/projects/cockpit-podman/dist/po.cs.js'",
location: {
file: '/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js',
namespace: 'file',
line: 1481,
column: 32,
length: 0,
lineText: ' const value = await callback(result);\n' +
' at Object.openSync (node:fs:585:3)\n' +
' at Object.writeFileSync (node:fs:2229:35)\n' +
' at file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:95:16\n' +
' at new Promise (<anonymous>)\n' +
' at buildFile (file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:49:12)\n' +
' at file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:108:48\n' +
' at Array.map (<anonymous>)\n' +
' at run (file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:108:39)\n' +
' at file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:115:41\n' +
' at /home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1481:33',
suggestion: ''
},
notes: [
{
text: 'This error came from the "onEnd" callback registered here:',
location: {
file: '/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js',
namespace: 'file',
line: 1279,
column: 20,
length: 0,
lineText: ' let promise = setup({\n' +
' at setup (file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:115:15)\n' +
' at handlePlugins (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1279:21)\n' +
' at buildOrContextImpl (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:968:5)\n' +
' at Object.buildOrContext (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:776:5)\n' +
' at /home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2172:68\n' +
' at new Promise (<anonymous>)\n' +
' at Object.context (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2172:27)\n' +
' at Object.context (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2012:58)\n' +
' at file:///home/jelle/projects/cockpit-podman/build.js:39:31',
suggestion: ''
}
}
],
detail: 1
}
],
warnings: []
}
Node.js v19.7.0
make: *** [Makefile:95: dist/manifest.json] Error 1
[jelle@t14s][~/projects/cockpit-podman]%RSYNC=c make watch
tools/node-modules make_package_lock_json
NODE_ENV= ESBUILD_WATCH=true node build.js
Warning: Permanently added '[127.0.0.2]:2201' (ED25519) to the list of known hosts.
[watch] build finished, watching for changes...
^Cmake: *** [Makefile:98: watch] Interrupt
[jelle@t14s][~/projects/cockpit-podman]%make
make package-lock.json && NODE_ENV= node build.js
make[1]: Entering directory '/home/jelle/projects/cockpit-podman'
tools/node-modules make_package_lock_json
make[1]: Leaving directory '/home/jelle/projects/cockpit-podman'
/home/jelle/projects/cockpit-podman/src/PruneUnusedContainersModal.jsx
17:10 error 'ImageOptions' is defined but never used no-unused-vars
59:30 error 'setDeleteUserImages' is assigned a value but never used no-unused-vars
62:22 error 'setShifting' is assigned a value but never used no-unused-vars
72:13 error 'deleteSystemImages' is not defined no-undef
83:11 error 'isSystem' is assigned a value but never used no-unused-vars
84:11 error 'userImages' is assigned a value but never used no-unused-vars
84:24 error 'unusedImages' is not defined no-undef
85:11 error 'systemImages' is assigned a value but never used no-unused-vars
85:26 error 'unusedImages' is not defined no-undef
124:62 error 'deleteSystemImages' is not defined no-undef
✖ 10 problems (10 errors, 0 warnings)
✘ [ERROR] ESLint errors found [plugin eslintPlugin]
1 error
/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1636
let error = new Error(`${text}${summary}`);
^
Error: Build failed with 1 error:
error: ESLint errors found
at failureErrorWithLog (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1636:15)
at /home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1048:25
at /home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1512:9
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errors: [
{
id: '',
pluginName: 'eslintPlugin',
text: 'ESLint errors found',
location: null,
notes: [],
detail: -1
}
],
warnings: []
}
Node.js v19.7.0
make: *** [Makefile:95: dist/manifest.json] Error 1
Hmm, did our build.js remove the dist
directory all by itself, or did you run a git clean
while it was running? I.e. do you have steps how to reproduce?
There are two issues:
When I add brackets to the imort of PruneUnusedImagesModal
in src/Images.jsx
so:
import PruneUnusedImagesModal from './PruneUnusedImagesModal.jsx';
To:
import { PruneUnusedImagesModal } from './PruneUnusedImagesModal.jsx';
This import is borked, and then watch breaks with an empty dist
dir I think. If I start it again, then there is no error shown I am not sure if that is related to the non-existing dist dir.
Investigating further it seems that make watch
has some issues and does not seem to work correctly, make watch
does not create a build and does not watch for changes for some reason. npm run watch
seems to work fine.
Actually not 100% true, both are broken now:
[jelle@t14s][~/projects/cockpit-podman]%npm run watch
> watch
> ESBUILD_WATCH='true' node build.js
[watch] build finished, watching for changes...
^C
[jelle@t14s][~/projects/cockpit-podman]%ls dist
ls: cannot access 'dist': No such file or directory
[jelle@t14s][~/projects/cockpit-podman]%make watch
tools/node-modules make_package_lock_json
NODE_ENV= ESBUILD_WATCH=true node build.js
[watch] build finished, watching for changes...
^Cmake: *** [Makefile:98: watch] Interrupt
[jelle@t14s][~/projects/cockpit-podman]%ls dist
ls: cannot access 'dist': No such file or directory
Ok one of the issues in watch mode is that if you write invalid JS it will just crash and burn and not keep watching
1 error
[watch] build finished
Warning: Permanently added '[127.0.0.2]:2201' (ED25519) to the list of known hosts.
16,338,753 100% 232.55MB/s 0:00:00 (xfr#22, to-chk=0/23)
[watch] build started (change: "src/PruneUnusedContainersModal.jsx")
✘ [ERROR] Expected "}" but found ")"
src/PruneUnusedContainersModal.jsx:94:122:
94 │ <Td dataLabel={columnNames.created}>{utils.localize_time(Date.parse(container.created) / 1000))}</Td>
│ ^
╵ }
/home/jelle/projects/cockpit-podman/src/PruneUnusedContainersModal.jsx
94:123 error Parsing error: Unexpected token )
✖ 1 problem (1 error, 0 warnings)
✘ [ERROR] ESLint errors found [plugin eslintPlugin]
✘ [ERROR] ENOENT: no such file or directory, copyfile '/home/jelle/projects/cockpit-podman/src/manifest.json' -> '/home/jelle/projects/cockpit-podman/dist/manifest.json' [plugin plugin:copy]
This error came from the "onEnd" callback registered here:
/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1279:20:
1279 │ let promise = setup({
╵ ^
at setup (file:///home/jelle/projects/cockpit-podman/node_modules/esbuild-plugin-copy/dist/index.mjs:76:23)
at handlePlugins (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1279:21)
at buildOrContextImpl (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:968:5)
at Object.buildOrContext (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:776:5)
at /home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2172:68
at new Promise (<anonymous>)
at Object.context (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2172:27)
at Object.context (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2012:58)
at file:///home/jelle/projects/cockpit-podman/build.js:39:31
✘ [ERROR] ENOENT: no such file or directory, open '/home/jelle/projects/cockpit-podman/dist/po.cs.js' [plugin cockpitPoEsbuildPlugin]
/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1481:32:
1481 │ const value = await callback(result);
╵ ^
at Object.openSync (node:fs:585:3)
at Object.writeFileSync (node:fs:2229:35)
at file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:95:16
at new Promise (<anonymous>)
at buildFile (file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:49:12)
at file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:108:48
at Array.map (<anonymous>)
at run (file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:108:39)
at file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:115:41
at /home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1481:33
This error came from the "onEnd" callback registered here:
/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1279:20:
1279 │ let promise = setup({
╵ ^
at setup (file:///home/jelle/projects/cockpit-podman/pkg/lib/cockpit-po-plugin.js:115:15)
at handlePlugins (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:1279:21)
at buildOrContextImpl (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:968:5)
at Object.buildOrContext (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:776:5)
at /home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2172:68
at new Promise (<anonymous>)
at Object.context (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2172:27)
at Object.context (/home/jelle/projects/cockpit-podman/node_modules/esbuild/lib/main.js:2012:58)
at file:///home/jelle/projects/cockpit-podman/build.js:39:31
4 errors
[watch] build finished
Warning: Permanently added '[127.0.0.2]:2201' (ED25519) to the list of known hosts.
rsync: [sender] change_dir "/home/jelle/projects/cockpit-podman/dist" failed: No such file or directory (2)
0 100% 0.00kB/s 0:00:00 (xfr#0, to-chk=0/0)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1336) [sender=3.2.7]
[jelle@t14s][~/projects/cockpit-podman]%
Seems the rsync plugin breaks maybe?
Right, we call rsync
and check the exit code which is 1 as the dist
dir is gone as it couldn't be compiled. But hmm I don't think we should be calling rsyncplugin if the build fails.
My fix for now:
if (code !== 0) {
// process.exit(1);
I think watching works now as I think there was just a super big delay in the build which is now fixed in main. There is still a bug that when the build fails the plugins are being called, which made rsync exit and the verbose output from the po plugin.
Something like:
build.onEnd(result => result.errors.length !== 0 && run(() => {}));
However, the copy plugin does not do this correctly so it will still fail.
This is not a podman specific issue.
@KKoukiou @martinpitt this is something which did not used to happen with the old watch mode, but now it seems to crash after a while