Giter Club home page Giter Club logo

Comments (15)

artemcm avatar artemcm commented on September 2, 2024

@thekief , in your second example, you are not invoking the driver from the swift-LOCAL-2023-05-02-a.xctoolchain toolchain, but the compiler frontend: swift-frontend. Whereas from the Xcode toolchain you are invoking the driver swiftc.

from swift-driver.

thekief avatar thekief commented on September 2, 2024

Sorry, my bad. I put the wrong command there. Here is the corrected one:

/Library/Developer/Toolchains/swift-LOCAL-2023-05-02-a.xctoolchain/usr/bin/swiftc -version
Apple Swift version 5.8 (swift-5.8-RELEASE)
Target: arm64-apple-macosx13.0

Anyway, my problem still applied. I did some debugging with dtruss and noticed that the my custom toolchain does not check for swift-driver while the stock one does:

351- 1234/0x252e:     16496       1      0 sysctl([CTL_KERN, 4, 0, 0, 0, 0] (2), 0x16BC19140, 0x16BC18DA0, 0x0, 0x0)		 = 0 0
352- 1234/0x252e:     16500       4      3 sysctl([CTL_HW, 1, 0, 0, 0, 0] (2), 0x16BC19240, 0x16BC18DA0, 0x0, 0x0)		 = 0 0
353: 1234/0x252e:     16505       3      2 access("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver\0", 0x0, 0x0)		 = 0 0
354: 1234/0x252e:     16507       2      1 access("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver\0", 0x0, 0x0)		 = 0 0
355- 1234/0x2530:     17970:        0:       0 fork()		 = 0 0
356- 1234/0x2530:     17971       1      0 mprotect(0x104EB4000, 0x8000, 0x1)	

I also noticed this details in the README:

**Note:** Currently, swift-driver is only compatible with trunk development snapshots from [swift.org](https://swift.org/download/#snapshots).

Previous snapshots of Swift worked without any problems in that regard. Could it be that using a self-built "release" disables forwarding executions to the driver?

from swift-driver.

artemcm avatar artemcm commented on September 2, 2024

Could you please clarify how your build a custom toolchain, exactly?

from swift-driver.

thekief avatar thekief commented on September 2, 2024

I used the official instructions aka:

swift/utils/build-toolchain <prefix>

from swift-driver.

thekief avatar thekief commented on September 2, 2024

Sure, sorry for leaving out this details. My bundle prefix is customCompiler.

Is there anything special you have in mind? Are there some names that are considered "forbidden"?

from swift-driver.

artemcm avatar artemcm commented on September 2, 2024

@thekief do you have a swift-driver executable adjacent to /Library/Developer/Toolchains/swift-LOCAL-2023-05-02-a.xctoolchain/usr/bin/swiftc?

I am having trouble using build-toolchain script locally, but I just triggered a toolchain build on a release/5.8 PR here:
apple/swift#65587

And the resulting toolchain seems to have the new driver correctly installed and it does get used when calling swiftc from this toolchain.

from swift-driver.

thekief avatar thekief commented on September 2, 2024

Thank you for your help there. I had a look at your build and I noticed that some files on my side were kind of missing and broken most likely due to some issues in the build process.

We had some issues during our build times in the night and so far restarting/resuming the build process never caused any issues. That is the first time for me here. I will test the toolchains internally and potentially close the ticket soon

from swift-driver.

finagolfin avatar finagolfin commented on September 2, 2024

@thekief, the trunk and 5.9 snapshots might be a good comparison to your custom toolchain builds, ie you should end up with the same files as in there.

from swift-driver.

MaxDesiatov avatar MaxDesiatov commented on September 2, 2024

@thekief is this issue still reproducible for you?

from swift-driver.

thekief avatar thekief commented on September 2, 2024

i will inform you until next Monday. Currently, we switched back to Xcode 14, circumventing any problems with this. I will write about the outcome as soon as possible.

from swift-driver.

MaxDesiatov avatar MaxDesiatov commented on September 2, 2024

@thekief have you had a chance to reproduce this again?

from swift-driver.

thekief avatar thekief commented on September 2, 2024

(Potentially) related to this one here:

apple/swift-package-manager#6970

I kinda forgot about this issue. Thank you for the reminder

from swift-driver.

MaxDesiatov avatar MaxDesiatov commented on September 2, 2024

I don't think that SwiftPM issue is related in any way, unless some details in the description of this one were omitted.

from swift-driver.

thekief avatar thekief commented on September 2, 2024

Sorry for the bad phrasing:

I wanted to retest it with the new version mentioned in the other ticket. As I cannot build the new version, I have no update on it yet.

from swift-driver.

thekief avatar thekief commented on September 2, 2024

I was able to build release/5.9.0 and the issue does not occure anymore.

from swift-driver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.