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

Unsafe build flags #6

Open
vizaiapp opened this issue Feb 7, 2023 · 9 comments
Open

Unsafe build flags #6

vizaiapp opened this issue Feb 7, 2023 · 9 comments

Comments

@vizaiapp
Copy link

vizaiapp commented Feb 7, 2023

I just updated to 1.2.0 and my first build produced this error: The package product 'whisper' cannot be used as a dependency of this target because it uses unsafe build flags.

Any ideas? Haven't had any issues building prior versions.

@vizaiapp
Copy link
Author

vizaiapp commented Feb 7, 2023

Testing out prior version to see where this starts and it appears to begin in 1.1.0, still present in 1.1.1. 1.0.4 builds fine without any issues.

@ggerganov
Copy link
Owner

I think this is the commit that breaks it for you: 0e52adc

I am not sure how to resolve this correctly. If we don't include these flags, then we have the problem from #1
If #1 is not an issue for you, you can simply fork this repo and remove the unsafe flags.

@bdrelling
Copy link

@ggerganov Before submitting #1, I investigated a ton of options for this and couldn't find anything that would allow the optimization level we need alongside proper versioning support.

The one thing I didn't try it is prebuilding a binary framework and using that for the package. See Distributing binary frameworks as Swift packages.

I don't know C very well and don't know if this is possible or not possible with C packages, but theoretically if we build the framework with the strictest optimization level and you include that in the package, it should work.

You might even be able to offer two targets/products, something like Whisper and WhisperCompiled, but leverage the same module name/alias.

Let me know if you want any help investigating this further, happy to put some work in since you've done so much to support us!

@bdrelling
Copy link

And I guess for the worst case scenario: removing versioning tags and adding an explicit message that the library will only work with branch or revision pinning in SPM. 😞

@ggerganov
Copy link
Owner

@bdrelling
No worries! I don't think these are show-stopping issues - there are work arounds available.

@vizaiapp
Copy link
Author

vizaiapp commented Feb 17, 2023

Thanks all! I'm still getting the build error when I pin to branch or specific commit in my current project - the build errors aren't present when I do that in a new project with branch pinning however... @bdrelling do you have any suggestions for debugging? I deleted the package and re-added with a branch pin, but the build error remains. I wonder if there's something lingering that doesn't get cleared when I remove/re-add the dependency.

@vizaiapp
Copy link
Author

Got it building now w/o errors - final sequence that worked was: Remove whisper as dependency -> Build (removing any code using whisper) -> Clean project -> Re-add whisper with branch pinning -> Build.

@narciszait
Copy link

Hi guys - which branch should i be pinning/using?

@johnmai-dev
Copy link

Hi guys - which branch should i be pinning/using?

@narciszait use specify the version with a commit hash
image

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

No branches or pull requests

5 participants