Comments (7)
Huh, I get very similar errors.
swift build
Building for debugging...
In file included from /Users/achew/Projects/stripe-ios/Stripe3DS2/Stripe3DS2/UIViewController+Stripe3DS2.m:9:
/Users/achew/Projects/stripe-ios/Stripe3DS2/Stripe3DS2/UIViewController+Stripe3DS2.h:9:9: fatal error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
^~~~~~~~~~~~~~~
In file included from /Users/achew/Projects/stripe-ios/Stripe3DS2/Stripe3DS2/UIFont+DefaultFonts.m:9:
/Users/achew/Projects/stripe-ios/Stripe3DS2/Stripe3DS2/UIFont+DefaultFonts.h:9:9: fatal error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
^~~~~~~~~~~~~~~
1 error generated.
[460/539] Compiling Stripe3DS2 UIViewController+Stripe3DS2.m
I wonder in what way I'm hodling it wrong... Let's ask stripe/stripe-ios#1983
from rules_spm.
Sorry for the delay in my response.
I think that you are running into the issue where the repository name does not match the package name. The Stripe Package.swift
specifies the name of the package as Stripe
. The spm_repositories
rule needs to know the name of the package to set up the Bazel packages. By default, it uses the basename of the git repository. When the basename of the git repository does not match the name specified in the Package.swift
, rules_spm
can't find what it expects to find.
If you add the name
attribute to the spm_pkg
and update your BUILD
file to point to @swift_pkgs//Stripe:Stripe
, rules_spm
should be able to fetch and start compiling the project.
spm_repositories(
name = "swift_pkgs",
dependencies = [
spm_pkg(
"https://github.com/stripe/stripe-ios.git",
name = "Stripe",
exact_version = "22.6.0",
products = ["Stripe"], # https://github.com/stripe/stripe-ios/blob/f5b0b5973aaa7ce6a2865e56f5942637cfef53f7/Package.swift#L11-L14
),
],
)
That seems to address the fetch issue. Unfortunately, I am seeing a compilation issue with the Stripe package. I'll poke at it for a minute to glean some information.
from rules_spm.
I cloned stripe/strip-ios and ran swift build
. I am getting the following output:
❯ swift build
Building for debugging...
In file included from /Users/chuck/code/stripe/stripe-ios/Stripe3DS2/Stripe3DS2/UIColor+ThirteenSupport.m:9:
/Users/chuck/code/stripe/stripe-ios/Stripe3DS2/Stripe3DS2/UIColor+ThirteenSupport.h:9:9: fatal error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
^~~~~~~~~~~~~~~
In file included from /Users/chuck/code/stripe/stripe-ios/Stripe3DS2/Stripe3DS2/STDSTextFieldCustomization.m:9:
'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
^~~~~~~~~~~~~~~
In file included from /Users/chuck/code/stripe/stripe-ios/Stripe3DS2/Stripe3DS2/UIViewController+Stripe3DS2.m:9:
: fatal error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
^~~~~~~~~~~~~~~
In file included from /Users/chuck/code/stripe/stripe-ios/Stripe3DS2/Stripe3DS2/STDSTransaction.m:9:
/Users/chuck/code/stripe/stripe-ios/Stripe3DS2/Stripe3DS2/include/STDSTransaction.h:10:9: fatal error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
^~~~~~~~~~~~~~~
In file included from /Users/chuck/code/stripe/stripe-ios/Stripe3DS2/Stripe3DS2/UIColor+DefaultColors.m:9:
/Users/chuck/code/stripe/stripe-ios/Stripe3DS2/Stripe3DS2/UIColor+DefaultColors.h:9:9: fatal error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
^~~~~~~~~~~~~~~
In file included from /Users/chuck/code/stripe/stripe-ios/Stripe3DS2/Stripe3DS2/STDSThreeDS2Service.m:18:
In file included from /Users/chuck/code/stripe/stripe-ios/Stripe3DS2/Stripe3DS2/STDSDirectoryServerCertificate.h:13:
9: fatal error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
^~~~~~~~~~~~~~~
1 error generated.
1 error generated.
[461/539] Compiling Stripe3DS2 UIColor+ThirteenSupport.m
Does building the Stripe package work for you?
from rules_spm.
Looking at the response from the stripe team, I think the issue is in rules_spm. I modified my import following your instructions but now I get the following output:
spm_repositories(
name = "swift_pkgs",
dependencies = [
spm_pkg(
url = "https://github.com/pointfreeco/swift-composable-architecture.git",
exact_version = "0.38.3",
products = ["ComposableArchitecture"],
),
spm_pkg(
"https://github.com/stripe/stripe-ios-spm.git",
name = "Stripe",
exact_version = "22.6.0",
products = ["Stripe"],
),
spm_pkg(
"https://github.com/pointfreeco/combine-schedulers.git",
exact_version = "0.6.0",
products = ["CombineSchedulers"],
),
spm_pkg(
"https://github.com/square/Valet",
exact_version = "4.1.2",
products = ["Valet"],
),
spm_pkg(
"https://github.com/grpc/grpc-swift",
exact_version = "1.7.3",
products = ["GRPC"],
),
spm_pkg(
"https://github.com/apple/swift-nio-ssl.git",
exact_version = "2.19.0",
products = ["NIOSSL"],
),
],
platforms = [
".iOS(.v14)",
".macOS(.v10_15)",
],
)
Note that I include the platform .iOS(.v14)
which I would expect to bring in UIKit
.
In file included from /private/var/tmp/_bazel_achew/86cdfd37d379cf1772409fa48c6ef35e/sandbox/darwin-sandbox/4139/execroot/__main__/bazel-out/ios-sim_arm64-min15.0-applebin_ios-ios_sim_arm64-fastbuild-ST-4e6c2a19403f/bin/external/swift_pkgs/spm_build/checkouts/stripe-ios-spm/Stripe3DS2/Stripe3DS2/UIViewController+Stripe3DS2.m:9:
/private/var/tmp/_bazel_achew/86cdfd37d379cf1772409fa48c6ef35e/sandbox/darwin-sandbox/4139/execroot/__main__/bazel-out/ios-sim_arm64-min15.0-applebin_ios-ios_sim_arm64-fastbuild-ST-4e6c2a19403f/bin/external/swift_pkgs/spm_build/checkouts/stripe-ios-spm/Stripe3DS2/Stripe3DS2/UIViewController+Stripe3DS2.h:9:9: fatal error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
^~~~~~~~~~~~~~~
[323/851] Compiling Stripe3DS2 resource_bundle_accessor.m
clang: warning: using sysroot for 'MacOSX' but targeting 'iPhone' [-Wincompatible-sysroot]
1 error generated.
[323/851] Compiling Stripe3DS2 UIViewController+Stripe3DS2.m
[323/851] Compiling Stripe3DS2 UIView+LayoutSupport.m
[324/851] Compiling cipher.c
[325/851] Compiling aes_nohw.c
[326/851] Compiling aes128gcmsiv-x86_64.mac.x86_64.S
[327/851] Compiling printf.c
[328/851] Compiling socket.c
[329/851] Compiling pair.c
[330/851] Compiling hexdump.c
/private/var/tmp/_bazel_achew/86cdfd37d379cf1772409fa48c6ef35e/sandbox/darwin-sandbox/4139/execroot/__main__/bazel-out/ios-sim_arm64-min15.0-applebin_ios-ios_sim_arm64-fastbuild-ST-4e6c2a19403f/bin/external/swift_pkgs/spm_build/checkouts/Valet/Sources/Valet/SecureEnclave.swift:69:26: warning: 'kSecUseOperationPrompt' was deprecated in iOS 14.0: Use kSecUseAuthenticationContext and set LAContext.localizedReason property
secItemQuery[kSecUseOperationPrompt as String] = userPrompt
^
/private/var/tmp/_bazel_achew/86cdfd37d379cf1772409fa48c6ef35e/sandbox/darwin-sandbox/4139/execroot/__main__/bazel-out/ios-sim_arm64-min15.0-applebin_ios-ios_sim_arm64-fastbuild-ST-4e6c2a19403f/bin/external/swift_pkgs/spm_build/checkouts/Valet/Sources/Valet/SecureEnclave.swift:82:59: warning: 'kSecUseAuthenticationUIFail' was deprecated in iOS 14.0: Instead of kSecUseAuthenticationUI, use kSecUseAuthenticationContext and set LAContext.interactionNotAllowed property
secItemQuery[kSecUseAuthenticationUI as String] = kSecUseAuthenticationUIFail
^
/private/var/tmp/_bazel_achew/86cdfd37d379cf1772409fa48c6ef35e/sandbox/darwin-sandbox/4139/execroot/__main__/bazel-out/ios-sim_arm64-min15.0-applebin_ios-ios_sim_arm64-fastbuild-ST-4e6c2a19403f/bin/external/swift_pkgs/spm_build/checkouts/Valet/Sources/Valet/SecureEnclave.swift:118:26: warning: 'kSecUseOperationPrompt' was deprecated in iOS 14.0: Use kSecUseAuthenticationContext and set LAContext.localizedReason property
secItemQuery[kSecUseOperationPrompt as String] = userPrompt
^
/private/var/tmp/_bazel_achew/86cdfd37d379cf1772409fa48c6ef35e/sandbox/darwin-sandbox/4139/execroot/__main__/bazel-out/ios-sim_arm64-min15.0-applebin_ios-ios_sim_arm64-fastbuild-ST-4e6c2a19403f/bin/external/swift_pkgs/spm_build/checkouts/Valet/Sources/Valet/SinglePromptSecureEnclaveValet.swift:197:30: warning: 'kSecUseOperationPrompt' was deprecated in iOS 14.0: Use kSecUseAuthenticationContext and set LAContext.localizedReason property
secItemQuery[kSecUseOperationPrompt as String] = userPrompt
^
Do you have any theories @cgrindel ?
from rules_spm.
Were you able to clone their repo and run swift build
? If so, did you have to specify some additional flags (e.g. --arch
)? This is a limitation of the current rules_spm
implementation. It does not handle compilation for other platforms very well. Alas, this is one of the issues that spurred me to gather feedback (#157).
from rules_spm.
not sure it helps @achew22 - but uikit is specifically used on ios. appkit is for macos.
if you have scripts that are importing - need to determine os
#import <UIKit/UIKit.h>
https://stackoverflow.com/questions/68676690/macos-uikit-uikit-h-not-found
from rules_spm.
UPDATE - I see someone is using bazel + stripe here
from rules_spm.
Related Issues (20)
- Depend on package but not its dependencies HOT 3
- Update `rules_spm` to build fetched dependencies using Bazel instead of Swift Package Manager HOT 4
- Ask the community how they would like to move forward with `rules_spm` design/behavior HOT 1
- Write design doc describing path forward
- SPM packages that include the DocC output in repo fail to build HOT 1
- Update `spm_xcode_toolchain.bzl` to use `DefaultInfo.files_to_run`.
- spm_repositories - doesn't seem to work HOT 5
- spm_swift_binary - use local binary / or how to use local spm files HOT 1
- Undefined symbols for architecture x86_64 when using ios_unit_test HOT 2
- tools/spm_parser fails building with swiftc 5.7 HOT 4
- Error in fail: A clang target must have at least one public header. target: GoogleSignIn HOT 1
- Cannot include package with binary (not executable) library target HOT 1
- Dependency Dashboard
- Error building package in both modes
- Bazel mode regression in `0.11.1` HOT 5
- Enable `incompatible_xcode_` integration tests to run on `macos-12` CI
- Not all outputs were created or valid when building for IOS device HOT 7
- attribute 'srcs' in 'filegroup' rule: invalid target name '_:).json': HOT 2
- Deprecate `rules_spm`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_spm.