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

*.metal files in pod dependency #2571

Closed
stephenkopylov opened this issue Dec 9, 2024 · 4 comments · Fixed by #2576
Closed

*.metal files in pod dependency #2571

stephenkopylov opened this issue Dec 9, 2024 · 4 comments · Fixed by #2576
Labels
Missing repro This issue need minimum repro scenario

Comments

@stephenkopylov
Copy link

Description

Hi everyone,

Would it make sense to exclude .metal files from the podspec dependencies?

Currently, we already include compiled shaders as .metallib binaries, so is there a specific reason to include the .metal sources as well?

By default, these shader sources are compiled into default.metallib, which can create conflicts with other libraries that also include shader sources (e.g., “multiple commands produce default.metallib”).

Let me know your thoughts!

Steps to reproduce

Have any other lib with .metal-sources included

Snack or a link to a repository

-/-

SVG version

v15.10.1

React Native version

0.73.1

Platforms

iOS

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

Copy link

github-actions bot commented Dec 9, 2024

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@github-actions github-actions bot added the Missing repro This issue need minimum repro scenario label Dec 9, 2024
@DouweBos
Copy link

DouweBos commented Dec 11, 2024

Is there any documentation why this change was made in v15.9.0 to begin with? We just ran into this exact problem since both KSPlayer and RNSVG produced said default.metallib.
We are about to just patch the podspec to exclude .metal files again but would love to know if we are about to run into any other problems down the road.

@RuudBurger
Copy link

The ☝️ mentioned patch file, for people running into similar issues:

diff --git a/RNSVG.podspec b/RNSVG.podspec
index b3e0ca3a770254608a75a788148f49e52e8bf581..0d0aafa06f75dcfc93b47337bcd3b0fcb64afb97 100644
--- a/RNSVG.podspec
+++ b/RNSVG.podspec
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
   s.homepage          = package['homepage']
   s.authors           = 'Horcrux Chen'
   s.source            = { :git => 'https://github.com/react-native-community/react-native-svg.git', :tag => "v#{s.version}" }
-  s.source_files      = 'apple/**/*.{h,m,mm,metal}'
+  s.source_files      = 'apple/**/*.{h,m,mm}'
   s.ios.exclude_files = '**/*.macos.{h,m,mm}'
   s.tvos.exclude_files = '**/*.macos.{h,m,mm}'
   s.visionos.exclude_files = '**/*.macos.{h,m,mm}' if s.respond_to?(:visionos)

@jakex7
Copy link
Member

jakex7 commented Dec 12, 2024

Hi, thank you for bringing this issue to our attention. This is indeed unintended behavior, and *.metal files should not be included in source_files. This will be fixed in the next version.

jakex7 added a commit that referenced this issue Dec 12, 2024
# Summary

Fixes #2571.
Since filter shaders are already provided as compiled `*.metallib`
files, there is no need to include `*.metal` files in the `source_files`
list.

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |    ✅      |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants