Skip to content
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

Wrongly reports missing copyright/licensing information for a Qt RCC file #895

Closed
ingokloecker opened this issue Jan 18, 2024 · 6 comments · Fixed by #896
Closed

Wrongly reports missing copyright/licensing information for a Qt RCC file #895

ingokloecker opened this issue Jan 18, 2024 · 6 comments · Fixed by #896
Assignees
Labels
bug Something isn't working

Comments

@ingokloecker
Copy link

This is a regression compared to version 2.1.

For the file resources.qrc with content

<!--
 SPDX-FileCopyrightText: 2020 Dimitris Kardarakos <dimkard@posteo.net>
 SPDX-License-Identifier: BSD-2-Clause
-->
<RCC>
    <qresource prefix="/">
        <file alias="Main.qml">contents/ui/Main.qml</file>
        <file alias="GlobalDrawer.qml">contents/ui/GlobalDrawer.qml</file>
        <file alias="ScheduleView.qml">contents/ui/ScheduleView.qml</file>
        <file alias="FavoritesView.qml">contents/ui/FavoritesView.qml</file>
        <file alias="MapView.qml">contents/ui/MapView.qml</file>
        <file alias="Conferences.qml">contents/ui/Conferences.qml</file>
        <file alias="EventInfo.qml">contents/ui/EventInfo.qml</file>
        <file alias="SettingsView.qml">contents/ui/SettingsView.qml</file>
    </qresource>
</RCC>

the tool reports

# MISSING COPYRIGHT AND LICENSING INFORMATION

The following files have no copyright and licensing information:
* src/resources.qrc


# SUMMARY

* Bad licenses: 0
* Deprecated licenses: 0
* Licenses without file extension: 0
* Missing licenses: 0
* Unused licenses: 0
* Used licenses: BSD-2-Clause, CC0-1.0, GPL-3.0-or-later, LGPL-3.0-or-later, CC-BY-SA-4.0, BSD-3-Clause
* Read errors: 0
* files with copyright information: 79 / 80
* files with license information: 79 / 80

Unfortunately, your project is not compliant with version 3.0 of the REUSE Specification :-(

I have bisected this. The bad commit is https://git.fsfe.org/reuse/tool/commit/ead44eac0df7a3c8de695aef88b459b93296ae4b. Apparently, this change makes the reuse tool treat the above file as "uncommentable" which is clearly wrong.

Digging further it looks like

".qrc": UncommentableCommentStyle

in src/reuse/comment.py is why reuse treats the above file as "uncommentable".

This was added by https://git.fsfe.org/reuse/tool/commit/5895f3682ba09ced994fd3be714ab4b4598e4e58 with comment

.qrc: Those are Qt XML files containing indexes to resource files.
Added as Uncommentable because Qt Creator IDE rewrites the file
when saving, loosing copyrights each time therefore loosing history.

I'm not convinced that the behavior of one IDE is a good reason for treating .qrc files as "uncommentable". In particular, it gives a wrong result (claims non-compliance with REUSE 3.0). The above file is clearly compliant with version 3.0 of the REUSE Specification (which version 2.1 of the tool correctly reports).

I propose to revert https://git.fsfe.org/reuse/tool/commit/5895f3682ba09ced994fd3be714ab4b4598e4e58. People using Qt Creator will have to provide the copyright information for their .qrc (and other Qt XML files) externally while we can continue adding the copyright information directly in the .qrc files.

@fmuellner
Copy link

This was added by https://git.fsfe.org/reuse/tool/commit/5895f3682ba09ced994fd3be714ab4b4598e4e58

That commit also broke XML UI definitions for GTK projects, because they usually use the same .ui suffix as Qt Creator.

@carmenbianca carmenbianca added the bug Something isn't working label Jan 19, 2024
@carmenbianca carmenbianca self-assigned this Jan 19, 2024
@carmenbianca
Copy link
Member

You're right this is a bug. Thanks for flagging this. There are two things simultaneously not quite right:

  • The files marked uncommentable are, in fact, commentable. Marking them as uncommentable was fine at the time of Add a set of Qt file types (pri, qrc, qss, ui) #755: it just meant that when doing reuse annotate, a .license file would be created instead of either failing or adding a comment.
  • However, in Do not scan uncommentable files #825, the semantics of what it means to be an uncommentable file slightly changed. Now, uncommentable files are not parsed at all for REUSE info.

I will get to work on writing a quick patch to right this situation, and getting a release out the door soon (today?). Most likely I will do this:

  1. Files that are in fact commentable shouldn't be marked commentable, even if wisdom dictates that you shouldn't put licensing information inside of them.
  2. I will revert Do not scan uncommentable files #825. That feature is likely to cause grief in the future as well.

Thanks!

@biljkus
Copy link

biljkus commented Jan 19, 2024

We also have an issue with .csv. One day ago the pipeline with the REUSE job passed correctly, and today it complains that there is no copyright/license when there is: https://gitlab.com/cttc-lena/nr/-/pipelines/1143245343.

@ingokloecker
Copy link
Author

Thanks a lot for the swift reaction!

@carmenbianca
Copy link
Member

Fixed in v3.0.1, hopefully. Let me know if something is still awry.

@biljkus
Copy link

biljkus commented Jan 23, 2024

Thanks for the quick fix. It works for our issue with .csv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants