Repository navigation
License check - #1289
License check#1289
Conversation
5a927ac to
aeddfc3
Compare
|
was thinking about this - at this time - this only looks at source files (.c) not header files (.h) - should likely add for the same reason... Will see if I can update. |
aeddfc3 to
c886795
Compare
generates a list that looks like: I know this works on gcc, but have not tested on clang, or on MSVC yet. Feedback welcome. |
c886795 to
edccd54
Compare
On Windows it doesn't work but it can be easily fixed by including Utilities.cmake at the top of the main cmake file. Error was: |
|
Thanks - will fix that shortly. |
|
Any other feedback? The list is pretty dense - it might use an empty line between targets? |
edccd54 to
a598ee7
Compare
|
I don't know if you want me to fix that locally as part of this patchset? or wait for @pcercuei to have a look at pcercuei/libini#5 I think my preference would be to fix things, and then turn missing SPDX lines into a error - and then turn this on in CI, to make sure that we catch things in the future, but I'm open to opinions. |
a598ee7 to
b1ffd56
Compare
From a technical point of view, you can't touch the files from deps as you would for a regular source file. The original repository would need to be updated first and then make libiio repo point to the updated libini repo. |
|
I merged the libini PR with the SPDX headers btw. |
@dNechita - do you want to take care of this then? |
20485c1 to
d43c2dc
Compare
3ef4ea5 to
0a93bf4
Compare
This adds a spdx_check_target() CMake function to validate that all source files in a target (and its linked static/shared libraries) include a valid SPDX-License-Identifier tag and hides it behind a new "-DLICENSE_CHECK" cmake option. Key features: - Recursively gathers all sources linked into a target, even from subdirectories or helper libraries. - uses preprocessor to find header files, based on current settings - Differentiates between known SPDX-licensed files and those missing tags. - Handles relative paths for better readability. - Filters out generated or build-directory files (e.g., config.h, yacc/lex output). - Summarizes licenses used and flags untagged files for manual review. - Prints out external libraries which are linked (which needs to be checked by hand). This is especially useful in projects with mixed-license source files, where build options can change the resulting binaries license. This will ensure license compliance, auditability, and downstream clarity. Helps improve: - Legal review processes - Contributor workflow (by enforcing license hygiene) - Automation and SPDX compatibility Signed-off-by: Robin Getz <rgetz503@gmail.com>
- Clarify that libiio source includes multiple open-source licenses (MIT, GPL, LGPL) - Explain that resulting binary license depends on build configuration and linked external libraries - Recommend using -DLICENSE_CHECK=ON to verify license compliance - Note that this header file is MIT-licensed but overall project license may differ Signed-off-by: Robin Getz <rgetz503@gmail.com>
Signed-off-by: Robin Getz <rgetz503@gmail.com>
in the iio_common_config internal statically linked library - ensure that POSIX_C_SOURCE is set, like the rest of the entire library. Signed-off-by: Robin Getz <rgetz503@gmail.com>
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Signed-off-by: Robin Getz <rgetz503@gmail.com>
0a93bf4 to
a7ee123
Compare
|
@dNechita : can you poke the bsd build/workflow? I would rather keep all the debug/messages turned on, while checking new targets before I remove them.... |
Sure. Done. |
Signed-off-by: Robin Getz <rgetz503@gmail.com>
|
@dNechita - it wasn't turned on for netbsd - so it built without... can you try again (thanks). |
done |
|
@dNechita - it looks like everything works - did you want me to leave it on in CI (to make sure it continues to work?) |
Yes, keep it on in the CI, please. |
|
@dNechita - sorry - there were a bunch of noisy debug things in there - that shouldn't have been merged. I will make a new PR with those cleaned up. |
I should have gave another look before merging. I will wait for your PR. |
Can now print out things like this:
which can get confusing for the utils - but it's clear that they are still GPL (not MIT, or LGPL).
which will adapt based on cmake options used.
pcercuei/libini#5 is in process to fix the
Missing SPDX: deps/libini/libini.cissue.