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

Fix source generation on Windows #141

Merged
merged 1 commit into from
Sep 30, 2023

Conversation

tishin
Copy link
Contributor

@tishin tishin commented Sep 30, 2023

  1. buildCommand does not work on Windows seemingly because of an SPM bug. I described the whole thing in Build command doesn't get executed on Windows swiftlang/swift-package-manager#6962. Using prebuildCommand instead fixes the issue.
  2. After fixing codegen command Windows build fails with You don't have permission error. I suppose it's because generator executable doesn't have write permissions to the temporary directory Foundation implementation uses for atomic writes, since toggling off atomically fixed the issue for me. Not sure what benefit atomic writes can bring in context of code generator, so I disabled it for all platforms.

@tishin
Copy link
Contributor Author

tishin commented Sep 30, 2023

This should finally make the package buildable on Windows as is.

@migueldeicaza
Copy link
Owner

I used atomically blindly, did not care either way, and I just had to pick a value :-)

Good to know that this causes problems on Windows, I will avoid in the future

@migueldeicaza migueldeicaza merged commit 139c225 into migueldeicaza:main Sep 30, 2023
1 check passed
@tishin tishin deleted the win-codegen-fix branch October 1, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants