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

[SR-9216] Don't honor SDKROOT in interpreter mode #51705

Open
belkadan opened this issue Nov 9, 2018 · 4 comments
Open

[SR-9216] Don't honor SDKROOT in interpreter mode #51705

belkadan opened this issue Nov 9, 2018 · 4 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project

Comments

@belkadan
Copy link
Contributor

belkadan commented Nov 9, 2018

Previous ID SR-9216
Radar rdar://problem/21819253
Original Reporter @belkadan
Type Bug
Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, Driver, StarterBug
Assignee Jon (JIRA)
Priority Medium

md5: f3641cf6b439af1689bb8109248eccef

Issue Description:

People have tried to use Swift in Xcode Run Script build phases, but because Swift looks at the SDKROOT environment variable, the Run Script phase will fail when building a non-macOS target:

<unknown>:0: warning: using sysroot for 'iPhoneOS' but targeting 'MacOSX'
<unknown>:0: error: unable to load standard library for target 'x86_64-apple-macosx10.14'

We should just ignore SDKROOT when running the interpreter. Swift knows how to invoke xcrun to find the right SDK when it's not passed one explicitly.

@belkadan
Copy link
Contributor Author

belkadan commented Nov 9, 2018

This would pretty much just be switching the two if branches dealing with SDKROOT in Driver.cpp, and then modifying the existing tests that exercise the SDKROOT behavior to make sure they cover this case.

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Jul 27, 2019

Jon (JIRA User) Are you still fixing it or should we re-assign to someone else?

Thanks!

@Jeehut
Copy link

Jeehut commented Apr 10, 2020

@AnnaZaks Did you get an answer from Jon (JIRA User) on the state of this? This is still an issue holding off Swift based command line tools of being usable in build scripts, like I reported on swift-sh here:
mxcl/swift-sh#113

@Jeehut
Copy link

Jeehut commented May 21, 2020

@belkadan, @AnnaZaks, Jon (JIRA User): As nothing seems to happen here, I would be willing to fix this myself but I have no experience with contributing to a programming language, nor with compilers or with C++. I will try anyways, just to get things going and because this is marked as a starter bug. Let's see if it will turn out fine or not. Fingers crossed!

I've just created #31931 with what I understood from your text @belkadan, I hope I understood you correctly. Will try getting the environment running and updating the tests as suggested tomorrow (or once you confirmed I didn't misunderstand what you meant with "switching branches").

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project
Projects
None yet
Development

No branches or pull requests

2 participants