Closed matko closed 2 months ago
Unfortunately, this is still not building with latest swipl-devel (9624767), which has this patch. Error remains the same.
Hmm. That is odd. I unset DISPLAY and did a clean build without any problems. Could it be that DISPLAY is set to the empty string? As is, I just check getenv("DISPLAY")
, I do not check whether the value is empty or in any way sensible.
I patched the nix build to report on the DISPLAY variable early on in the script using echo "display is ${DISPLAY:-unset}"
, and this reports it is unset. It is really not there, unless something later on in the build sets it, which I very much doubt.
Hmm. Tried again, but I cannot reproduce this. All I can suggest is to put some print statements in getDPIDisplay(). That seems to be what opens the display and what has been changed not to try this if $DISPLAY
is unset on non-Windows.
doing a bisect points at 2bbad8c2cbcf5c9ac83353d9df3574dcab191b17 as the culprit. Indeed, if I revert this patch, things build again. The problem appears to be that generating documentation wants the default values for these properties to be retrievable, which they were before cause they were just constants, but now that there's an expression involving @display, this doesn't work anymore. Maybe you're not seeing this due to not building the documentation?
Maybe you're not seeing this due to not building the documentation?
I build the HTML docs. I did not test building the PDF docs. I.e., I ran a completely default build with all dependencies in place. Yes, it refers to @display
, but AFAIK, that should not be a problem as long as we do not open the display.
This commit indeed forces the display to be opened to try and fetch the DPI from the X server. The subsequent 4564011c4579a8b98614c8b8ab6f1bc23635bf9a restricts this to only open the display if getenv("DISPLAY")
is non-NULL. For me, this does the trick. Without this patch the build crashes as indicated and after this patch it builds cleanly.
I know it is a silly question, but you did update the submodule, no? Otherwise I'd add some print statements near the patches in getDPIDisplay() to see what is happening.
Yeah, I've been running with the latest xpce (fd35abb8), and I've been liberally adding printf statements to see what is going on. getDpiDisplay
is not even called. GetSizeDisplay
however is and is what is failing.
Ah, now I see. My Defaults file overruled the image.scale resource. But, that one is wrong. Should have been dpi rather than size. Just pushed a fix for that after testing on my big monitor.
That probably also refers to using files from $HOME
: it reads the xpce/Defaults file. It probably should not :cry:
Yep, now it builds! sandboxed builds sure are fun for spotting such issues :)
Starting with commit 769595e, builds fail if xpce is enabled in the build, but no X server is found. Relevant bit of log from the failing (Nix) build:
The build still works when the X dependencies are not present.
So it appears to be faling on a missing
DISPLAY
variable, which subsequently causes the install to fail due to a missing file. I think SWI-Prolog should still be buildable if all dependencies are present, even if it's being built on a machine with no X server available (or, as is the case here, available but inaccessible to the sandboxed build).Besides the error about the missing
DISPLAY
variable it also complains about not being able to find/homeless-shelter
. There is a Nix sandboxing trick in play here, where it sets the home dir of the build users to the non-existent path/homeless-shelter
, to ensure nothing in the build looks at arbitrary things in the home dir (which would make the build nondeterministic). It showing up here indicates that something in the build is trying to do so which is a bit suspicious, but I think ultimately the error here is not that, but the lackingDISPLAY
variable.