Opened 5 months ago

Last modified 5 months ago

#68844 assigned enhancement

Several R ports: noarch?

Reported by: jmroot (Joshua Root) Owned by: barracuda156
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: R-StanHeaders R-mathjaxr R-memoise R-mixl R-rapidjsonr R-reshape R-semds R-taber R-yahoofinancer

Description

This port doesn't appear to install any Mach-O files. That would usually mean it should set supported_archs noarch, unless it's doing something unusual like storing architecture-specific information in other kinds of files. If it doesn't install materially different files on different OS versions, it should also set platforms {darwin any}.

Change History (9)

comment:1 Changed 5 months ago by jmroot (Joshua Root)

Port: R-mathjaxr R-memoise R-mixl R-rapidjsonr R-reshape R-semds R-taber R-yahoofinancer added
Summary: R-StanHeaders: noarch?Several R ports: noarch?

Same question for several other R ports actually.

comment:2 in reply to:  1 ; Changed 5 months ago by barracuda156

Replying to jmroot:

Same question for several other R ports actually.

I am generally relying on CRAN info (which apparently just parses DESCRIPTION file from the source): it says whether compilation is needed or not. For example, mathjaxr is supposed to have compilable files: https://cran.r-project.org/web/packages/mathjaxr/index.html And indeed, upstream repo has src folder (which carries non-R sources, normally C/C++/Fortran): https://github.com/wviechtb/mathjaxr It is surprising if it does not install anything of those.

I did see a few cases where CRAN info was inaccurate, perhaps due to developers being careless and not specifying that a package is R-only. So it is not 100% reliable.

I have no idea whether R packages install non-identical R files across OS versions and platforms and whether that is always consistent. If someone could confirm that is strictly the case, adding a line for platforms won’t be hard, as long as noarch always implies {darwin any}.

comment:3 in reply to:  2 Changed 5 months ago by jmroot (Joshua Root)

Replying to barracuda156:

I am generally relying on CRAN info (which apparently just parses DESCRIPTION file from the source): it says whether compilation is needed or not. For example, mathjaxr is supposed to have compilable files: https://cran.r-project.org/web/packages/mathjaxr/index.html And indeed, upstream repo has src folder (which carries non-R sources, normally C/C++/Fortran): https://github.com/wviechtb/mathjaxr It is surprising if it does not install anything of those.

What I know is simply that the darwin_22.x86_64 archive does not contain any files starting with a Mach-O magic number. If there is compiled code that is supposed to be installed but isn't, I guess that's a slightly different problem.

I did see a few cases where CRAN info was inaccurate, perhaps due to developers being careless and not specifying that a package is R-only. So it is not 100% reliable.

MacPorts 2.9 will check for this kind of problem when you run port test, so that should hopefully make it easier to notice.

I have no idea whether R packages install non-identical R files across OS versions and platforms and whether that is always consistent. If someone could confirm that is strictly the case, adding a line for platforms won’t be hard, as long as noarch always implies {darwin any}.

One is not a necessary or sufficient condition for the other, unfortunately. A simple example of a port that is noarch but installs different files on different OS version is gcc_select.

But both do tend to be applicable for ports that just install scripts.

comment:4 Changed 5 months ago by barracuda156

By the way, is there some automatic way to find out which R ports currently are not set to be noarch, but do not install Mach-O files?

comment:5 Changed 5 months ago by jmroot (Joshua Root)

If the port is installed you can run this: https://github.com/macports/macports-contrib/blob/master/noarch_check/noarch_check.tcl

Any method will have to either download the archive or build the port locally.

comment:6 in reply to:  1 Changed 5 months ago by barracuda156

Replying to jmroot:

Same question for several other R ports actually.

Specifically R-StanHeaders is not an R-only port, it compiles stuff and installs libStanHeaders.a.

comment:7 Changed 5 months ago by jmroot (Joshua Root)

Ah, that makes sense since a static lib is an archive that does not itself start with a mach-o header. It doesn't look like the rest of these ports are installing any .a files.

comment:8 in reply to:  7 Changed 5 months ago by barracuda156

Replying to jmroot:

Ah, that makes sense since a static lib is an archive that does not itself start with a mach-o header. It doesn't look like the rest of these ports are installing any .a files.

Yes, others do not seem to compile anything (in some cases it is an omission on my side, in other CRAN description is misleading).

I am not sure about R-mixl: it runs a check for OpenMP support and presumably uses the result somewhere in its files: https://github.com/joemolloy/fast-mixed-mnl/blob/master/src/Makefile While currently our default compilers support OpenMP across the board, I think, it needs not be the case in general. So perhaps it can be arch-dependent (if compiler choice is changed in a way affecting OpenMP support).

comment:9 Changed 5 months ago by barracuda156

In 97ce28d53aa9e0b5a4e78e13d9057f9f3c111079/macports-ports (master):

R-yahoofinancer: mark as noarch

See: #68844

  1. S. The same PR marks remaining ones as noarch too, aside of R-StanHeaders and R-mixl.
Last edited 5 months ago by barracuda156 (previous) (diff)
Note: See TracTickets for help on using tickets.