Open Bug 1504688 Opened 7 years ago Updated 4 years ago

EventArtifactDefinitions.json present in build folder with "{ invalid,JSON { {1}" contents (Linux)

Categories

(Toolkit :: Telemetry, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: chutten, Unassigned)

Details

When building (non-artefact build) and testing on Linux I noticed an error log in the Browser Console complaining that EventArtifactDefinitions.json had invalid JSON. Checking the objdir, it certainly was invalid. Checking the source code, that file is generated with those contents in only one place: test_invalidJSON in test_TelemetryEvents_buildFaster.js I'm not sure how it persisted after running the test, which explicitly removes the file at the end. After touching any part of the event build step it generated a proper EventArtifactDefinitions JSON which overwrote it and all is now well. We should investigate.
At `mach build`-time the build system is first generating the `EventArtifactDefinitions.json` in the object dir, then sym-linking it into the `obj/dist` directory. `test_TelemetryEvents_buildFaster.js` gets the path to the file in the `obj/dist` and writes to it. As it is a symlink, the content lands in the original file in the object dir. After this test it removes the file by the symlink path, therefore only removing the symlink. The content stays in the original file. This logs errors about this file being invalid in subsequent runs of that build, though no hard failure. We could start the test by removing the file by path. Subsequent writes will write a new file, instead of writing through the symlink.
I find it interesting to note that this implies that ./mach run reads from the objdir itself not dist/, otherwise it would go looking for the symlink and, upon not finding it, not error.
Maybe I build again in between and ./mach run read from dist/ across the recreated symlink to the invalid file which wasn't regenerated because the build would have been incremental.
Priority: -- → P2
Priority: P2 → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.