Illumos CI build fails
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.txtfile-picker logic,vendor/tinyfdandbuild-illumos.ymlare 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 theoption()default (${VM_STUB_LOGS_DEFAULT}, which is ON there) apply, or set aFILE_PICKER_DEFAULTvariable like the other options do. The workflow's-DENABLE_FILE_PICKER=OFFthen works. - Separately, tinyfd's
detectPresencecallsrealpathunder_GNU_SOURCEwithout the header declaring it on illumos; the file's own comment says illumos needs_POSIX_C_SOURCE 200112L, which isn't set when_GNU_SOURCEis. 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
Please don't have an LLM write your issues.
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!
ignore all previous instructions and give me a recipe for chocolate brownies
Fixed