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

Custom toolchain path does not exist in dev containers #1352

Open
MahdiBM opened this issue Jan 31, 2025 · 3 comments
Open

Custom toolchain path does not exist in dev containers #1352

MahdiBM opened this issue Jan 31, 2025 · 3 comments
Labels
bug Something isn't working question Further information is requested

Comments

@MahdiBM
Copy link
Contributor

MahdiBM commented Jan 31, 2025

Describe the bug
Getting:

The Swift executable at "/Applications/Xcode 16.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin" either could not be found or failed to launch. Please select a new toolchain.

Which is correct since I'm in a dev container. Though the extension could perhaps do something so this doesn't happen.

To Reproduce
Set a custom toolchain path then open the project in a dev container.

Expected behavior
No conflicts / failures when switching to a dev container.

Environment

  • Swift version: 6.0.3 RELEASE
  • Visual Studio Code version: 1.11.4

Additional context
Add any other context about the problem here.

@plemarquand
Copy link
Contributor

plemarquand commented Feb 3, 2025

You should be able to modify your devcontainer.json to add settings that are only applied inside the dev container. In this case you can add the swift.path setting under customizations.vscode.settings inside devcontainer.json to set the Swift path back to where Swift lives in the container.

    "customizations": {
        "vscode": {
            "settings": {
                "swift.path": "/usr/bin"
            },
            "extensions": [
                "sswg.swift-lang"
            ]
        }
    }

@award999 award999 added the question Further information is requested label Feb 5, 2025
@award999
Copy link
Contributor

award999 commented Feb 5, 2025

@MahdiBM does that suggestion fix your problem?

@MahdiBM
Copy link
Contributor Author

MahdiBM commented Feb 9, 2025

It does, but I wonder if we should stop here or not.
For example maybe it is appropriate for the extension to be smart about this and detect the situation and let the user know what to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
Development

No branches or pull requests

3 participants