Skip to content

✨ Add SPDX field to the license.db #200

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

ThierryO
Copy link

This is task 1 of r-devel/r-dev-day#84 @llrs

Copy link

@llrs-roche llrs-roche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think we can proceed to task 2

On a related note did you verify that OSI information here and on SPDX match? Probably it hasn't changed but there could be some differences. Not that I expect them but it might help identify some inaccuracies.

Co-authored-by: Lluís Revilla <185338939+llrs-roche@users.noreply.github.com>
@ThierryO
Copy link
Author

I'm not sure how the check the OSI field. SPDX has only "isOsiApproved" which is either true or false.

@llrs-roche
Copy link

Yes, that's what I meant yes is what on this file is open. But that's not important. Let's see how we do task2 that is the difficult part.

@ThierryO ThierryO requested a review from llrs-roche May 22, 2025 13:58
Copy link

@llrs-roche llrs-roche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second step looks very minimal. I can't test this how it works at the moment (will try to do that later today).

One thing that needs to be done before the R core accept this is document the new argument & functionality on the corresponding .Rd file. But I can do it once I test this.

@@ -611,6 +614,8 @@ function(x)
stringsAsFactors = FALSE)
}

sapply(expansions, `[[`, "SPDX") |>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some R developers try to avoid sapply because the simplify parameter can break further steps. Not sure if it is better to use lapply and then unlist.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the SPDX field will always be a string, we could replace it with

Suggested change
sapply(expansions, `[[`, "SPDX") |>
vapply(expansions, FUN.VALUE = character(1), FUN = function(x) {x[["SPDX"]]}) |>

@llrs
Copy link
Member

llrs commented May 26, 2025

I had some troubles checking this (building R from git repo didn't work well on my machine) and then I found Kurt had already patched R.
The sapply line ended up like:

spdx <- paste(unique(unlist(lapply(expansions, `[[`, "SPDX"),
use.names = FALSE)),
collapse = " OR ")

Congrats on the patch!

@eddelbuettel
Copy link

building R from git repo didn't work well on my machine

@ThierryO said the same in Mons. I should look into that again. My risk avoidance strategy of ... sticking with svn worked on the 'travel' laptop as it does here (and has for umpteen years) on the 'home' desktop/server.

@ThierryO
Copy link
Author

building R from git repo didn't work well on my machine

@ThierryO said the same in Mons. I should look into that again. My risk avoidance strategy of ... sticking with svn worked on the 'travel' laptop as it does here (and has for umpteen years) on the 'home' desktop/server.

I got it working now (on Ubuntu 24.04) with the script below

cd full_path_to_repo_root
sed -i.bak 's|$(GIT) svn info|./.github/scripts/svn-info.sh|' Makefile.in
./.github/scripts/wget-recommended.sh
./.github/scripts/svn-info.sh
CC=gcc
./configure --enable-R-shlib --with-blas --with-lapack --disable-java --prefix=/usr/local/lib/R-devel
make

@eddelbuettel
Copy link

@ThierryO That looks right. I have done it before too, and of course CI does it all the time. Thanks for documenting!

@llrs
Copy link
Member

llrs commented May 27, 2025

Thanks for the script @ThierryO I simply created a patch file and applied to the svn repo and continued there.
I asked Kurt about task 3 as we were talking about license issues on Bioconductor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants