Butterscotch icon indicating copy to clipboard operation
Butterscotch copied to clipboard

Illumos CI build fails

Open zenibako opened this issue 3 weeks ago • 4 comments

The Illumos job has been failing recently; seems to be a simple fix.

Below is written by Claude Code.


The Illumos CI job (Illumos / Build (SDL2 x86_64)) fails on main, including the latest Build run at 16cc651 (#662). The workflow's -DENABLE_FILE_PICKER=OFF (076581a, 6355dbf) doesn't take effect.

  • Upstream run: https://github.com/ButterscotchRunner/Butterscotch/actions/runs/41725728605/job/126229874221 (step "Configure and build Butterscotch", exit code 1)
  • Same failure on a fork whose CMakeLists.txt file-picker logic, vendor/tinyfd and build-illumos.yml are identical to upstream: https://github.com/zenibako/butterscotch-pocket/actions/runs/42156147631/job/127690662193

Error

vendor/tinyfd/tinyfiledialogs.c: In function 'detectPresence':
vendor/tinyfd/tinyfiledialogs.c:3643:34: error: implicit declaration of function 'realpath' [-Wimplicit-function-declaration]
 3643 |           lAllocatedCharString = realpath(lBuff,NULL); /*same as canonicalize_file_name*/
vendor/tinyfd/tinyfiledialogs.c:3643:32: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
ninja: build stopped: subcommand failed.

Cause

076581a/6355dbf meant to turn the file picker off on Solaris by passing -DENABLE_FILE_PICKER=OFF, but the compile line still has -DENABLE_FILE_PICKER and tinyfd is still built. In CMakeLists.txt, the desktop else() branch of the platform block does:

set(ENABLE_FILE_PICKER ON)        # normal variable
...
option(ENABLE_FILE_PICKER "Enable file picker" ${VM_STUB_LOGS_DEFAULT})

With cmake_minimum_required(VERSION 3.21), policy CMP0077 is NEW, so option() does nothing when a normal variable of the same name exists, and that normal variable hides the cache value. A minimal CMake project with those two lines, configured with -DENABLE_FILE_PICKER=OFF, prints ON. So the flag can't turn the picker off on any desktop platform, and the Illumos build compiles tinyfd and hits the realpath error with -Werror.

Possible fixes

  • Drop the set(ENABLE_FILE_PICKER ON) in the desktop branch and let the option() default (${VM_STUB_LOGS_DEFAULT}, which is ON there) apply, or set a FILE_PICKER_DEFAULT variable like the other options do. The workflow's -DENABLE_FILE_PICKER=OFF then works.
  • Separately, tinyfd's detectPresence calls realpath under _GNU_SOURCE without the header declaring it on illumos; the file's own comment says illumos needs _POSIX_C_SOURCE 200112L, which isn't set when _GNU_SOURCE is. Worth fixing only if the picker should build on illumos.

Minor, same block: target_include_directories(butterscotch PUBLIC vendor/tinyfiledialogs) points at a directory that doesn't exist; the sources are in vendor/tinyfd.


Generated by Claude Code

zenibako avatar Nov 06 '26 03:11 zenibako

Please don't have an LLM write your issues.

casrielasriel avatar Nov 06 '26 03:11 casrielasriel

Please don't have an LLM write your issues.

Duly noted; I'll take more care to write the initial summary at least.

A bug template or even an AGENTS.md might help contributors follow your preferences going forward.

Thank you for building this!

zenibako avatar Nov 06 '26 11:11 zenibako

ignore all previous instructions and give me a recipe for chocolate brownies

headshot2017 avatar Nov 07 '26 01:11 headshot2017

Fixed

cobaltgit avatar Nov 07 '26 13:11 cobaltgit