Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace absolute paths from __FILE__ with relative ones just using …sed #5

Closed
wants to merge 1 commit into from

Conversation

kkysen
Copy link
Contributor

@kkysen kkysen commented Mar 22, 2023

Replace absolute paths from __FILE__ with relative ones just using …sed.

Note that the existing rust transpilation used relative paths (I'm not sure how it was implemented), but make lighttpd makes a ./build/lighttpd that embeds the absolute paths.

…`sed`.

Note that the existing `rust` transpilation used relative paths
(I'm not sure how it was implemented),
but `make lighttpd` makes a `./build/lighttpd` that embeds the absolute paths.
@kkysen
Copy link
Contributor Author

kkysen commented Mar 22, 2023

@rinon, did you have a better way of doing this when you did the initial transpilation, as relative paths are used there.

@rinon
Copy link
Contributor

rinon commented Mar 22, 2023

I don't think I did anything special, the command I used is documented in 0db8475. It's very possible I used cmake to build the compile_commands.json? Maybe try using -ffile-prefix-map or friends in the C compile commands? I really don't recall doing anything special...

@rinon
Copy link
Contributor

rinon commented Mar 22, 2023

But probably a better question, why do we need this?

@aneksteind
Copy link
Contributor

@rinon I did not want lighttpd to crash in dynamic analysis for the "wrong" reason, e.g. if a path did not exist, so I asked @kkysen to create something to address that possibility

@kkysen
Copy link
Contributor Author

kkysen commented Mar 23, 2023

I don't think I did anything special, the command I used is documented in 0db8475. It's very possible I used cmake to build the compile_commands.json? Maybe try using -ffile-prefix-map or friends in the C compile commands? I really don't recall doing anything special...

It's probably absolute paths used in the compile command. I know clang has bugs related to relative paths in compilation databases, so I tried to avoid any, but maybe they're fine in certain cases, so I can check.

I still don't think that lighttpd ever uses these paths as actual paths, but only prints then in log and error messages. It's a simple fix to make them relative, though.

@rinon
Copy link
Contributor

rinon commented Mar 23, 2023

Right, so these are just for log messages, I don't think we should change them.

@aneksteind
Copy link
Contributor

Given the comments I'd support closing this @kkysen

@kkysen kkysen closed this Mar 23, 2023
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.

3 participants