Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Unable to use swift_library with a directory #969

Open
@erikkerber

Description

@erikkerber

When using a directory in thesrcs ofswift_library, the rules declare an incorrect intermediate object file for the directory and the build fails:

swift_worker: Could not copy bazel-out/darwin_arm64-fastbuild/bin/_swift_incremental/d_objs/c.o to bazel-out/darwin_arm64-fastbuild/bin/d_objs/c.o (No such file or directory)

NOTE: Where the failure happens is less important than there always is a<directory>.o object file declared

This works usingobjc_library:

Repro (credit@thii)
# rule.bzldef _impl(ctx):    dir_name = ctx.attr.name    out = ctx.actions.declare_directory(dir_name)    ctx.actions.run_shell(        outputs = [out],        command = """            cd {}            mkdir {}            touch {}/File{}        """.format(            ctx.bin_dir.path,            dir_name,            dir_name,            ctx.attr.ext,            dir_name,            ctx.attr.ext,        ),    )    return [DefaultInfo(files = depset([out]))]my_rule = rule(    _impl,    attrs = {        "ext": attr.string()    },)
# BUILDload(":rule.bzl", "my_rule")load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")my_rule(    name = "a",    ext = ".m",)objc_library(    name = "b",    srcs = [":a"],)my_rule(    name = "c",    ext = ".swift",)swift_library(    name = "d",    srcs = [":c"],)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp