Open blaizard opened 3 years ago
This feature would be very useful for my work group as well.
I think that we should add this support to the cc_library
and cc_binary
rules as well, to keep the cc_library
and cc_common.compile
, and the cc_binary
and cc_common.link
, interfaces aligned and to avoid forcing users to write custom rules if they want to save additional compile and link artifacts in their build chains.
(This feature was also mentioned in the following thread: https://groups.google.com/g/bazel-discuss/c/ZlB7gjfTd7c)
For cc_common.link, this is already implemented, see https://github.com/bazelbuild/bazel/pull/12883 for commit information and example how to extract the map file
Hi @torgil, I wrote a similar issue for cc_binary long time ago, https://github.com/bazelbuild/bazel/issues/6718. But if I got it right your implementation will not impact cc_binary rule? Is it something you plan to do (add the new attribute to cc_binary)?
Hi Greetings to all, I am working on GHS toolchain. Ccarm compiler generates “per object debug info file” by providing the flag -G and the extension of the file is .dbo. Debug info file for the archive is .dba. GCC toolchain generates per object debug info file with the extension of .dwo and .dwp (for archive) by providing the flag -gsplit-dwarf. Moreover, I am trying to produce .map file also. How to get these outputs (.dbo,.dba and .map)? Please guide me, is there any way to achieve this without using custom rules?
hello @torgil and @oquenchil Can you please let me know how to produce additional outputs like .dbo,.dba and .map Does Bazel support without using custom rules.
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.
We still need this to be able to declare additional compile outputs, like .indexstore
directories or other custom single-file outputs.
Description of the feature request:
This is a feature request to add the possibility to gather extra outputs for the compile and linking actions of the cc toolchain via
cc_common.compile
andcc_common.link
. The interface could be as simple as adding an attributeextra_outputs
to these 2 functions.Feature requests: what underlying problem are you trying to solve with this feature?
This would enable gathering artifacts like map file (-Wl,-Map=...) or stack usage files (-fstack-usage) for example.
As a workaround, one can use
cc_common.create_link_variables
+cc_common.get_memory_inefficient_command_line
+ctx.actions.run
but there seem to be a significant amount of code needed to achieve the same result (see here for example),This would solve https://github.com/bazelbuild/bazel/issues/6718