Skip to content

Commit 119802c

Browse files
committed
Make module ready for source SBOM checking
This includes: - turning VERIFY_SOURCE_SBOM ON - adding exception to the licenseRule.json files - correcting the licensing given via REUSE.toml files - renaming license files not located in LICENSES folder. They need to be named LICENSE. to be ignored by reuse and excluded from the source SBOM. The name are updated in the corresponding qt_attribution.json A lot of files are skipped during the license test, but all are present in the source SBOM. This is why correction are needed before turning the source SBOM check on. [ChangeLog][Third-Party Code] Renaming the license files with prefix LICENSE. to have them ignored by reuse tool. Task-number: QTBUG-131434 Pick-to: 6.9 Change-Id: I668dad0c545b6559c2263a4d60928e6878db838f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
1 parent 90fec7d commit 119802c

File tree

12 files changed

+134
-54
lines changed

12 files changed

+134
-54
lines changed

REUSE.toml

+48-41
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,21 @@ comment = "module and plugin, according to licenseRule.json"
2323
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
2424
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only"
2525

26+
[[annotations]]
27+
path = ["src/designer/**"]
28+
precedence = "closest"
29+
comment = "tools, according to licenseRule.json"
30+
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
31+
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0"
32+
33+
[[annotations]]
34+
path = ["src/designer/src/lib/uilib/**",
35+
"src/designer/src/plugins/**"]
36+
precedence = "closest"
37+
comment = "module and plugin, according to licenseRule.json"
38+
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
39+
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only"
40+
2641
[[annotations]]
2742
path = ["tests/**.ts*",
2843
"tests/**.ui",
@@ -37,10 +52,11 @@ path = ["tests/**.ts*",
3752
"tests/**cmd",
3853
"tests/**.po*",
3954
"tests/**.js",
55+
"tests/**.json",
4056
"tests/**.lst",
57+
"tests/**.py",
4158
"tests/**expected.error",
4259
"tests/**main.mjs",
43-
"tests/**main.py",
4460
"tests/auto/cmake/linguist/test_i18n_auto_ts_file_names/lib.cpp",
4561
"tests/auto/linguist/lconvert/data/test-trans_seg.xlf",
4662
"tests/auto/linguist/lconvert/data/untranslated.qm",
@@ -64,35 +80,47 @@ SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
6480
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GPL-3.0-only"
6581

6682
[[annotations]]
67-
path = ["**.pro", "**.qrc", "**CMakeLists.txt", ".cmake.conf", "**.yaml", "**.json",
83+
path = ["**.pro", "**.qrc", "**CMakeLists.txt", ".cmake.conf", "**.yaml",
84+
"coin/axivion/ci_config_linux.json",
6885
"**.cfg", "**.plist", "**.pri", "**.prf"]
6986
precedence = "closest"
7087
comment = "build system"
7188
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
7289
SPDX-License-Identifier = "BSD-3-Clause"
7390

7491
[[annotations]]
75-
path = [".tag", "**/.gitattributes", "**.gitignore"]
92+
path = [".tag", "**/.gitattributes", "**.gitignore",
93+
".gitmodules"]
7694
precedence = "closest"
7795
comment = "version control system. Licensed as build system"
7896
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
7997
SPDX-License-Identifier = "BSD-3-Clause"
8098

8199
[[annotations]]
82-
path = ["**/doc/images/**", "**/doc/snippets/**", "examples/**", "src/qdoc/qdoc/doc/examples"]
100+
path = ["**/doc/snippets/**", "examples/**", "src/qdoc/qdoc/doc/examples/**",
101+
"src/qdoc/qdoc/tests/**/testdata/**/examples/**"]
83102
comment = "this must be after the build system table because example and snippets take precedence over build system"
84103
precedence = "closest"
85104
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
86105
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause"
87106

88107
[[annotations]]
89-
path = ["**/README*", "**.qdocconf", "**.qdoc.sample", "**.qdoc", "**.qdocinc",
90-
".gitmodules"]
108+
path = ["**/doc/images/**", "**/README*", "**.qdocconf", "**.qdoc.sample", "**.qdoc", "**.qdocinc"]
91109
comment = "documentation"
92110
precedence = "closest"
93111
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
94112
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"
95113

114+
[[annotations]]
115+
path = ["src/qdoc/qdoc/**/testdata/**.qdocconf",
116+
"src/qdoc/qdoc/**/testdata/**.qdoc",
117+
"src/qdoc/qdoc/**/testdata/**.qdocinc"]
118+
precedence = "closest"
119+
comment = "test"
120+
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
121+
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GPL-3.0-only"
122+
123+
96124
[[annotations]]
97125
path = ["**.toml", "licenseRule.json"]
98126
comment = "documentation"
@@ -107,13 +135,6 @@ precedence = "override"
107135
SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
108136
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"
109137

110-
[[annotations]]
111-
path = ["**LICENSE*"]
112-
precedence = "override"
113-
comment = "License file."
114-
SPDX-FileCopyrightText = "None"
115-
SPDX-License-Identifier = "CC0-1.0"
116-
117138
[[annotations]]
118139
path = "examples/linguist/trollprint/trollprint_pt.ts"
119140
precedence = "override"
@@ -122,36 +143,22 @@ SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd."
122143
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause"
123144

124145
[[annotations]]
125-
path = ["src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/webxml/test-componentset-switch-qml.webxml",
126-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/webxml/test-componentset-tabwidget-qml.webxml",
127-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/webxml/test-componentset-progressbar-qml.webxml",
128-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/html/test-componentset-tabwidget-qml.html",
129-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/html/test-componentset-progressbar-qml.html",
130-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/html/test-componentset-switch-qml.html",
131-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject_headerdocs/expected/webxml/test-componentset-tabwidget-qml.webxml",
132-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject_headerdocs/expected/webxml/test-componentset-progressbar-qml.webxml",
133-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject_headerdocs/expected/html/test-componentset-progressbar-qml.html",
134-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject_headerdocs/expected/html/test-componentset-switch-qml.html",
135-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject_headerdocs/expected/html/test-componentset-tabwidget-qml.html",
136-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject_headerdocs/expected/webxml/test-componentset-switch-qml.webxml"]
146+
path = ["src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/**.webxml",
147+
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/**.html",
148+
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/**.cpp",
149+
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/**.h",
150+
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/**.qml",
151+
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/**.qdoc",
152+
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/**.qdoc.sample",
153+
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/**.qdocconf",
154+
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/**.xml"]
137155
precedence = "override"
138-
comment = "reuse ignore those file, trouble reading. documentation example."
156+
comment = ["reuse ignore or have trouble reading some of those webxml or html files",
157+
"files in this directory are for file generation within testing",
158+
"the licensing does not necessary correspond to the file",
159+
"Licensing for those files is test licensing"]
139160
SPDX-FileCopyrightText = "Copyright (C) 2016 The Qt Company Ltd."
140-
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause"
141-
142-
[[annotations]]
143-
path = ["src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/webxml/test-demos-demo-demo-cpp.webxml",
144-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/webxml/test-componentset-componentset-qml.webxml",
145-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/html/test-demos-demo-demo-cpp.html",
146-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/html/test-componentset-componentset-qml.html",
147-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject_headerdocs/expected/html/test-demos-demo-demo-cpp.html",
148-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject_headerdocs/expected/webxml/test-componentset-componentset-qml.webxml",
149-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject_headerdocs/expected/html/test-componentset-componentset-qml.html",
150-
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject_headerdocs/expected/webxml/test-demos-demo-demo-cpp.webxml"]
151-
precedence = "override"
152-
comment = "reuse ignore those file, trouble reading."
153-
SPDX-FileCopyrightText = "Copyright (C) 2023 The Qt Company Ltd."
154-
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0"
161+
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GPL-3.0-only"
155162

156163

157164

coin/module_config.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ machine_type:
1313

1414
instructions:
1515
Build:
16+
- type: EnvironmentVariable
17+
variableName: VERIFY_SOURCE_SBOM
18+
variableValue: "ON"
1619
- !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml"
1720

1821
Test:

licenseRule.json

+76-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
"unless they are examples",
1010
"Files with other endings can also be build system files"
1111
],
12-
"file_pattern_ending" : ["CMakeLists.txt", ".cmake", ".pro", ".prf", "configure"],
12+
"file_pattern_ending" : ["CMakeLists.txt", ".cmake", ".pro", ".prf", "configure",
13+
".gitignore", ".pri", ".cfg", ".qrc", ".plist",
14+
".cmake.conf", ".gitattributes", ".tag",
15+
"coin/axivion/ci_config_linux.json", ".yaml", ".gitmodules"],
1316
"location" : {
1417
"" : {
1518
"comment" : "File with other endings also belong to the build system file type",
@@ -24,14 +27,26 @@
2427
}
2528
},
2629
{
27-
"file_pattern_ending" : [".qdoc", ".qdocinc" , ".qdocconf", ".qdoc.sample", "README.md"],
30+
"file_pattern_ending" : [".qdoc", ".qdocinc" , ".qdocconf", ".qdoc.sample", "README.md",
31+
"README", "qt_attribution.json", "REUSE.toml", "README_test.chromium",
32+
"licenseRule.json"],
2833
"location" :{
2934
"" : {
3035
"comment" : "",
3136
"file type" : "documentation",
3237
"spdx" : ["LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"]
3338
},
34-
"src/qdoc/qdoc/tests/generatedoutput/testdata/" : {
39+
"src/qdoc/qdoc/tests/generatedoutput/testdata/(?!REUSE.toml)" : {
40+
"comment" : "",
41+
"file type" : "test",
42+
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
43+
},
44+
"src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/(?!REUSE.toml)" : {
45+
"comment" : "",
46+
"file type" : "test",
47+
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
48+
},
49+
"src/qdoc/qdoc/tests/config/testdata/(?!REUSE.toml)" : {
3550
"comment" : "",
3651
"file type" : "test",
3752
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
@@ -50,6 +65,11 @@
5065
"file type" : "tools",
5166
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0"]
5267
},
68+
"tests/auto/linguist/lupdate/testdata/good/parsepython/main.py" : {
69+
"comment" : "",
70+
"file type" : "test",
71+
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
72+
},
5373
"(.*)(examples/|snippets/)" : {
5474
"comment" : "Example takes precedence",
5575
"file type" : "examples and snippets",
@@ -68,6 +88,11 @@
6888
"file type" : "tools",
6989
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0"]
7090
},
91+
"dist/" : {
92+
"comment" : "Default",
93+
"file type" : "documentation",
94+
"spdx" : ["LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"]
95+
},
7196
"src/designer/src/plugins/" : {
7297
"comment" : "plugins for Qt Widgets Designer, but also Qt UI Tools",
7398
"file type" : "module and plugin",
@@ -103,7 +128,7 @@
103128
"file type" : "tools",
104129
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0"]
105130
},
106-
"src/designer/src/lib/uilib" : {
131+
"src/designer/src/lib/uilib/" : {
107132
"comment" : "code used in src/uitools",
108133
"file type" : "module and plugin",
109134
"spdx" : ["LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only"]
@@ -134,7 +159,7 @@
134159
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0"]
135160
},
136161
"src/qdoc/catch/include/catch/catch.hpp" : {
137-
"comment" : "src/qdoc/catch/CATCH_LICENSE.txt",
162+
"comment" : "src/qdoc/catch/LICENSE.CATCH.txt",
138163
"file type" : "module and plugin",
139164
"spdx" : ["BSL-1.0"]
140165
},
@@ -148,7 +173,7 @@
148173
"file type" : "test",
149174
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
150175
},
151-
"src/qdoc/qdoc/tests/generatedoutput/testdata/examples/" : {
176+
"src/qdoc/qdoc/tests/(validateqdocoutputfiles|generatedoutput)/.*/(examples|snippets)" : {
152177
"comment" : "",
153178
"file type" : "test",
154179
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
@@ -157,6 +182,51 @@
157182
"comment" : "",
158183
"file type" : "examples and snippets",
159184
"spdx" : ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
185+
},
186+
"(examples|.*).*/doc/images/" : {
187+
"comment" : "Documentation asset",
188+
"file type" : "documentation",
189+
"spdx" : ["LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"]
190+
},
191+
"src/assistant/assistant/doc/images/" : {
192+
"comment" : "Documentation asset",
193+
"file type" : "documentation",
194+
"spdx" : ["LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"]
195+
},
196+
"tests/auto/linguist/lconvert/data/test-kde-.*.po" : {
197+
"comment" : "",
198+
"file type" : "public domain",
199+
"spdx" : ["CC0-1.0"]
200+
},
201+
"tests/auto/linguist/lconvert/data/wrapping.po" : {
202+
"comment" : "",
203+
"file type" : "public domain",
204+
"spdx" : ["CC0-1.0"]
205+
},
206+
"tests/auto/linguist/lconvert/data/test1-.*.po" : {
207+
"comment" : "",
208+
"file type" : "public domain",
209+
"spdx" : ["CC0-1.0"]
210+
},
211+
"tests/auto/linguist/lconvert/data/test-translator-comment.po" : {
212+
"comment" : "",
213+
"file type" : "public domain",
214+
"spdx" : ["CC0-1.0"]
215+
},
216+
"tests/auto/linguist/lconvert/data/test-empty-comment.po" : {
217+
"comment" : "",
218+
"file type" : "public domain",
219+
"spdx" : ["CC0-1.0"]
220+
},
221+
"tests/auto/linguist/lconvert/data/test-developer-comment.po" : {
222+
"comment" : "",
223+
"file type" : "public domain",
224+
"spdx" : ["CC0-1.0"]
225+
},
226+
"src/qdoc/qdoc/src/qdoc/clang/AST/QualTypeNames.h" : {
227+
"comment" : "",
228+
"file type" : "3rd party",
229+
"spdx" : ["Apache-2.0 WITH LLVM-exception"]
160230
}
161231
}
162232
}
File renamed without changes.

src/qdoc/catch/qt_attribution.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"Version": "2.13.10",
1515
"License": "Boost Software License 1.0",
1616
"LicenseId": "BSL-1.0",
17-
"LicenseFile": "CATCH_LICENSE.txt",
17+
"LicenseFile": "LICENSE.CATCH.txt",
1818
"Copyright": "Copyright (c) 2022 Two Blue Cubes Ltd. All rights reserved."
1919
}
2020
]

src/qdoc/qdoc/src/qdoc/clang/AST/qt_attribution.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"Version": "16.0",
1515
"License": "Apache License 2.0",
1616
"LicenseId": "Apache-2.0 WITH LLVM-exception",
17-
"LicenseFile": "LLVM_LICENSE.txt",
17+
"LicenseFile": "LICENSE.LLVM.txt",
1818
"Copyright": "Copyright assigned to LLVM project contributors."
1919
}
2020
]

tests/auto/qtattributionsscanner/testdata/good/expected.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@
137137
"Id": "variants",
138138
"License": "License",
139139
"LicenseFiles": [
140-
"%{PWD}/variants/LICENSE1.txt",
141-
"%{PWD}/variants/LICENSE2.txt"
140+
"%{PWD}/variants/LICENSE.1.txt",
141+
"%{PWD}/variants/LICENSE.2.txt"
142142
],
143143
"LicenseId": "",
144144
"Name": "Variants Test",

tests/auto/qtattributionsscanner/testdata/good/variants/expected.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"Id": "variants",
1111
"License": "License",
1212
"LicenseFiles": [
13-
"%{PWD}/LICENSE1.txt",
14-
"%{PWD}/LICENSE2.txt"
13+
"%{PWD}/LICENSE.1.txt",
14+
"%{PWD}/LICENSE.2.txt"
1515
],
1616
"LicenseId": "",
1717
"Name": "Variants Test",

tests/auto/qtattributionsscanner/testdata/good/variants/qt_attribution_test.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"License": "License",
88

99
"CopyrightFile": "COPYRIGHT.txt",
10-
"LicenseFiles": [ "LICENSE1.txt", "LICENSE2.txt" ]
10+
"LicenseFiles": [ "LICENSE.1.txt", "LICENSE.2.txt" ]
1111
}

0 commit comments

Comments
 (0)