@@ -216,9 +216,10 @@ other 193 are refused at every site.
216216 one form able to pass never compiled is inconclusive, not refused, and the same holds for a
217217 run cut short.
218218
219- ** It found a compiler crash the documentation never would:** a bare ` [PopulateFrom] ` on an
220- Enum kills the compiler, at all three Enum sites; the tool isolated it by halving to one
221- probe beside the canaries. It is in [ BUGS-TO-REPORT.md] ( BUGS-TO-REPORT.md ) .
219+ ** It finds compiler crashes the documentation never would:** a crash in a batch is
220+ isolated by halving down to one probe beside the canaries, which is how a bare
221+ ` [PopulateFrom] ` on an Enum was found to kill the compiler (twinbasic/twinbasic #2450 , fixed
222+ in BETA 997).
222223
223224** Read the report's "accepted at most sites" section before believing an acceptance.**
224225` [Description] ` is taken at 53 of 61 sites and ` [Hidden] ` and ` [Restricted] ` at 42: either
@@ -245,8 +246,23 @@ override that, and one of the two is needed for an install kept anywhere else. *
245246path is hardcoded** , here or anywhere in the tooling: an install path contains a username.
246247
247248` --json ` gives the same thing as one object and ` --keep ` leaves the IDE running. Exit codes
248- are 0 clean, 1 the project has errors, 2 the harness failed, 3 the compile never settled, 4
249- the project crashes the compiler.
249+ are 0 clean, 1 the project has errors, 2 the harness failed or the project file cannot be read,
250+ 3 the compile never settled, 4 the project crashes the compiler.
251+
252+ ** A project file the IDE cannot read is refused before an IDE starts.** ` tbbuild ` reads the
253+ container with impexp's reader (` checkProject ` , in
254+ [ scripts/lib/tb-project.mjs] ( scripts/lib/tb-project.mjs ) ) and exits 2 within a moment,
255+ naming the file and the fault. Without that, BETA 995 gave exit 0, a clean compile with no
256+ rows, after the whole ` --timeout ` (66 s at ` --timeout 60 ` ) for an empty file, a file cut off
257+ halfway and a file with its first byte changed, and exit 3 for a text file. The IDE answers
258+ such a file with a message box, which nobody can see or answer on the private desktop. The
259+ status bar never settles, and a wait that ends at its deadline is read as a compile with no
260+ diagnostics, because ` waitForCompile ` does not report that it ran out of time. Only the
261+ container is checked: a file that reads as a project and that the IDE still cannot load is
262+ not covered. ` launchOnDesktop ` 's ` dialogs: "close" ` can record a box, but only by pressing OK
263+ on it, ` launchIde ` does not ask for it, and the job it matches boxes against is absent under
264+ ` --keep ` . Making ` waitForCompile ` say that it ran out of time would cover every such wedge,
265+ and is not done.
250266
251267** ` --show ` / ` --hide ` , and ` TBBUILD_SHOW ` for a whole session.** Hidden is the default. Its
252268cost shows only when something goes wrong: a wedged IDE on a private desktop is invisible to
@@ -434,27 +450,29 @@ other thirty their run.
434450
435451### Why it drives the WebView rather than the compiler directly
436452
437- The obvious improvement is to cut the browser out --- the compiler has websockets, so why go
438- through a UI at all? ** It cannot be done, and the reason is structural .**
453+ The obvious improvement is to cut the browser out: the compiler has websockets, so why go
454+ through a UI at all? ** It can be done, and the harness does not do it yet .**
439455
440456The IDE is three processes, and their command lines say how they relate:
441457
442458| process | command line | role |
443459| ---| ---| ---|
444460| ` twinBASIC.exe ` | ` <project.twinproj> ` | shell; hosts the WebView2, and the only one given the project |
445461| ` twinBASIC_win32.exe ` | ` --ide=<shell pid> ` | serves ` ide/ ` over HTTP on an ephemeral port |
446- | ` twinBASIC_win32_noDEP.exe ` | ` --compiler=<opaque token > ` | the compiler; the page talks to it over websockets |
462+ | ` twinBASIC_win32_noDEP.exe ` | ` --compiler=<window handle > ` | the compiler; the page talks to it over websockets |
447463
448464The page's websockets carry everything the window shows about a compile, the diagnostics and
449465their counts included.
450466
451- ** But what a connection needs, its address and its key, is minted inside the WebView** , by
452- host objects the shell gives its page --- reachable only from a page the shell has loaded.
453- Starting the compiler directly is no way round it either: ` --compiler= ` is not a port but
454- an opaque handle the shell hands it. So a proxy between the WebView and the HTTP server is
455- possible --- the page and its scripts come over plain HTTP, and a patched ` main2.js ` could
456- be served --- but it would not remove the WebView, it would only change what runs inside it.
457- The thing you would want to delete is the thing that mints the connection.
467+ ** The compiler chooses its own address and key, and tells the process that started it.** So
468+ a program that starts a compiler itself can connect to it, and ` --compiler= ` need not name a
469+ real window for a compile or a build (BETA 995).
470+
471+ What stands in the way is the work the page does over those connections. It loads the
472+ project, gives the compiler every package the project needs, answers what the compiler asks,
473+ and works out when a compile has finished. A client without the WebView has to do all of
474+ that itself, in a protocol that is the IDE's own and may change with any beta, while the IDE
475+ always speaks its own build's. So the harness drives the IDE.
458476
459477Watching the page's traffic is another matter: CDP shows it to the harness with no key, and
460478the wait for a compile ends on it (* How the wait for the compile ends* , above). The
@@ -517,6 +535,19 @@ Rules it follows:
517535
518536- ** ` element.click() ` on ` #buildIcon ` does nothing.** It is a plain DIV behind the IDE's own
519537 pointer handling and needs real ` Input.dispatchMouseEvent ` presses at its centre.
538+ - ** Build is pressed through ` pressBuild ` (` tb-ide.mjs ` ), which waits up to 60 s for the
539+ page globals ` licenceIsSet ` to be true and ` lockUICount ` to be 0.** ` tbBuild_Start ` waits
540+ only about five seconds for the compiler to answer the licence key's validation, which
541+ ` afterSocketsAreConnected ` resets on every compiler connection, and then writes "[ BUILD]
542+ failed due to licence error" and builds nothing. ` #appOverlay ` is a transparent element
543+ over the whole page, shown while ` lockUICount ` is above zero: by every modal dialog, the
544+ "Compiling..." and project-loading progress dialogs among them, and by an open menu. A press
545+ then fails with "its centre is covered by #appOverlay" (both were seen once each in a full
546+ ` bug_repro verify ` ). A licence still unset after the wait throws; an overlay still up is
547+ left to ` click ` , which names it.
548+ - ** A click that fails saves a picture of the page** (` pagePicture ` in ` tb-click.mjs ` , CDP
549+ ` Page.captureScreenshot ` , which works on the private desktop) under ` %TEMP%\tb-click\ ` , and
550+ its error names the file.
520551- ** Read the console's backing array, not the pane.** The DEBUG CONSOLE is a
521552 ` createListView() ` , which keeps only the rows that fit in the DOM, so scraping its
522553 ` innerText ` returns the * tail* of a long probe and looks exactly like a complete capture
@@ -763,6 +794,22 @@ variable left set in a shell would switch tidying off for good. Under `--keep` n
763794tidied, because the kept IDE is still writing. ` shutdownIde ` waits for the IDE's process to
764795be gone before anything is tidied, because ` taskkill ` only asks.
765796
797+ ** The last of several runs puts back for all of them.** Two runs at once --- two ` ide_test ` ,
798+ a ` tbrun ` beside a lane run, another session's --- cannot each put back on their own. An IDE
799+ holds the recent list in memory and writes all of it back when it opens a project, so a run
800+ whose IDE is still open writes the other run's entries back after that run removed them (two
801+ ` ide_test ` runs failed with exit 3 this way, each naming the other's lane folder). So the runs
802+ share one record in ` %TEMP%\tb-registry\<key> ` , read and written one run at a time under its
803+ ` busy ` folder: the first run to start records the recent list, the association and the theme
804+ (` base.json ` ); every run adds its folders and named projects (` <pid>-<n>.json ` ); a run that
805+ ends while another is running marks its record finished, puts nothing back and gets `{
806+ deferred: [ pids] }` from ` finishTidy`, which the lane runner reports instead of checking the
807+ lists; and the last run to end puts back for all, a named project from its oldest record. A
808+ record whose process died unfinished is swept by folder when the next run starts alone, and
809+ its record of the theme and recent list is dropped, since it may be days old.
810+ ` check_tb_registry.mjs ` plays out both. ` tbbuild --keep ` takes no part, so its IDE can still
811+ write the lists after the last run has put them back.
812+
766813** Why .NET through PowerShell and not ` reg.exe ` .** Node has no registry API. ` reg.exe `
767814prints value names in the console code page when its output is piped, so a path containing a
768815character outside that code page (an accented user name in ` %TEMP% ` is enough) comes back
@@ -1197,6 +1244,8 @@ leave the registry alone, and `finishTidy` once the last has ended. Then it chec
11971244than trusts: no project-state or recent-list entry may name a lane's folder, a second sweep
11981245of the remembered build targets must find none, and the add-ins' settings must be as
11991246recorded. Any failure is exit code 3, which wins over a lane's failure (1): the registry is what to repair.
1247+ While another harness run is still running, the lists and targets are that run's to put back
1248+ and are not checked; the report line says which pid.
12001249
12011250** An add-in's own settings are the runner's too.** ` SaveSetting ` writes under
12021251` HKCU\Software\VB and VBA Program Settings\<app> ` , the same key as any installed copy of the
0 commit comments