Trouble extracting symbol graph for _SwiftSyntaxCShims

i am trying to generate the symbol graph for the _SwiftSyntaxCShims, at 600.0.0-prerelease-2024-05-01, but i am running into a strange error

$ swift symbolgraph-extract -module-name _SwiftSyntaxCShims \
  -target x86_64-unknown-linux-gnu \
  -minimum-access-level internal \
  -output-dir artifacts \
  -include-spi-symbols \
  -skip-inherited-docs \
  -emit-extension-block-symbols \
  -I /checkouts/swift-syntax/.build/debug \
  -I /checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include \
  -I /checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax

<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "swiftsyntax/_includes.h"
         ^
/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/_includes.h:33:10: note: in file included from /checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/_includes.h:33:
#include <stdio.h>
         ^
/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/stdio.h:19:15: error: unknown type name 'FILE'
static inline FILE *swiftsyntax_stdout(void) {
              ^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "swiftsyntax/_includes.h"
         ^
/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/_includes.h:33:10: note: in file included from /checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/_includes.h:33:
#include <stdio.h>
         ^
/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/stdio.h:20:10: error: use of undeclared identifier 'stdout'
  return stdout;
         ^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "swiftsyntax/_includes.h"
         ^
/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/_includes.h:33:10: note: in file included from /checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/_includes.h:33:
#include <stdio.h>
         ^
/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/stdio.h:24:15: error: unknown type name 'FILE'
static inline FILE *swiftsyntax_stdin(void) {
              ^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "swiftsyntax/_includes.h"
         ^
/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/_includes.h:33:10: note: in file included from /checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/_includes.h:33:
#include <stdio.h>
         ^
/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/stdio.h:25:10: error: use of undeclared identifier 'stdin'
  return stdin;
         ^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "swiftsyntax/_includes.h"
         ^
/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/_includes.h:33:10: note: in file included from /checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/_includes.h:33:
#include <stdio.h>
         ^
/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/stdio.h:29:15: error: unknown type name 'FILE'
static inline FILE *swiftsyntax_stderr(void) {
              ^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "swiftsyntax/_includes.h"
         ^
/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/_includes.h:33:10: note: in file included from /checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/_includes.h:33:
#include <stdio.h>
         ^
/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/stdio.h:30:10: error: use of undeclared identifier 'stderr'
  return stderr;
         ^
<module-includes>:3:10: note: in file included from <module-includes>:3:
#include "swiftsyntax/errno.h"
         ^
/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/swiftsyntax/errno.h:20:10: error: use of undeclared identifier 'errno'
  return errno;
         ^

this error is new to 600.0.0-prerelease-2024-05-01 and does not occur on 600.0.0-prerelease-2024-04-23. any ideas what is going wrong here?

This is probably fixed by [6.0] Rename `errno.h` and `stdio.h` to `swiftsyntax_errno.h` and `swiftsyntax_stdio.h` by ahoppen · Pull Request #2639 · apple/swift-syntax · GitHub, which renames those files.

2 Likes