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

--without-sysreqs is not working? #184

Closed
eitsupi opened this issue Sep 12, 2023 · 7 comments · Fixed by #188
Closed

--without-sysreqs is not working? #184

eitsupi opened this issue Sep 12, 2023 · 7 comments · Fixed by #188
Labels
bug an unexpected problem or unintended behavior

Comments

@eitsupi
Copy link
Contributor

eitsupi commented Sep 12, 2023

#15 70.89 [INFO] Adding /usr/local/bin/R-4.3.1 -> /opt/R/4.3.1/bin/R
#15 70.89 [INFO] Adding R-release alias to R 4.3.1
#15 70.89 [INFO] Setting default CRAN mirror
#15 70.89 [INFO] Setting up P3M
#15 70.89 [INFO] Setting up automatic system requirements installation.

I noticed the above log even though I added the --without-sysreqs flag in the following location.
https://github.com/rocker-org/devcontainer-features/blob/69598501ac7fc591878b9e29ca8e730768c4fa10/src/r-rig/install.sh#L331

It seems --without-sysreqs does nothing?

rig/src/linux.rs

Lines 609 to 633 in 74bb252

fn set_sysreqs(vers: Option<Vec<String>>) -> Result<(), Box<dyn Error>> {
info!("Setting up automatic system requirements installation.");
let vers = match vers {
Some(x) => x,
None => sc_get_list()?,
};
let rcode = r#"
Sys.setenv(PKG_SYSREQS = "true")
Sys.setenv(PKG_SYSREQS2 = "true")
"#;
for ver in vers {
let ver = check_installed(&ver)?;
let path = Path::new(R_ROOT).join(ver.as_str());
let profile = path.join("lib/R/library/base/R/Rprofile".to_string());
if !profile.exists() {
continue;
}
append_to_file(&profile, vec![rcode.to_string()])?;
}
Ok(())
}

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Sep 12, 2023
@gaborcsardi
Copy link
Member

Yeah, it would actually need to set

PKG_SYSREQS="false"

because the default is true now in pak.

@eitsupi
Copy link
Contributor Author

eitsupi commented Sep 12, 2023

Yeah, it would actually need to set

PKG_SYSREQS="false"

because the default is true now in pak.

Thanks for the quick reply, I didn't know the default values of pak had changed.

I question the need to opt out of it.
Because I often see behavior like apt installing pandoc when the latest pandoc is already installed from GitHub.
(Probably not a problem in the US, but Ubuntu's default mirror is very slow where I live, so I don't want to install anything with apt if at all possible.)

@gaborcsardi
Copy link
Member

If you install pandoc from the deb package in their GH releases page, then pak should not update it.

@eitsupi
Copy link
Contributor Author

eitsupi commented Sep 12, 2023

If you install pandoc from the deb package in their GH releases page, then pak should not update it.

Yes, ideally. But perhaps not at this time.

> system("pandoc --version")
pandoc 3.1.1
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /home/vscode/.local/share/pandoc
Copyright (C) 2006-2023 John MacFarlane. Web:  https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
> pak::pak("rmarkdown")
✔ Loading metadata database ... doneWill install 29 packages.Will download 29 packages with unknown size.
+ base64enc     0.1-3  [dl]
+ bslib         0.5.1  [dl]
+ cachem        1.0.8  [dl]
+ cli           3.6.1  [dl]
+ digest        0.6.33 [dl]
+ ellipsis      0.3.2  [dl]
+ evaluate      0.21   [dl]
+ fastmap       1.1.1  [dl]
+ fontawesome   0.5.2  [dl]
+ fs            1.6.3  [dl] +make
+ glue          1.6.2  [dl]
+ highr         0.10   [dl]
+ htmltools     0.5.6  [dl]
+ jquerylib     0.1.4  [dl]
+ knitr         1.44   [dl] +pandoc
+ lifecycle     1.0.3  [dl]
+ magrittr      2.0.3  [dl]
+ memoise       2.0.1  [dl]
+ mime          0.12   [dl]
+ R6            2.5.1  [dl]
+ rappdirs      0.3.3  [dl]
+ rmarkdown     2.24   [dl] +pandoc
+ sass          0.4.7  [dl] +make
+ stringi       1.7.12 [dl] +libicu-dev
+ stringr       1.5.0  [dl]
+ tinytex       0.46   [dl]
+ vctrs         0.6.3  [dl]
+ xfun          0.40   [dl]
+ yaml          2.3.7  [dl]
→ Will install 1 system package:

@gaborcsardi
Copy link
Member

This is what I see:

root@47d274b2de55:~# curl -LO https://github.com/jgm/pandoc/releases/download/3.1.8/pandoc-3.1.8-1-arm64.deb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 31.8M  100 31.8M    0     0  19.9M      0  0:00:01  0:00:01 --:--:-- 35.8M
root@47d274b2de55:~# apt install ./pandoc-3.1.8-1-arm64.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'pandoc' instead of './pandoc-3.1.8-1-arm64.deb'
Suggested packages:
  texlive-latex-recommended texlive-xetex texlive-fonts-recommended
The following NEW packages will be installed:
  pandoc
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 0 B/33.4 MB of archives.
After this operation, 162 MB of additional disk space will be used.
Get:1 /root/pandoc-3.1.8-1-arm64.deb pandoc arm64 3.1.8-1 [33.4 MB]
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package pandoc.
(Reading database ... 33237 files and directories currently installed.)
Preparing to unpack /root/pandoc-3.1.8-1-arm64.deb ...
Unpacking pandoc (3.1.8-1) ...
Setting up pandoc (3.1.8-1) ...

and then pak does not touch pandoc:

root@47d274b2de55:~# R -q -e 'pak::pkg_install("knitr?reinstall")'
> pak::pkg_install("knitr?reinstall")
✔ Loading metadata database ... done

→ Will install 1 package.
→ The package (895.05 kB) is cached.
+ knitr   1.44 [bld] + ✔ pandoc
✔ All system requirements are already installed.

ℹ No downloads are needed, 1 pkg (895.05 kB) is cached
ℹ Building knitr 1.44
✔ Built knitr 1.44 (318ms)
✔ Installed knitr 1.44  (43ms)
✔ 1 pkg + 4 deps: kept 4, added 1 [2.2s]

@eitsupi
Copy link
Contributor Author

eitsupi commented Sep 16, 2023

Thanks for letting me know that pak works well with the deb package.
I had created a simlink to the pandoc bundled with RStudio to make the pandoc command executable.
This is a special case and may not be of much concern, but I recall that cargo and rustc installed via rustup were also ignored.

@gaborcsardi
Copy link
Member

gaborcsardi commented Sep 16, 2023

Yes, system requirements use the packages of the distro. If you tend to install software other ways, then it is indeed best to opt out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants