What should go in the <license> tag?

I’ve always put just “BSD” in the package.xml of our projects, mostly because it is the exact value mentioned in https://www.ros.org/reps/rep-0149.html#license-multiple-but-at-least-one . However, this value is not SPDX.

What’s the current best practice? Should we start putting SPDX identifiers into the license tag? Would it deserve a small update of REP 149?

I think it would be ideal to move to SPDX, just because it is explicit.

When I review, I’m not particularly strict on that, but it does seem like a good opportunity for a REP update and some more automation in the GitHub - ros-infrastructure/rosdistro-reviewer: Automation for analyzing changes to the rosdep database and rosdistro index · GitHub

4 Likes

The <license> field in package.xml is used by both rosdoc2 and rosindex to display license information on documentation pages. I tried to understand what they actually use by examining the code. Caveat: did not actually test.

rosindex takes the text from the first of possibly multiple license tags, and displays that string as the “License” in the package summary:
license = REXML::XPath.first(manifest_doc, "/package/license/text()").to_s

rosdoc2 uses catkin_package, which will concatenate strings for possibly multiple tags. rosdoc2 will include the text of a file found in the root directory with the name license.* (ignoring case). I could not find any use of the optional ‘file’ attribute of the license tag.

So “best practice” from the perspective of current implementations of these documentation generators would be to include the string that you actually want displayed as the license summary. Plenty of packages use “Apache License 2.0” as that string for example instead of “Apache-2.0” as recommended by REP 149

I’m not saying any of this is correct or official “best practice”, only what is actually implemented.

2 Likes