Skip to content

Consider relaxing the SPDX licenseInfoInFiles check #8052

@sschuberth

Description

@sschuberth

We currently do

// TODO: The check for [licenseInfoInFiles] can be made more strict, but the SPDX specification is not exact
// enough yet to do this safely.
licenseInfoInFiles.filterNot {
it.isSpdxExpressionOrNotPresent(ALLOW_LICENSEREF_EXCEPTIONS)
}.let { nonSpdxLicenses ->
require(nonSpdxLicenses.isEmpty()) {
"The entries in 'licenseInfoInFiles' must each be either an SPDX expression, 'NONE' or " +
"'NOASSERTION', but found ${nonSpdxLicenses.joinToString { "'$it'" }}."
}
}

which results in the SPDX report not to be written out at all if a license is not an SPDX expression with non-deprecated SPDX IDs and / or LicenseRef- "exceptions". This can be problematic if e.g. a scanner emits deprecated SPDX IDs, or declared licenses contain some free text license name.

My proposal is to not fail to write the report at all in this case, but just to log an error / warning in this case. This would allow the issue to become visible to the consumers of the SPDX report, instead of forcing them to get everything right even before the report gets written.

What do @mnonnenmacher and @fviernau think here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    reporterAbout the reporter toolspdx-utilsAbout the SPDX utility library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions