Skip to content

Conversation

@Destructor17
Copy link
Contributor

@Destructor17 Destructor17 commented Dec 19, 2025

Resolves #1102

Alternative 1:

Add a static function named getpid that would simply return 0.
It is somehow similar to # define getpid GetCurrentProcessId for Windows.

Alternative 2:

Modify configure/build scripts to add -lwasi-emulated-getpid flag.
Not a good solution in my opinion

Copy link
Member

@hartwork hartwork left a comment

Choose a reason for hiding this comment

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

Needs more clarification at #1102 (comment) first

Copy link
Member

@hartwork hartwork left a comment

Choose a reason for hiding this comment

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

@Destructor17 is there a chance that you could rebase against latest master with #1104 merged and drop both the -DCMAKE_{EXE,SHARED,MODULE}_LINKER_FLAGS='-lwasi-emulated-getpid' and the -D_WASI_EMULATED_GETPID from the wasi_sdk.yml CI file that I have added there? With some luck (and a small fix for clang-format), CI should be all green after that.

@Destructor17
Copy link
Contributor Author

Destructor17 commented Dec 20, 2025

@Destructor17 is there a chance that you could rebase against latest master with #1104 merged and drop both the -DCMAKE_{EXE,SHARED,MODULE}_LINKER_FLAGS='-lwasi-emulated-getpid' and the -D_WASI_EMULATED_GETPID from the wasi_sdk.yml CI file that I have added there? With some luck (and a small fix for clang-format), CI should be all green after that.

@hartwork I just rebased to master and applied changes listed above. Hope CI will go green.

PS: I'm inspired to see how quickly you extended the CI to cover such niche thing as WASI. Wow!

@hartwork hartwork added this to the 2.7.4 milestone Dec 20, 2025
@hartwork hartwork merged commit 5dd4a63 into libexpat:master Dec 20, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Porting to WASI: lack of getpid

2 participants