Closed bug report

compile_intlib: IntLib is written, then Altium shows 'Could not create integrated library .' and the verb reports agent_script_error

ivan.mendez · ·closed by Colby Knox

altium-bridge 0.2.99 · Adom Bridge 2.1.x · Altium Designer 26.11.1 Professional · Windows 11 (user profile path with non-ASCII characters)

What happens. altium_compile_intlib {libpkgPath} writes the .IntLib correctly, then Altium raises an Error box "Could not create integrated library ." (note the empty name before the dot) and the verb answers agent_script_error. The bridge auto-recovers, so nothing is left blocked, but every successful compile reports as a failure.

Repro (3 out of 3 runs today):

altium_compile_intlib {"libpkgPath":"C:\\...\\Resources\\Librerias\\LDO_5V_3V3_Board.LibPkg","timeout":300}

LibPkg layout (plain, two source docs, relative paths):

Resources\Librerias\LDO_5V_3V3_Board.LibPkg
Resources\Librerias\LDO_5V_3V3_Board\LDO_5V_3V3_Board.SchLib   (9 components)
Resources\Librerias\LDO_5V_3V3_Board\LDO_5V_3V3_Board.PcbLib   (7 footprints, STEP bodies)

Reply (verbatim, trimmed):

{"agentAlive": true, "autoRecovered": true, "command": "compile_intlib", "durationMs": 46740,
 "error": "the agent script raised a runtime error while running 'compile_intlib' (Altium showed an 'Error' box; its text is in errorShot)",
 "errorCode": "agent_script_error",
 "recoverSteps": [{"reason": "auto: script Error box during agent command 'compile_intlib'"}, {"scriptActivatedAndStopped": "AdomAgent_c225884e5e.pas"}, {"editScriptStop": "sent", "exited": true, "sec": 1.2}, {"reaped": false}, {"verifiedByRestartingTheAgent": true}],
 "success": false}

Evidence the compile itself worked: Project Outputs for LDO_5V_3V3_Board\LDO_5V_3V3_Board.IntLib is rewritten each time (timestamps 09:37, 10:31, 10:33, 10:47 today, 751 KB), and decoding it gives all 9 components with their footprints and parameters (0 pin/pad mismatches).

Guess. The verb seems to trigger a second compile (or a compile of the focused project) after the first one finished, and that second one has no project name, hence "Could not create integrated library .". Maybe the LibPkg is opened, compiled, and then the compile process runs again against whatever is focused.

Expected. success: true with the output path, as the file is in fact written.

errorShot attached.

compile_intlib_errorShot

2 Replies

ivan.mendez ·

Extra data point: 4 runs today on the same LibPkg. Three ended with the error box above (09:37, 10:31/10:33, 10:47, 10:49) and one at 10:51 answered status: ok, no box. The only difference I can see: before the successful run I had closed two script projects (.PrjScr) that were still open in the Projects panel, and the PcbLib had just been saved. So it may depend on which project is focused/open when the second compile fires.

Colby Knox marked this in progress ·
Colby Knox ·

Thanks for the clear report and the timestamps. They pointed straight at it. Fixed in altium-bridge 0.2.100, which is public now.

What was wrong. Your guess was right: the verb built the library twice. Compiling a LibPkg already writes its IntLib, which is why your file was always correct. The verb then called Altium's CreateIntegratedLibrary a second time. That call takes the output file as its argument, and the verb passed an empty name, so Altium answered "Could not create integrated library ." The extra build now runs only when you pass output, and it writes to the file you name.

What the reply says now

  • intlib: the path of the IntLib.
  • written: true: the file on disk changed during this call.
  • bytes, plus sources: the libraries your LibPkg lists.
  • output is optional. Give it a folder (the IntLib inside is named after the LibPkg) or a full .IntLib path. Without it, the IntLib goes to Project Outputs for <name>, as before.
  • New errors:
    • libpkg_not_found: the LibPkg path does not exist.
    • intlib_not_written: no new IntLib appeared.
    • libpkg_sources_missing: a SchLib or PcbLib the LibPkg lists is not on disk. Altium still writes an IntLib in that case, just without those parts, so the verb no longer calls that a success. missingSources names the files.

What we tested on Altium Designer 26.11.1, with a LibPkg in a folder named with Ñ and ú and the same layout as yours (Resources\Librerias\<name>.LibPkg with the SchLib and PcbLib in a subfolder):

  • Three compiles in a row.
  • An output folder, and a named Mía.IntLib.
  • A LibPkg Altium had never opened.

All of them succeeded with no error box, and every IntLib had all its parts. A missing LibPkg and one with a missing SchLib each gave the new error.

To update, restart the Altium bridge from Adom Bridge's Bridges panel, or wait for the automatic update. If you see the box again on 0.2.100, reopen this issue with the reply.

Colby Knox closed this ·

Log in to reply.