-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runfiles not bundled with macos_application #2477
Comments
brentleyjones
pushed a commit
that referenced
this issue
Aug 7, 2024
#2479) Fixes #2477 Include all data from cc_libraries as runfiles or resources, depending on aspect_hints. Provide aspect_hints for resource collection for all resource targets (eg, swift_library, cc_library, etc) By default all data is now included from cc_libraries as runfiles and follows the expected runfiles folder structure, with files retaining their nested folders and being placed in /external/pkg_name/some/file.txt when included from a http_archive or local_repository. The default behavior for other resource collecting targets like swift_library has not changed, and will continue to collect and process data as resources. To allow modification of this default behavior, users may add aspect_hints to the target cc_library/swift_library/etc. There are three supported aspect_hints: @build_bazel_rules_apple//apple:use_runfiles @build_bazel_rules_apple//apple:use_resources @build_bazel_rules_apple//apple:suppress_resources ##### Example Here is an example of modifying the default behavior to bundle data.txt as a resource instead of a runfile. ``` cc_library( name = "libapp", srcs = ["main.cpp",], data = [":data.txt"], aspect_hints = ["@build_bazel_rules_apple//apple:use_runfiles"], ) macos_application( name = "app_macos", deps = [":libapp"], ) ``` data.txt is bundled in Contents/Resources/data.txt #### Note Hints apply only to the target and do not affect transitive deps, however if a target includes runfiles then all runfiles are bundled (including transitive runfiles) regardless of the hints applied to transitive targets. --------- Co-authored-by: Luis Padron <heyluispadron@gmail.com>
sewerynplazuk
pushed a commit
to sewerynplazuk/rules_apple
that referenced
this issue
Sep 20, 2024
bazelbuild#2479) Fixes bazelbuild#2477 Include all data from cc_libraries as runfiles or resources, depending on aspect_hints. Provide aspect_hints for resource collection for all resource targets (eg, swift_library, cc_library, etc) By default all data is now included from cc_libraries as runfiles and follows the expected runfiles folder structure, with files retaining their nested folders and being placed in /external/pkg_name/some/file.txt when included from a http_archive or local_repository. The default behavior for other resource collecting targets like swift_library has not changed, and will continue to collect and process data as resources. To allow modification of this default behavior, users may add aspect_hints to the target cc_library/swift_library/etc. There are three supported aspect_hints: @build_bazel_rules_apple//apple:use_runfiles @build_bazel_rules_apple//apple:use_resources @build_bazel_rules_apple//apple:suppress_resources ##### Example Here is an example of modifying the default behavior to bundle data.txt as a resource instead of a runfile. ``` cc_library( name = "libapp", srcs = ["main.cpp",], data = [":data.txt"], aspect_hints = ["@build_bazel_rules_apple//apple:use_runfiles"], ) macos_application( name = "app_macos", deps = [":libapp"], ) ``` data.txt is bundled in Contents/Resources/data.txt #### Note Hints apply only to the target and do not affect transitive deps, however if a target includes runfiles then all runfiles are bundled (including transitive runfiles) regardless of the hints applied to transitive targets. --------- Co-authored-by: Luis Padron <heyluispadron@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Building a macos_application with a cc_library does not include runfiles.
data.txt
is not packaged in the macos_application.The text was updated successfully, but these errors were encountered: