Skip to content

Some weird behaviour after I update my mac to use swift 6 #676

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

Closed
Dracks opened this issue Nov 17, 2024 · 10 comments
Closed

Some weird behaviour after I update my mac to use swift 6 #676

Dracks opened this issue Nov 17, 2024 · 10 comments
Labels
kind/support Adopter support requests. status/triage Collecting information required to triage the issue.

Comments

@Dracks
Copy link

Dracks commented Nov 17, 2024

Question

Hello,

I'm working on my pet project MrScrooge (which uses vapor and I'm using the openapi-generator to generate the apis), and last week I decided to upgrade my company laptop to the latest version of mac, which implied a migration of swift to 6. The package.json is not still changed (I'm awaiting to finish the lasts big things after involve myself on that) and I found some weird behaviour, which I don't know if everything is related to this project, but since the first simptom I think comes from the openapi generator, Let's start for here.

The first simptom, it generates at some point (not allways) the build files that OpenApi generates to the root (Client., Types. and Server.* files):
image

I don't know if I need to configure some specific stuff. You can see the branch in which I'm working here: Dracks/mr-scrooge#30

Is it something that I missed to configure?

Also, after this happens, (two or three compilations) swift decides to start throwing linking errors. (making impossible to compile again, until (not found any better way yet) full cleanup of the .build folder.

I'm using zed as editor, and I compile (and test) mainly using terminal (I've got a small bash script to automatically launch build after some changes)

Thanks,
Dracks.

@Dracks Dracks added kind/support Adopter support requests. status/triage Collecting information required to triage the issue. labels Nov 17, 2024
@czechboy0
Copy link
Contributor

Hi @Dracks,

I suspect this might be caused by your editor. I think we've seen something similar a while back happen in VS Code. Can you reproduce this in Xcode? cc @simonjbeaumont @FranzBusch

@simonjbeaumont
Copy link
Collaborator

The first simptom, it generates at some point (not allways) the build files that OpenApi generates to the root (Client., Types. and Server.* files):

This sounds very strange. The Swift OpenAPI Generator CLI invocation is made by SwiftPM when using the plugin and it should be passing an appropriate output directory based on the currently configured build directory.

How are you driving the build, or is that opaque to you (done by the editor or some editor plugin that drives SwiftPM)?

@czechboy0
Copy link
Contributor

cc @dschaefer2 for visibility

@dschaefer2
Copy link

I still have yet and to see that but lots of people reporting it. I'm not sure how files can end up in the root, but it's clearly happening. A reproducible scenario that I could debug with would be a huge help.

@Dracks
Copy link
Author

Dracks commented Nov 18, 2024

Yes, (I think I'm driving the build) I simply run swift build, (tecnically I've got an small bash script to run the build, or the tests at any change in swift files)

I still have yet and to see that but lots of people reporting it. I'm not sure how files can end up in the root, but it's clearly happening. A reproducible scenario that I could debug with would be a huge help.

My intention is not to spam my project, but maybe you can try to clone my project the branch in which is happening?

@czechboy0
Copy link
Contributor

I suspect it has something to do with build plugins, almost seems like a race condition where sometimes the symbols path for the task that compiles the generated files ends up being (defaulted to?) the package path?

@dschaefer2
Copy link

At any rate, we should move this to swift-package-manager. Any objections?

@simonjbeaumont
Copy link
Collaborator

At any rate, we should move this to swift-package-manager. Any objections?

Not from me.

@dschaefer2
Copy link

Hrrmm, I can't since you guys are still in the apple org. At any rate, I'll dig up another one I have in this issue and link it.

@czechboy0
Copy link
Contributor

Thanks @dschaefer2, let's use swiftlang/swift-package-manager#7930 to track this then. Closing.

@czechboy0 czechboy0 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Adopter support requests. status/triage Collecting information required to triage the issue.
Projects
None yet
Development

No branches or pull requests

4 participants