[Rd] recent changes to r-devel with package date checking?

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Fri Mar 27 13:42:44 CET 2026


On 27 March 2026 at 11:37, Ivan Krylov wrote:
| On Thu, 26 Mar 2026 20:46:46 -0500
| Dirk Eddelbuettel <edd using debian.org> wrote:
| 
| > Are we really only talking about parsing an RFC 822 date into an ISO
| > date or is there more going here? If it is this, why can the date
| > (coming in with a regularized format) not be converted as needed?
| 
| R needs the "Built" date to differ between binary builds of the same
| version of the source package for approximately the same purpose as why
| the +b1 suffix is added to version numbers in Debian when rebuilding
| without changing the source. R uses the date as a proxy for
| binary-level dependencies (e.g. cached S4 classes [1] or ABI issues
| with LinkingTo [2]) that "disappear" upon re-installation from source.

Ok, now things slowly fall into place. I may have missed / skipped earlier
parts. We are talking about a timestamp R uses and stores in the Built field
in DESCRIPTION, correct?  Which, when a common timestamp is used / imposed,
comes via the --built-timestamp option.

| Interestingly, Debian rules for binNMUs [3] seem to fulfil this already:
| 
| > The only file in the source package which is modified by the binNMU
| > is debian/changelog, which gets a new entry for the new version.
| 
| In other words, when a binNMU happens, the Built: date is updated,
| which is what R cares about.
| 
| So, e.g., r-cran-libcoin (1.0-9-1+b1) in bookworm has
| 
| Built: R 4.2.1; x86_64-pc-linux-gnu; 'Sun, 18 Sep 2022 22:43:49 +0000'; unix
| 
| with the binNMU timestamp from changelog.Debian.amd64 and not the
| source package timestamp from changelog.Debian.

Perfect. That is the missing link.

| Actually, I see this
| for all r-cran-* packages with binNMUs that I have installed:
| 
| dpkg -l | \
|  awk '
|   ($1=="ii" && $2 ~ /^r-cran-/ && $3 ~ /\+b/){
|    sub("r-cran-","",$2); print $2
|   }
|  ' | while read pkg; do
|   srcDate=$(dpkg-parsechangelog \
|    -l /usr/share/doc/r-cran-"$pkg"/changelog.Debian.gz -S Date)
|   binDate=$(dpkg-parsechangelog \
|    -l /usr/share/doc/r-cran-"$pkg"/changelog.Debian.amd64.gz -S Date)
|   pkgDesc=$(dpkg -L r-cran-"$pkg" | grep '/DESCRIPTION$')
|   grep -q "^Built:.*$srcDate" $pkgDesc && echo "$pkg has source date"
|   grep -q "^Built:.*$binDate" $pkgDesc && echo "$pkg has binary date"
| done
| 
| So, while Simon's fix in r89726 avoided the immediate breakage, the
| dates patched in by the Debian build system should be safe to use as
| well. r-cran.mk would just need to use something like:
| 
| builttime := $(shell dpkg-parsechangelog -l$(CURDIR)/debian/changelog -S Timestamp)
| builttimeR := $(shell date -u -d @$(builttime) +"%Y-%m-%d %H:%M:%S UTC")
| builttimeStamp := "--built-timestamp=\"$(builttimeR)\""
| 
| instead of the RFC 5322 format.

Very good but we a) would need this in 'R.pm' inside the dh-r package
providing the 'R' plugin all (!!) r-(cran|bioc)-* packages use via the
standard file debian/rules reduced to this

    %:
  	    dh $@ --buildsystem R

That said, given that R's use in very recent version changed, could / should
the parsing happen when R receives tbe value from the Debian changelog? If I
start from, say, my most recent Matrix changelog time of

    Sat, 21 Mar 2026 12:24:09 -0500

should be parseable with base R too via e.g

    > ts <- "Sat, 21 Mar 2026 12:24:09 -0500"
    > strptime(ts, "%a, %d %b %Y %T %z", tz="UTC")
    [1] "2026-03-21 17:24:09 UTC"
    > 

and given the proper read this should be expressable in whatever format
DESCRIPTION::Built needs.  As you demonstrated above the binary porters
already switch to the correct (updated) timestamp.

So could R not convert it as needed?  This may be a simpler code path
change. OTOH if we only care about new build then getting a patch into dh-r
should be viable. Perl-writing volunteers welcome :) )

Thanks for all the additional context, Ivan. I really appreciate it.

Cheers, Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-devel mailing list