Skip to content

diff, patch: add config.h and -I. to fix 'stdin does not exist'#153

Merged
staalmannen merged 1 commit into
mainfrom
claude/upgrade-ape-c-library-mmZGd
May 23, 2026
Merged

diff, patch: add config.h and -I. to fix 'stdin does not exist'#153
staalmannen merged 1 commit into
mainfrom
claude/upgrade-ape-c-library-mmZGd

Conversation

@staalmannen

Copy link
Copy Markdown
Owner

Both packages' source files include <config.h> when HAVE_CONFIG_H is defined, but neither mkfile had -I. so cpp couldn't find config.h, causing the Plan9 'stdin does not exist' pipeline error.

Add minimal config.h to each build directory with the HAVE_* flags appropriate for Plan9/APE (sigaction, fork, stat fields; no stack overflow recovery). Add -I. to CFLAGS so the build-dir config.h is found before any system headers.

https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs

Both packages' source files include <config.h> when HAVE_CONFIG_H is
defined, but neither mkfile had -I. so cpp couldn't find config.h,
causing the Plan9 'stdin does not exist' pipeline error.

Add minimal config.h to each build directory with the HAVE_* flags
appropriate for Plan9/APE (sigaction, fork, stat fields; no stack
overflow recovery). Add -I. to CFLAGS so the build-dir config.h
is found before any system headers.

https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
@staalmannen staalmannen merged commit b344e13 into main May 23, 2026
1 check passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces configuration headers and build script updates to support GNU diffutils and patch on Plan 9/APE. Specifically, it adds config.h files for both tools and modifies their mkfile configurations to include the local directory in the compiler's search path. A critical correction was identified in the diff configuration where certain structure members were incorrectly marked as available, which would lead to compilation failures in the APE environment.

Comment on lines +21 to +22
#define HAVE_STRUCT_DIRENT_D_TYPE 1
#define HAVE_TM_GMTOFF 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The Plan 9 APE environment does not provide the d_type member in struct dirent (defined in <dirent.h>) nor the tm_gmtoff member in struct tm (defined in <time.h>). Defining these macros as 1 will cause compilation errors when the source code attempts to access these non-existent fields. These should be undefined for the APE port.

Suggested change
#define HAVE_STRUCT_DIRENT_D_TYPE 1
#define HAVE_TM_GMTOFF 1
#undef HAVE_STRUCT_DIRENT_D_TYPE
#undef HAVE_TM_GMTOFF

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