Coder Social home page Coder Social logo

Comments (7)

mattrobmattrob avatar mattrobmattrob commented on August 28, 2024 1

I don't see any reference to platform_types in the rules_ios codebase. Can you give more of the error message or a reproduction in rules_ios for us to debug, @wendyliga?

from rules_ios.

thiagohmcruz avatar thiagohmcruz commented on August 28, 2024

+1 couldn't find any reference to platform_types in rules_ios nor in rules_apple or the Bazel command line 🤔, a repro would be great!

from rules_ios.

wendyliga avatar wendyliga commented on August 28, 2024

@mattrobmattrob @thiagohmcruz sure, i have created a simple project here and run bazel build //src/Bar to reproduce the issue.

fyi: I could find any test case for this specific configuration; the one available is for static packing.

this is the full log and the stack trace

ERROR: /Users/wendy.liga/Developer/simple_bazel/src/Bar/BUILD:11:26: in apple_framework_packaging rule //src/Bar:Bar: 
Traceback (most recent call last):
        File "/private/var/tmp/_bazel_wendy.liga/8284c4a94ccbbb579b9e33d50d39273c/external/build_bazel_rules_ios/rules/framework.bzl", line 1031, column 48, in _apple_framework_packaging_impl
                bundle_outs = _bundle_dynamic_framework(ctx, is_extension_safe = is_extension_safe, avoid_deps = avoid_deps)
        File "/private/var/tmp/_bazel_wendy.liga/8284c4a94ccbbb579b9e33d50d39273c/external/build_bazel_rules_ios/rules/framework.bzl", line 635, column 84, in _bundle_dynamic_framework
                bundle_name, bundle_extension = bundling_support.bundle_full_name_from_rule_ctx(ctx)
        File "/private/var/tmp/_bazel_wendy.liga/8284c4a94ccbbb579b9e33d50d39273c/external/build_bazel_rules_apple/apple/internal/bundling_support.bzl", line 56, column 55, in _bundle_full_name_from_rule_ctx
                rule_descriptor = rule_support.rule_descriptor(ctx),
        File "/private/var/tmp/_bazel_wendy.liga/8284c4a94ccbbb579b9e33d50d39273c/external/build_bazel_rules_apple/apple/internal/rule_support.bzl", line 867, column 28, in _rule_descriptor
                platform_type = getattr(apple_common.platform_type, ctx.attr.platform_type)
Error in getattr: 'platform_types' value has no field or method ''
Available attributes: catalyst, ios, macos, tvos, watchos

from rules_ios.

mattrobmattrob avatar mattrobmattrob commented on August 28, 2024

Why are you using apple_framework_packaging directly instead of this?

load("@build_bazel_rules_ios//rules:framework.bzl", "apple_framework")

apple_framework(
    name = "Bar",
    srcs = glob(['**/*.swift']),
    bundle_id = "com.example.bar",
    infoplists = ["Info.plist"],
    link_dynamic = True,
    platforms = {"ios": "12.0"},
    visibility = ["//visibility:public"],
)

And, similarly, you should be using the rules_ios.ios_application macro if you want to support packaging in rules_ios things:

load("@build_bazel_rules_ios//rules:app.bzl", "ios_application")

from rules_ios.

mattrobmattrob avatar mattrobmattrob commented on August 28, 2024

Additionally, it seems like you're mixing a lot of rules_apple/rules_swift native stuff with rules_ios things. Why are you doing that vs. just using entirely rules_ios? For example, you can swap the RxRelay definition over to something like this:

apple_framework(
name = "BasicXCFrameworkDynamic",
module_name = "BasicXCFrameworkDynamic",
platforms = {"ios": "10.0"},
sdk_frameworks = [
"Foundation",
"SafariServices",
"UIKit",
"WebKit",
],
vendored_xcframeworks = [
{
"name": "BasicXCFrameworkDynamic",
"slices": [
{
"identifier": "ios-arm64",
"platform": "ios",
"platform_variant": "",
"supported_archs": ["arm64"],
"path": "BasicXCFrameworkDynamic.xcframework/ios-arm64/BasicXCFrameworkDynamic.framework",
"build_type": {
"linkage": "dynamic",
"packaging": "framework",
},
},
{
"identifier": "ios-arm64_x86_64-simulator",
"platform": "ios",
"platform_variant": "simulator",
"supported_archs": [
"arm64",
"x86_64",
],
"path": "BasicXCFrameworkDynamic.xcframework/ios-arm64_x86_64-simulator/BasicXCFrameworkDynamic.framework",
"build_type": {
"linkage": "dynamic",
"packaging": "framework",
},
},
],
},
],
visibility = ["//visibility:public"],
)

from rules_ios.

wendyliga avatar wendyliga commented on August 28, 2024

@mattrobmattrob my usecase is to generate a precompiled framework, you should use apple_framework_packing right?
regarding the mixing of the rules, I think the target //src/Bar is quite isolated. the repo is exist before, i just reuse it for showing this case.

from rules_ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.