Skip to content

Commit

Permalink
Fix setting LD_RUNTIME_SEARCH_PATHS for aggregate targets that incl…
Browse files Browse the repository at this point in the history
…ude dynamic xcframeworks.
  • Loading branch information
dnkoutso committed Jan 14, 2022
1 parent f120f9f commit 071be88
Show file tree
Hide file tree
Showing 48 changed files with 971 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#10950](https://github.com/CocoaPods/CocoaPods/pull/10950)

* Fix setting `LD_RUNTIME_SEARCH_PATHS` for aggregate targets that include dynamic xcframeworks.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#XXXXX](https://github.com/CocoaPods/CocoaPods/pull/XXXXX)

##### Bug Fixes

* None.
Expand Down
11 changes: 10 additions & 1 deletion lib/cocoapods/sandbox/file_accessor.rb
Expand Up @@ -179,7 +179,7 @@ def vendored_dynamic_frameworks
end
end

# @return [Array<Pathname>] The paths of the dynamic xcframework bundles
# @return [Array<Pathname>] The paths of the static xcframework bundles
# that come shipped with the Pod.
#
def vendored_static_xcframeworks
Expand All @@ -188,6 +188,15 @@ def vendored_static_xcframeworks
end
end

# @return [Array<Pathname>] The paths of the dynamic xcframework bundles
# that come shipped with the Pod.
#
def vendored_dynamic_xcframeworks
vendored_xcframeworks.select do |path|
Xcode::XCFramework.new(spec.name, path).build_type == BuildType.dynamic_framework
end
end

# @return [Array<Pathname>] The paths of the static (fake) framework
# bundles that come shipped with the Pod.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods/target/build_settings.rb
Expand Up @@ -1288,7 +1288,7 @@ def other_swift_flags_without_swift?
define_build_settings_method :any_vendored_dynamic_artifacts?, :memoized => true do
pod_targets.any? do |pt|
pt.file_accessors.any? do |fa|
!fa.vendored_dynamic_artifacts.empty?
!fa.vendored_dynamic_artifacts.empty? || !fa.vendored_dynamic_xcframeworks.empty?
end
end
end
Expand Down
106 changes: 106 additions & 0 deletions spec/fixtures/coconut-lib/CoconutLib.xcframework/Info.plist
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>tvos-x86_64-simulator</string>
<key>LibraryPath</key>
<string>CoconutLib.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>tvos-arm64</string>
<key>LibraryPath</key>
<string>CoconutLib.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>macos-x86_64</string>
<key>LibraryPath</key>
<string>CoconutLib.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-armv7_arm64</string>
<key>LibraryPath</key>
<string>CoconutLib.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>armv7</string>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>watchos-i386-simulator</string>
<key>LibraryPath</key>
<string>CoconutLib.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>i386</string>
</array>
<key>SupportedPlatform</key>
<string>watchos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>watchos-armv7k_arm64_32</string>
<key>LibraryPath</key>
<string>CoconutLib.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>armv7k</string>
<string>arm64_32</string>
</array>
<key>SupportedPlatform</key>
<string>watchos</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-i386_x86_64-simulator</string>
<key>LibraryPath</key>
<string>CoconutLib.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Binary file not shown.
@@ -0,0 +1,6 @@

#import <Foundation/Foundation.h>

/** Coconuts are cool */
@interface CoconutObj : NSObject
@end
@@ -0,0 +1,19 @@
//
// CoconutLib.h
// CoconutLib
//
// Created by Eric Amorde on 10/20/19.
// Copyright © 2019 CocoaPods. All rights reserved.
//

#import <Foundation/Foundation.h>

//! Project version number for CoconutLib.
FOUNDATION_EXPORT double CoconutLibVersionNumber;

//! Project version string for CoconutLib.
FOUNDATION_EXPORT const unsigned char CoconutLibVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <CoconutLib/PublicHeader.h>


Binary file not shown.
@@ -0,0 +1,6 @@
framework module CoconutLib {
umbrella header "CoconutLib.h"

export *
module * { export * }
}
Binary file not shown.
@@ -0,0 +1,6 @@

#import <Foundation/Foundation.h>

/** Coconuts are cool */
@interface CoconutObj : NSObject
@end
@@ -0,0 +1,19 @@
//
// CoconutLib.h
// CoconutLib
//
// Created by Eric Amorde on 10/20/19.
// Copyright © 2019 CocoaPods. All rights reserved.
//

#import <Foundation/Foundation.h>

//! Project version number for CoconutLib.
FOUNDATION_EXPORT double CoconutLibVersionNumber;

//! Project version string for CoconutLib.
FOUNDATION_EXPORT const unsigned char CoconutLibVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <CoconutLib/PublicHeader.h>


Binary file not shown.
@@ -0,0 +1,6 @@
framework module CoconutLib {
umbrella header "CoconutLib.h"

export *
module * { export * }
}
@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Headers/Coconut.h</key>
<data>
Ik11Bk3/ssS7b9IAbABo7fXHDXc=
</data>
<key>Headers/CoconutLib.h</key>
<data>
0GEcr1CRa4n6sQrt4PgsVtiwLLE=
</data>
<key>Info.plist</key>
<data>
c5aFO22e3IHeNuvxzSP+4Vp6J4o=
</data>
<key>Modules/module.modulemap</key>
<data>
XBUmhbp5sPDDR0vApgYJ0zALOWI=
</data>
</dict>
<key>files2</key>
<dict>
<key>Headers/Coconut.h</key>
<dict>
<key>hash</key>
<data>
Ik11Bk3/ssS7b9IAbABo7fXHDXc=
</data>
<key>hash2</key>
<data>
Y0JMEPdjeR1ijdoNxhnkdG+dC3aGaoV/tktWLk58Tv4=
</data>
</dict>
<key>Headers/CoconutLib.h</key>
<dict>
<key>hash</key>
<data>
0GEcr1CRa4n6sQrt4PgsVtiwLLE=
</data>
<key>hash2</key>
<data>
i0yhQAstAqNBZIj9gqe5XY1GWc6nOWk8ENgA8uHl2DE=
</data>
</dict>
<key>Modules/module.modulemap</key>
<dict>
<key>hash</key>
<data>
XBUmhbp5sPDDR0vApgYJ0zALOWI=
</data>
<key>hash2</key>
<data>
mhxBFlNwG/ASIqNY6yYtxs7CuysII4NrdaoGkHwJLCA=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
Binary file not shown.
@@ -0,0 +1,6 @@

#import <Foundation/Foundation.h>

/** Coconuts are cool */
@interface CoconutObj : NSObject
@end

0 comments on commit 071be88

Please sign in to comment.