Asymptote, PreTeXt, and codespaces

19 views
Skip to first unread message

Sean Fitzpatrick

unread,
Jun 23, 2026, 9:21:31 PMJun 23
to PreTeXt development
Recently, Steven asked Greg Hartman to configure the APEX repository to run on GitHub Codespaces.

Greg did, and of course the first thing he tried was building the PDF. It failed.
The reason it failed is that Codespaces is currently incapable of building 3D Asymptote to PDF, because typical builds of Asymptote assume the presence of a GPU.

On the Asymptote forums, I got a recommendation from John Bowman: the most recent version of Asymptote (3.12 or later) includes Vulcan support.
I know nothing about Vulcan (aside from Spock et al), but word is that if Asymptote 3.12 is compiled with Vulcan libraries, running Asymptote with the --offscreen flag should work in an environment like codespaces.

I owe you a pull request that replaces the '-iconify' flag with '-offscreen' (a back to the future pull request, it seems). This should have no effect on anyone building locally on Linux, it should resolve the bug on Windows (anyone without a discrete graphics card gets a black rectangle for every diagram), and it sets up codespaces to work in the future.

For Oscar: do you have the ability to compile a particular version of Asymptote with an optional library within the Docker container used by codespaces? Version 3.12 is the latest release, so it won't yet be bundled with any TeX distributions. Download options are a .tgz of the source code, or .rpm.

Rob Beezer

unread,
Jun 26, 2026, 12:36:18 PMJun 26
to prete...@googlegroups.com
On 6/23/26 18:21, Sean Fitzpatrick wrote:
> For Rob: this resurrects an old discussion (https://groups.google.com/g/pretext-
> dev/c/7KVuONMZcOE/m/ZIH6ZjN1BgAJ)
> I owe you a pull request that replaces the '-iconify' flag with '-offscreen' (a
> back to the future pull request, it seems). This should have no effect on anyone
> building locally on Linux, it should resolve the bug on Windows (anyone without
> a discrete graphics card gets a black rectangle for every diagram), and it sets
> up codespaces to work in the future.

Right - the reverse of what we did six years ago?

https://github.com/PreTeXtBook/pretext/commit/3bb8833bde95ca32fa7171d0fbc53c178287c9d9

PR would be welcome. Uncontroversial, I guess, so long as it works. You will
need to do testing on Windows, i don't really have that set up.

Rob

Sean Fitzpatrick

unread,
Jun 30, 2026, 3:12:13 PM (11 days ago) Jun 30
to PreTeXt development
Windows testing has been a bit of a nightmare... 

I can get the latest Asymptote installed. Then lots of fighting with config files and environment variables to make sure that version gets used rather than the one that ships with TeXLive or MikTeX.

My last attempt at generating a figure produced an out of memory error. 

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAxMy5iZWV6ZXI.1782491776%40pnsh.

Sean Fitzpatrick

unread,
Jul 9, 2026, 6:42:48 PM (2 days ago) Jul 9
to PreTeXt development
An update. This has taken longer than expected. I managed to find an image in APEX that hit an error I could reproduce on John Bowman's server.
This appears to have led to him staying up all night and releasing version 3.13 of Asymptote today. Everything builds without errors on Linux. I still need to check on Windows. (On Windows, one has to wait for the official .exe release, I think. I don't know how to build from Git source over there...)

I think I need to go through Oscar to test on codespaces, which remains a mystery to me.

Changing the executable to use -offscreen instead of -iconify should be harmless for most users.
Somewhere between version 2.87 and version 3.12 of Asymptote, something changed that blew up memory usage for building 3D PDF.
I don't know if any other projects have a lot of 3D Asymptote, however. But regardless of whether the switch is -offscreen or -iconify, anyone trying to build 3D PDF with Asymptote is going to hit errors, I think.

Reply all
Reply to author
Forward
0 new messages