Skip to content

fix: build on consoles#1532

Merged
jpnurmi merged 1 commit intomasterfrom
jpnurmi/fix/console-build
Feb 19, 2026
Merged

fix: build on consoles#1532
jpnurmi merged 1 commit intomasterfrom
jpnurmi/fix/console-build

Conversation

@jpnurmi
Copy link
Copy Markdown
Collaborator

@jpnurmi jpnurmi commented Feb 19, 2026

The find_cp_path helper used popen/pclose which are unavailable on consoles. Narrow the guard to match the platforms where the function is actually called: macOS and desktop Linux.

ps
  test_process.c
C:\github_runners\vie_runner_4\_work\sentry-playstation\sentry-playstation\build\ps5\_deps\sentry-native-src\tests\unit\test_process.c(23,16): error : call to undeclared function 'popen'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] [C:\github_runners\vie_runner_4\_work\sentry-playstation\sentry-playstation\build\ps5\_deps\sentry-native-build\tests\unit\sentry_test_unit.vcxproj]
     23 |     FILE *fp = popen("command -v cp 2>/dev/null", "r");
        |                ^
  C:\github_runners\vie_runner_4\_work\sentry-playstation\sentry-playstation\build\ps5\_deps\sentry-native-src\tests\unit\test_process.c(23,16): note: did you mean 'fopen'?
  C:\Program Files (x86)\SCE\Prospero SDKs\11.000/target/include\stdio.h(259,7): note: 'fopen' declared here
    259 | FILE *fopen(const char *_Restrict, const char *_Restrict);
        |       ^
  fix-it:"C:\\github_runners\\vie_runner_4\\_work\\sentry-playstation\\sentry-playstation\\build\\ps5\\_deps\\sentry-native-src\\tests\\unit\\test_process.c":{23:16-23:21}:"fopen"
C:\github_runners\vie_runner_4\_work\sentry-playstation\sentry-playstation\build\ps5\_deps\sentry-native-src\tests\unit\test_process.c(23,11): error : incompatible integer to pointer conversion initializing 'FILE *' (aka 'struct __sFILE *') with an expression of type 'int' [-Wint-conversion] [C:\github_runners\vie_runner_4\_work\sentry-playstation\sentry-playstation\build\ps5\_deps\sentry-native-build\tests\unit\sentry_test_unit.vcxproj]
     23 |     FILE *fp = popen("command -v cp 2>/dev/null", "r");
        |           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\github_runners\vie_runner_4\_work\sentry-playstation\sentry-playstation\build\ps5\_deps\sentry-native-src\tests\unit\test_process.c(28,9): error : call to undeclared function 'pclose'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] [C:\github_runners\vie_runner_4\_work\sentry-playstation\sentry-playstation\build\ps5\_deps\sentry-native-build\tests\unit\sentry_test_unit.vcxproj]
     28 |         pclose(fp);
        |         ^
  3 errors generated.
nx
ld.lld: error: undefined symbol: popen
>>> referenced by test_process.c:23 (C:/github_runners/vie_runner_7/_work/sentry-switch/sentry-switch/build/nx64/_deps/sentry-native-src/tests/unit\test_process.c:23)
>>>               _deps/sentry-native-build/tests/unit/CMakeFiles/sentry_test_unit.dir/Develop/test_process.c.obj:(find_cp_path)
>>> did you mean: fopen
>>> defined in: ...
ld.lld: error: undefined symbol: pclose
>>> referenced by test_process.c:28 (C:/github_runners/vie_runner_7/_work/sentry-switch/sentry-switch/build/nx64/_deps/sentry-native-src/tests/unit\test_process.c:28)
>>>               _deps/sentry-native-build/tests/unit/CMakeFiles/sentry_test_unit.dir/Develop/test_process.c.obj:(find_cp_path)
>>> did you mean: fclose
>>> defined in: ...
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

#skip-changelog

The find_cp_path helper used popen/pclose which are unavailable on
consoles. Narrow the guard to match the platforms where the function
is actually called: macOS and desktop Linux.
@jpnurmi jpnurmi requested a review from supervacuus February 19, 2026 07:27
@supervacuus
Copy link
Copy Markdown
Collaborator

We don't have to fix this here, because it is apparent in multiple places, but we should likely formulate the compile-time exclusions for test negatively rather than positively (I.e., we vote a platform out of test rather than in). This is the better feedback mechanism, because new platforms are automatically covered.

@jpnurmi jpnurmi merged commit 80aab16 into master Feb 19, 2026
81 of 82 checks passed
@jpnurmi jpnurmi deleted the jpnurmi/fix/console-build branch February 19, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants