Skip to content

upgrade doesn't update activate.R in 1.0.5 #1837

@hutch3232

Description

@hutch3232

Hi @kevinushey, thanks as always for the amazing renv package! I tried using renv::upgrade to go from 1.0.4 to 1.0.5 this morning and encountered this issue:

# no renv.lock

> renv::upgrade()
A new version of the renv package will be installed:

# CRAN -----------------------------------------------------------------------
- renv   [* -> 1.0.5]

This project will use the newly-installed version of renv.

Do you want to proceed? [Y/n]: y

# Installing packages --------------------------------------------------------
- Installing renv ...                           OK [linked from cache]
- Lockfile written to "/mnt/code/renv.lock".
- Updating activate script

Restarting R session...

renv 1.0.5 was loaded from project library, but this project is configured to use renv 1.0.4.
- Use `renv::record("[email protected]")` to record renv 1.0.5 in the lockfile.
- Use `renv::restore(packages = "renv")` to install renv 1.0.4 into the project library.
- Project '/mnt/code' loaded. [renv 1.0.5]
- The project is out-of-sync -- use `renv::status()` for details.


# with renv.lock and status up to date

> renv::upgrade()
A new version of the renv package will be installed:

# CRAN -----------------------------------------------------------------------
- renv   [1.0.4 -> 1.0.5]

This project will use the newly-installed version of renv.

Do you want to proceed? [Y/n]: y

# Installing packages --------------------------------------------------------
- Installing renv ...                           OK [linked from cache]
- Lockfile written to "/mnt/code/renv.lock".
- Updating activate script

Restarting R session...

# at this point I received this RStudio error/popup/modal
# (Error: Save File) Error occurred during transmission (OK)

renv 1.0.5 was loaded from project library, but this project is configured to use renv 1.0.4.
- Use `renv::record("[email protected]")` to record renv 1.0.5 in the lockfile.
- Use `renv::restore(packages = "renv")` to install renv 1.0.4 into the project library.
- Project '/mnt/code' loaded. [renv 1.0.5]

The fix was very simple. I just ran renv::activate() and it then changed the one line in renv/activate.R to reflect the new version number. Then I ran renv::snapshot() to cleanup the renv record, but this latter behavior is not new to 1.0.5, I've always needed to do that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions