Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New method for module installation #88

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

vandenman
Copy link
Contributor

start on new module install

now also uses local versions of indirect dependencies

expose argument option to record packages into lockfiles

also expose argument to update R package dependencies

tweak file listing to not be recurse if not needed, use cat instead of print

hash used in cache now also matches that in the lockfile

return 'success' and some tweaks to printing

fix missing file.path

set libPaths inside jaspBase

nvm that made no sense

revamp and refactor module installation

some progress

use explicit snapshot type

add clean=TRUE for restore

fix jasp-stats/INTERNAL-jasp#1891

start on unit tests for module installation

some work on the tests

tests now pass locally

remove unnecessary autogenerated comment

patch in symlink check for R <4.2.1

patch symlink check again

set copy.mode to FALSE

remove and ignore renv stuff

remove rlang as dependency and try to fix tests on windows

paths -> x, drop R 4.1.3

just use rlang again

use rlang::hash instead of tools::md5sum

just debug on gh actions

forgot to update one hash

Update rcmdcheck.yml

tempdir() -> withr::local_dir(), so separate tests use different folders

remove logging from hashes, add on test-failure info for windows about LF <=> CRLF
@@ -361,15 +364,648 @@ setupRenv <- function(moduleLibrary, modulePkg) {

Sys.setenv("RENV_PATHS_LIBRARY" = moduleLibrary)

print("Using the following paths:")
cat("Using the following paths:\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Now we can't see this in the log anymore when running a dynamic module install right?

Why would we want that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be visible in both? This code is, for now, intentionally not used when installing a dynamic module, so I'm not 100% sure though.

Copy link
Contributor

Choose a reason for hiding this comment

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

But I assume that later we will reuse this code also for dynamic modules right?

Those are going to be exactly the same after all, as the ones in jasp-desktop.

But im not sure what the gain is from changing them from print anyway?

Copy link
Contributor Author

@vandenman vandenman Oct 11, 2022

Choose a reason for hiding this comment

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

cat sometimes results in nicer output than print. For example:

> str <- "This is bad:\nbecause this\n"
> cat(str)
This is bad:
because this
> print(str)
[1] "This is bad:\nbecause this\n"

So with cat you can print with formatting like \n, \t, etc. With print it just prints \n and \t literally. Also, I checked and cat prints to stdout (or any other connection we provide).

#'
#' @return returns \code{NULL}.
#'
installModuleNew <- function(
Copy link
Contributor

Choose a reason for hiding this comment

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

This function is so large I think it would be good to have some comments in between breaking up the flow describing what each section does. Like "Here we are going to scan the lockfile" or something.
It would help me, and probably future you, out a lot.

Splitting it up in some descriptively named functions would also be a good way to solve this but I can imagine that would be a bit painful so I wont ask for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do!

@JorisGoosen
Copy link
Contributor

well this is one massive set of changes :o

Ive skimmed through it now only. Ill also try to build this together with jasp-desktop and see whether it works.
Im also going to look into installing dyanmic modules afterwards because that also has to keep working (insofar as it does)

@vandenman
Copy link
Contributor Author

Im also going to look into installing dyanmic modules afterwards because that also has to keep working (insofar as it does)

This is why I didn't delete any of the old code (yet). Dynamic modules still uses that. This only concerns the build process. I can also test this with dynamic modules immediately if you prefer, but I figured the current changes have gotten large enough 😅

@JorisGoosen
Copy link
Contributor

Im also going to look into installing dyanmic modules afterwards because that also has to keep working (insofar as it does)

This is why I didn't delete any of the old code (yet). Dynamic modules still uses that. This only concerns the build process. I can also test this with dynamic modules immediately if you prefer, but I figured the current changes have gotten large enough 😅

Yes which is good, the keeping of the old code that is, but there could still be problems with the links in the libraries in the build/install-folder. What could happen is that jaspBase or jaspModules library links to renv-cache get changed by renv to point to stuff in development-module-libraries or module installs... So we also need to test with that because I really dont want that stuff to break again. Maybe we could even make a unittest for that?

@JorisGoosen JorisGoosen force-pushed the master branch 2 times, most recently from 8b639a0 to 7bd7444 Compare March 20, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants