Skip to content

update CRAN R packages#28786

Merged
adamjstewart merged 6 commits intospack:developfrom
glennpj:r_updates/CRAN
Feb 21, 2022
Merged

update CRAN R packages#28786
adamjstewart merged 6 commits intospack:developfrom
glennpj:r_updates/CRAN

Conversation

@glennpj
Copy link
Copy Markdown
Contributor

@glennpj glennpj commented Feb 4, 2022

This PR does a sweep of CRAN R packages in Spack, and does the following:

  • add new versions of packages if available
  • make sure the cran attribute is set
  • add new packages as required

Due to adding the cran attribute, almost all R CRAN packages had
changes. Since almost all packages were being touched, I also tried to
standardize the formatting of the packages.

  • make sure there is a short and long description
  • have dependencies specified in the same order as in the DESCRIPTION
    file
  • place when directives at the end

Having consistency makes it easier to process these in bulk. The process
is script driven but requires interaction. I am hopeful that the
consistent formatting will allow for further automation.

All of the packages in this PR were built with gcc-10.3.0 prior to
submitting the PR.

This PR does a sweep of CRAN R packages in Spack, and does the following:

- add new versions of packages if available
- make sure the `cran` attribute is set
- add new packages as required

Due to adding the `cran` attribute, almost all R CRAN packages had
changes. Since almost all packages were being touched, I also tried to
standardize the formatting of the packages.

- make sure there is a short and long description
- have dependencies specified in the same order as in the DESCRIPTION
  file
- place `when` directives at the end

Having consistency makes it easier to process these in bulk. The process
is script driven but requires interaction. I am hopeful that the
consistent formatting will allow for further automation.

All of the packages in this PR were built with gcc-10.3.0 prior to
submitting the PR.
@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Feb 4, 2022

Audit checks will fail if the r dependency is a version less than the lowest version in Spack's r package. Since the spec is for such an ancient version, it is probably best to just remove those dependencies, as any r in spack would work.

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Feb 4, 2022

Looks like I need to find UTF-8 characters to pass the python-2.7 test.

The oldest R version in Spack is 3.1.2. Any dependency spec for a
version older than that will fail the github audit test.
These formed after the previous edit to remove old r dependencies.
@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Feb 4, 2022

I am not sure how to interpret this audit test failure:

PKG-DIRECTIVES: 1 issue found
1. Generic error in conflict for package "r-rgdal": 
    proj does not satisfy gdal
Error: Process completed with exit code 1.

The following is in the package:

    version('1.5-28', sha256='7f54432cfa8c0db463f68e8856c3ca0a90671dc841ac5203af049eb318e261a2')                                            
    version('1.5-19', sha256='6fbfd71b19e7b8d9dbddc91cb1eef8890c74a1e2bf8f619da165ff51bf1231b2')                                            
    version('1.5-18', sha256='53467c19bc93d8ea311458eaa281c8c456168ab75e84d76ef5cc6c00f53122df')                                            
    version('1.4-4',  sha256='2532e76e0af27d145f799d70006a5dbecb2d3be698e3d0bbf580f4c41a34c5d7')                                            
    version('1.3-9',  sha256='3e44f88d09894be4c0abd8874d00b40a4a5f4542b75250d098ffbb3ba41e2654')                                            
    version('1.2-16', sha256='017fefea4f9a6d4540d128c707197b7025b55e4aff98fc763065366b025b03c9')                                            
                                                                                                                                            
    depends_on('[email protected]:', type=('build', 'run'))                                                                                           
    depends_on('[email protected]:', type=('build', 'run'), when='@1.5:')                                                                             
    depends_on('[email protected]:', type=('build', 'run'))                                                                                        
    depends_on('[email protected]:')                                                                                                              
    depends_on('[email protected]:5', when='@:1.3-9')                                                                                              
    depends_on('[email protected]:', when='@1.4-2:')                                                                                               
                                                                                                                                            
    conflicts('proj@:5', when='gdal@3:')                                                                                                    
    conflicts('proj@6:', when='gdal@:2')

This concretizes and builds but the audit test does not like those conflicts.

Update: I am missing the ^ for the specs, but should the spack parser catch that at concretization time?

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Feb 17, 2022

@spackbot run pipeline

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Feb 17, 2022

I've started that pipeline for you!

@adamjstewart
Copy link
Copy Markdown
Member

Audit checks will fail if the r dependency is a version less than the lowest version in Spack's r package. Since the spec is for such an ancient version, it is probably best to just remove those dependencies, as any r in spack would work.

This should only be true if the package requires a specific version like depends_on('[email protected]') and that version doesn't exist in the package. It shouldn't affect version ranges like depends_on('[email protected]:').

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Feb 21, 2022

This should only be true if the package requires a specific version like depends_on('[email protected]') and that version doesn't exist in the package. It shouldn't affect version ranges like depends_on('[email protected]:').

Yep, I misread the test results. I reverted that change and fixed the package that triggered it.

Copy link
Copy Markdown
Member

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

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

Scrolled through about half of them, LGTM. Some of the new docstrings look a bit long, but I'll let you decide what to use. I like the consistency. Also, not sure if it's better to use the CRAN page as the homepage or the URLs listed on that page that the developers chose. For PyPI, I usually prefer the latter.

Someday I would love to add the update script you use directly to Spack. People have asked for similar things to autogenerate packages for CMake and PyPI but those build systems are much less uniform than R.

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Feb 21, 2022

Also, not sure if it's better to use the CRAN page as the homepage or the URLs listed on that page that the developers chose.

I decided to use the canonical CRAN "homepage". This makes things more internally consistent with CRAN packages as well as with BioConductor packages, which have a similar scheme, although a different portal.

@kinh-nguyen
Copy link
Copy Markdown
Contributor

Hi, it worked before but today creating a new environment and reinstall r-sf the r-units causes the error. Would it be related to this update?

==> Installing r-units-0.7-2-gypq7s4gl53lmoz6dlykn5y63c7dcpg5
==> No binary for r-units-0.7-2-gypq7s4gl53lmoz6dlykn5y63c7dcpg5 found: installing from source
==> Error: FetchError: All fetchers failed for spack-stage-r-units-0.7-2-gypq7s4gl53lmoz6dlykn5y63c7dcpg5

/home/user/spack/lib/spack/spack/package.py:1400, in do_fetch:
       1397
       1398        self.stage.create()
       1399        err_msg = None if not self.manual_download else self.download_instr
  >>   1400        start_time = time.time()
       1401        self.stage.fetch(mirror_only, err_msg=err_msg)
       1402        self._fetch_time = time.time() - start_time
       1403

@adamjstewart
Copy link
Copy Markdown
Member

I can reproduce this too, no idea what could be causing this to fail.

@kinh-nguyen
Copy link
Copy Markdown
Contributor

I think because units has a new version? I can install with my repo after adding the new one.

@adamjstewart
Copy link
Copy Markdown
Member

But we should be using list_url as a backup for all packages

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Feb 26, 2022

It seems like issues with list_url have gotten more frequent lately. I typically work with a local mirror so probably not seeing it. Unfortunately, R relies on list_url. I will poke at this over the next few days.

bvanessen pushed a commit to bvanessen/spack that referenced this pull request Mar 2, 2022
@JSquar
Copy link
Copy Markdown
Contributor

JSquar commented Mar 18, 2022

I think because units has a new version? I can install with my repo after adding the new one.

I tried to install r-terra , which also has a new version available (1.5.21), which is not integrated in the package (1.5.17), yet. But the fetch step does not consider this and tries to get sources from https://cloud.r-project.org/src/contrib/terra_1.5-17.tar.gz, which does not exist anymore, since old versions are archived in https://cran.r-project.org/src/contrib/Archive/terra/.

@glennpj
Copy link
Copy Markdown
Contributor Author

glennpj commented Mar 19, 2022

@JSquar This should be fixed now that #29258 has been merged.

@JSquar
Copy link
Copy Markdown
Contributor

JSquar commented Mar 19, 2022

@glennpj Tried it, works fine now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants