Skip to content

update: libxlsxwriter 1.2.4 with upstream directory structure#103

Merged
billdenney merged 3 commits into
masterfrom
update/libxlsxwriter-1.2.4
Apr 8, 2026
Merged

update: libxlsxwriter 1.2.4 with upstream directory structure#103
billdenney merged 3 commits into
masterfrom
update/libxlsxwriter-1.2.4

Conversation

@billdenney

Copy link
Copy Markdown
Collaborator

Restructure vendored libxlsxwriter source to mirror the upstream distribution layout under src/libxlsxwriter/:
src/libxlsxwriter/src/ (was src/libxlsxwriter/)
src/libxlsxwriter/include/ (was src/include/)
src/libxlsxwriter/third_party/ (was src/md5/, src/minizip/, src/tmpfileplus/)

This makes future updates a simple copy of the src/, include/, and third_party/ directories from the upstream tarball. Update src/Makevars with the new paths and add src/libxlsxwriter/**/Makefile* to .gitignore so upstream Makefiles are not tracked (they trigger R CMD check warnings about GNU extensions and are not used by the R build).

Restructure vendored libxlsxwriter source to mirror the upstream
distribution layout under src/libxlsxwriter/:
  src/libxlsxwriter/src/         (was src/libxlsxwriter/)
  src/libxlsxwriter/include/     (was src/include/)
  src/libxlsxwriter/third_party/ (was src/md5/, src/minizip/, src/tmpfileplus/)

This makes future updates a simple copy of the src/, include/, and
third_party/ directories from the upstream tarball. Update src/Makevars
with the new paths and add src/libxlsxwriter/**/Makefile* to .gitignore
so upstream Makefiles are not tracked (they trigger R CMD check warnings
about GNU extensions and are not used by the R build).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jeroen

jeroen commented Apr 8, 2026

Copy link
Copy Markdown
Member

Be careful of adding extra files that we do not need (e.g. all the minizip stuff), because you will have to comply with licensing and declare copyright of everything included in the package, even if the files are not used at all.

@billdenney

Copy link
Copy Markdown
Collaborator Author

@jeroen, Thank you for that note/warning. I'll cull the parts that we're not using and add them to .gitignore.

billdenney and others added 2 commits April 8, 2026 14:45
dtoa is included in the upstream libxlsxwriter distribution but is not
compiled by the R package — only its header (emyg_dtoa.h) is vendored
via src/libxlsxwriter/include/xlsxwriter/third_party/. Remove the
source directory and add it to .gitignore so it stays absent after
future upstream copy-in updates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…icense.txt

Vendor src/libxlsxwriter/License.txt from the upstream tarball (more
complete and up-to-date than the old inst/COPYRIGHT) and replace
inst/COPYRIGHT with a git symlink pointing to it. This way future
libxlsxwriter updates automatically keep the license current. Also
note inst/COPYRIGHT in LICENSE for discoverability.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@billdenney

Copy link
Copy Markdown
Collaborator Author

I changed the COPYRIGHT file to be a symlink to the libxlsxwriter license file so that we will remain constantly up to date. I think that as long as the R build process works with that (currently running), it should be a perpetual solution.

@billdenney billdenney merged commit 5aed264 into master Apr 8, 2026
10 checks passed
@billdenney billdenney deleted the update/libxlsxwriter-1.2.4 branch April 8, 2026 15:58
@jeroen

jeroen commented Apr 8, 2026

Copy link
Copy Markdown
Member

That does not suffice for CRAN, they will grep for all files in the package with a line Copyright in the headers and then you have to name all those entities in the authors part of DESCRIPTION. It is really easier to not ship redundant stuff with the releases....

@jeroen

jeroen commented Apr 8, 2026

Copy link
Copy Markdown
Member

Also symlinks do not work on all Windows systems...

@billdenney

Copy link
Copy Markdown
Collaborator Author

I verified that the symlink works as expected on my Windows computer. (git for Windows handles symlinks.)

In #101, I've fixed it so that there is a Copyright field similar to RcppEigen.

All of the current third-party included directories (after I removed dtoa) were in the previous release, so there is nothing new included as a separate third party, but there were additional files in that directory. I will resolve that momentarily.

@jeroen

jeroen commented Apr 8, 2026

Copy link
Copy Markdown
Member

I verified that the symlink works as expected on my Windows computer. (git for Windows handles symlinks.)

IIRC, problems would appear on Windows when extracting a tar.gz file that contains symlinks. So I think it's better to not put them into the R source package.

@billdenney

billdenney commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator Author

I just verified that R CMD build dereferences symlinks automatically. So, it's not a symlink in the source package; it's a regular file. The reason I'd like to keep it is that a symlink automatically keeps us license-compliant and at least according to CRAN policies is compliant there, too.

@jeroen

jeroen commented Apr 9, 2026

Copy link
Copy Markdown
Member

I just verified that R CMD build dereferences symlinks automatically. So, it's not a symlink in the source package; it's a regular file.

Okay I did not know that. According to the docs, the default for tar is to embed the symlink unless you pass the -h flag, but I do not see R doing that.

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.

2 participants