rules_swift_package_manager
rules_swift_package_manager copied to clipboard
Can't build Adjust SDK dependency
When I try to add dependency on https://github.com/adjust/ios_sdk I get this build failure.
/private/var/tmp/_bazel_johnflanagan/b8bc7972ecfebadd8d249c6ec0018f24/execroot/_main/external/rules_swift_package_manager~0.29.1~swift_deps~swiftpkg_ios_sdk/AdjustSdkStatic/module.modulemap:1:18: error: redefinition of module 'AdjustSdk'
framework module AdjustSdk {
^
/private/var/tmp/_bazel_johnflanagan/b8bc7972ecfebadd8d249c6ec0018f24/execroot/_main/external/rules_swift_package_manager~0.29.1~swift_deps~swiftpkg_ios_sdk/ModuleMap/module.modulemap:1:18: note: previously defined here
framework module AdjustSdk {
^
/private/var/tmp/_bazel_johnflanagan/b8bc7972ecfebadd8d249c6ec0018f24/execroot/_main/external/rules_swift_package_manager~0.29.1~swift_deps~swiftpkg_ios_sdk/AdjustSdkStatic/module.modulemap:1:18: error: redefinition of module 'AdjustSdk'
framework module AdjustSdk {
^
/private/var/tmp/_bazel_johnflanagan/b8bc7972ecfebadd8d249c6ec0018f24/execroot/_main/external/rules_swift_package_manager~0.29.1~swift_deps~swiftpkg_ios_sdk/ModuleMap/module.modulemap:1:18: note: previously defined here
framework module AdjustSdk {
I'm not sure how to resolve those errors. The dependency works with vanilla SPM.
Thanks!
rules_swift_package_manager creates modulemaps in certain situations. I suspect that we need to update the logic to check for a modulemap before we create one.
@cgrindel creating a patch file to delete the ModuleMap folder at the root of https://github.com/adjust/ios_sdk resolves the issue for me. I don't see that folder directly referenced in the Package.swift file or the generated BUILD.bazel file, so I'm not sure why it's being included.
I assume this is covered under the FAQ related to sandboxing?
@brentleyjones The only mention of sandboxing I see in the FAQ is related to rules_xcodeproj, but I'm running into this issue with plain bazel build
Does following the steps (without the rules_xcodeproj part) fix it? I think the modulemap should only be accidentally picked up when sandboxing is disabled.
@jflan-dd Can you check that https://github.com/cgrindel/rules_swift_package_manager/pull/1085 fixes this for you?
@brentleyjones The issues appears to be resolved with that fix. Thanks!