-
Notifications
You must be signed in to change notification settings - Fork 4
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
Search paths in clang/swiftc commands can be relative paths #57
Comments
Thanks for the detailed reporting, Keith.
We’ll have to look into this.
From: Keith Johnson ***@***.***>
Date: Wednesday, February 21, 2024 at 3:58 PM
To: veracode/gen-ir ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [EXTERNAL] [veracode/gen-ir] Search paths in clang/swiftc commands can be relative paths (Issue #57)
External Message Disclaimer
This message originated from an external source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
…________________________________
Another "interesting" situation here. It looks like, in some circumstances, Xcode will use relative paths for the -I and -F for clang and swiftc commands. This means that gen-ir will not find, for instance, third-party pre-compiled frameworks and include files needed to compile source files.
Looks like this happens when setting the following project settings to paths starting at $(PROJECT_DIR) and being recursive. Example:
image.png (view on web)<https://github.com/veracode/gen-ir/assets/3466183/5881b6b9-a938-4a9f-895a-4b4bf6a5f539>
If you set this in an example project, you'll see flags like -I. and other relative paths in the CompileC command in Xcode.
Because gen-ir runs the commands in a temp directory (from what I can tell), these relative includes/framework references aren't found and files fail to compile due to missing header files.
Presumably you're running the commands in a temp directory for a good reason, so maybe gen-ir should fix up relative paths on -I and -F flags (and others) to be absolute paths (relative to the xcodeproj directory) before running the commands? Not sure how feasible that is.
It's also unclear how feasible it is to not use recursive search paths; we have these pointing at a big directory of a bunch of third-party references, and we'd have to untangle that mess.
—
Reply to this email directly, view it on GitHub<#57>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABA2YVBBYCGWR33FKMEK7V3YUZNWRAVCNFSM6AAAAABDTYC2D2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGE2DONZQGE2DONA>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Note that we ended up just reorganizing our code to not use recursive search paths - we wanted to untangle that mess for other reasons, too. So while this is still an issue to consider for the future, it's not affecting us anymore. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another "interesting" situation here. It looks like, in some circumstances, Xcode will use relative paths for the
-I
and-F
forclang
andswiftc
commands. This means thatgen-ir
will not find, for instance, third-party pre-compiled frameworks and include files needed to compile source files.Looks like this happens when setting the following project settings to paths starting at
$(PROJECT_DIR)
and being recursive. Example:If you set this in an example project, you'll see flags like
-I.
and other relative paths in the CompileC command in Xcode.Because
gen-ir
runs the commands in a temp directory (from what I can tell), these relative includes/framework references aren't found and files fail to compile due to missing header files.Presumably you're running the commands in a temp directory for a good reason, so maybe
gen-ir
should fix up relative paths on-I
and-F
flags (and others) to be absolute paths (relative to the xcodeproj directory) before running the commands? Not sure how feasible that is.It's also unclear how feasible it is to not use recursive search paths; we have these pointing at a big directory of a bunch of third-party references, and we'd have to untangle that mess.
The text was updated successfully, but these errors were encountered: