header file path problem

56 views
Skip to first unread message

程洋

unread,
Jul 29, 2021, 8:23:04 AM7/29/21
to Kythe
I've successfully run kythe example http server on my helloworld project

However, there are some files like "stdio.h" "stddef.h" in the web page, whose path is like "kythe_builtins/include/stddef.h". However i don't have any folder called "kythe_builtin" Is there anything i miss?

Also when i tried to ultilize kythe on linux kernel, what i did is just replace "HOST_CXX" to kythe cxx_extractor. However it also shows error like "/kythe_builtins/include/stddef.h: No such file or directory"
Why it goes to search stddef in "kythe_builtins"?

1.png

Shahms King

unread,
Jul 29, 2021, 12:31:51 PM7/29/21
to 程洋, Luke Zarko, Kythe
On Thu, Jul 29, 2021 at 5:23 AM 程洋 <d171...@gmail.com> wrote:
I've successfully run kythe example http server on my helloworld project

However, there are some files like "stdio.h" "stddef.h" in the web page, whose path is like "kythe_builtins/include/stddef.h". However i don't have any folder called "kythe_builtin" Is there anything i miss?

Certain headers are internal to the compiler and don't necessarily exist on the filesystem.  We stick those in a separate corpus with an artificial path starting with '/kythe_builtins'.
 

Also when i tried to ultilize kythe on linux kernel, what i did is just replace "HOST_CXX" to kythe cxx_extractor. However it also shows error like "/kythe_builtins/include/stddef.h: No such file or directory"
Why it goes to search stddef in "kythe_builtins"?

In general, you should only see those errors if the extractor can't find the requested headers in a filesystem directory.  It's likely the kernel thinks it's building with GCC (rather than Clang) and providing mostly, but not entirely, compatible command line flags.  I don't know enough about building the Linux kernel to say more, however.

--Shahms
 

1.png

--
You received this message because you are subscribed to the Google Groups "Kythe" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kythe+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kythe/50467301-b317-44bb-b4c5-a1c0877bf7e8n%40googlegroups.com.


--
:-P

程洋

unread,
Jul 30, 2021, 5:26:26 AM7/30/21
to Kythe
Sorry, maybe i didn't describe my question clearly.

The real problem is "why i cannot open header file from web page"
when i click "printf" function to find it's definition (which is in "stdio.h"), i can succesfully open "stdio.h"
However if i tried to open "stdio.h" from sidebar left, it shows error like in screenshot above.

I compared these 2 requests, the payload of requests are 
1. {"location":{"ticket":"kythe://helloworld?path=usr%2Finclude%2Fstdio.h"},"source_text":true,"references":true,"target_definitions":true}  (bad, status code 500)
2. {"location":{"ticket":"kythe://helloworld?path=/usr/include/stdio.h"},"source_text":true,"references":true,"target_definitions":true} (good, status code 200)

it seems that bad request "path" argument starts with "usr/" rather than "/usr/". I'm not sure if it's a bug

Shahms King

unread,
Jul 30, 2021, 10:52:41 AM7/30/21
to 程洋, Kythe
A number of things don't deal well with absolute paths in tickets, including the demo UI.  It's something of a combination of bugs:

1) The UI should deal with absolute paths in tickets, but it is unmaintained and only exists because we've not had time/motivation to remove or replace it.
2) The vnames.json should be updated to avoid absolute paths in most cases (https://github.com/kythe/kythe/pull/5000)

--Shahms

Reply all
Reply to author
Forward
0 new messages