From c@@rd|@g@bor @end|ng |rom gm@||@com  Tue Feb  8 18:07:31 2022
From: c@@rd|@g@bor @end|ng |rom gm@||@com (=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=)
Date: Tue, 8 Feb 2022 18:07:31 +0100
Subject: [Rd] S4 class name conflicts
In-Reply-To: <CAOQ5Nyd5mJFo6yYHVh8X1OTQNh2u3GHQtTVaUuOxbwBTc3XcGA@mail.gmail.com>
References: <CABtg=KmbgbS7rxQyTn++ytLD8S+apAv3zCC1rz3eYtqPPo-thw@mail.gmail.com>
 <CAOQ5Nyd5mJFo6yYHVh8X1OTQNh2u3GHQtTVaUuOxbwBTc3XcGA@mail.gmail.com>
Message-ID: <CABtg=K=0-j86zTErM08uS1j9v6BfjESygvEVEQCfauEGDKsQew@mail.gmail.com>

Hi Michael,

you only need the CRAN versions. You probably need a recent version of
pillar, to
create the name conflict with its dependency:

install.packages("pillar")
install.packages("cli")
install.packages("RNeXML", type = "source")

This will already give you:
** byte-compile and prepare package for lazy loading
Found more than one class "tree" in cache; using the first, from namespace 'cli'
Also defined by ?RNeXML?

and then:

library(RNeXML)
unloadNamespace("RNeXML")

Error in .mergeMethodsTable(generic, mtable, tt, attach) :
  trying to get slot "defined" from an object of a basic class
("environment") with no slots

This is macOS arm64, but looking at the CRAN check page, that should not matter.

Let me know if this does not work, and the I'll create a Docker
container or something more reproducible.

Thanks,
Gabor

On Tue, Feb 8, 2022 at 5:53 PM Michael Lawrence
<lawrence.michael at gene.com> wrote:
>
> Hi Gabor,
>
> Thanks for reporting this issue. Would you be able to help me
> reproduce it? I'm guessing this depends on some combination of git
> checkouts, so it would be helpful to know which.
>
> Michael
>
> On Tue, Feb 8, 2022 at 6:32 AM G?bor Cs?rdi <csardi.gabor at gmail.com> wrote:
> >
> > The RNeXML CRAN package currently has some check warnings, originating
> > from an S4 class name conflict.
> >
> > RNeXML sets the S4 class "tree". A dependency of the package now
> > depends on the cli package, which calls setOldClass() on an S3 "tree"
> > class.
> >
> > This causes two potential issues. One is that RNeXML maybe ends up
> > using cli's class internally, because this is what we see at install
> > time:
> >
> > ** byte-compile and prepare package for lazy loading
> > Found more than one class "tree" in cache; using the first, from namespace 'cli'
> > Also defined by ?RNeXML?
> >
> > The second issue is an error when RNeXML is unloaded:
> >
> > ? unloadNamespace("RNeXML")
> > Error in .mergeMethodsTable(generic, mtable, tt, attach) :
> >   trying to get slot "defined" from an object of a basic class
> > ("environment") with no slots
> >
> > This makes R CMD check fail as well.
> >
> > Is cli doing something wrong here? Or is this a bug in base R? Or is
> > it a known limitation? If the latter, would it make sense for the
> > RNeXML installation to fail instead of creating a broken package. (If
> > it is a broken package at all.)
> >
> > Gabor
> >
> > ______________________________________________
> > R-devel at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
>
>
>
> --
> Michael Lawrence
> Principal Scientist, Director of Data Science and Statistical Computing
> Genentech, A Member of the Roche Group
> Office +1 (650) 225-7760
> michafla at gene.com
>
> Join Genentech on LinkedIn | Twitter | Facebook | Instagram | YouTube



[Rd] S4 class name conflicts
=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=