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

[BUG] #982

Open
campbead opened this issue Feb 5, 2023 · 2 comments
Open

[BUG] #982

campbead opened this issue Feb 5, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@campbead
Copy link

campbead commented Feb 5, 2023

Describe the bug
add_dockerfile_with_renv_shinyproxy() fails when working directory is not same as the golem project directory, even when supplying source_folder.

To Reproduce

  1. create a new golem project golem.dummy in folder DUMMY_FOLDER
  2. setwd("~")
  3. run golem::add_dockerfile_with_renv_shinyproxy(source_folder = DUMMY_FOLDER)

Expected behavior
Expect to produce temporary deploy folder and files when using the source_folder flag. This works when the working directory is the same as DUMMY_FOLDER and running:
golem::add_dockerfile_with_renv_shinyproxy(source_folder = DUMMY_FOLDER)

Screenshots
Screenshot 2023-02-06 114112

@campbead campbead added the bug Something isn't working label Feb 5, 2023
@VincentGuyader
Copy link
Member

hi,

what was your getwd() when you tried this ?

@ColinFay
Copy link
Member

ColinFay commented Feb 6, 2023

Here is a reprex :

colinfay@Colins-MBP ~ % cd /tmp 

colinfay@Colins-MBP /tmp % Rscript -e "golem::create_golem('pouet')"
── [.Rprofile] Sourcing user-wide rprofile ─────────────────────────────────────
── Checking package name ───────────────────────────────────────────────────────
✔ Valid package name
── Creating dir ────────────────────────────────────────────────────────────────
✔ Creating 'pouet/'
✔ Setting active project to '/private/tmp/pouet'
✔ Creating 'R/'
✔ Writing a sentinel file '.here'
• Build robust paths within your project via `here::here()`
• Learn more at <https://here.r-lib.org>
✔ Setting active project to '<no active project>'
File .here already exists in /private/tmp/pouet
✔ Created package directory
── Copying package skeleton ────────────────────────────────────────────────────
✔ Copied app skeleton
── Running project hook function ───────────────────────────────────────────────
✔ All set
✔ Setting active project to '/private/tmp/pouet'
── Done ────────────────────────────────────────────────────────────────────────
A new golem named pouet was created at pouet .
To continue working on your app, start editing the 01_start.R file.

colinfay@Colins-MBP /tmp % pwd
/tmp

colinfay@Colins-MBP /tmp % cd ~ 

colinfay@Colins-MBP ~ % Rscript -e "golem::add_dockerfile_with_renv_shinyproxy(source_folder = '/tmp/pouet')"
── [.Rprofile] Sourcing user-wide rprofile ─────────────────────────────────────
You set `document = TRUE` and you did not pass your own renv.lock file,
as a consequence {golem} will use `attachment::att_amend_desc()` to update your 
DESCRIPTION file before creating the renv.lock file

you can set `document = FALSE` to use your actual DESCRIPTION file,
or pass you own renv.lock to use, using the `lockfile` parameter

In any case be sure to have no Error or Warning at `devtools::check()`
Loading required namespace: rstudioapi
Updating pouet documentation
Setting `RoxygenNote` to "7.2.3"
ℹ Loading pouet
Writing NAMESPACE
Writing NAMESPACE
Writing run_app.Rd
ℹ Loading pouet
All required packages are installed
✔ create renv.lock at /var/folders/9w/zdlv83ws6csdjnfc5x819gtr0000gn/T/RtmpabnvVw/deploy/renv.lock.prod
The following package(s) will be updated in the lockfile:

# CRAN ===============================
- R6            [* -> 2.5.1]
- Rcpp          [* -> 1.0.10]
- attempt       [* -> 0.3.1]
- base64enc     [* -> 0.1-3]
- bslib         [* -> 0.4.2]
- cachem        [* -> 1.0.6]
- cli           [* -> 3.6.0]
- commonmark    [* -> 1.8.1]
- config        [* -> 0.3.1]
- crayon        [* -> 1.5.2]
- digest        [* -> 0.6.31]
- ellipsis      [* -> 0.3.2]
- fastmap       [* -> 1.1.0]
- fontawesome   [* -> 0.5.0]
- fs            [* -> 1.6.0]
- glue          [* -> 1.6.2]
- here          [* -> 1.0.1]
- htmltools     [* -> 0.5.4]
- httpuv        [* -> 1.6.8]
- jquerylib     [* -> 0.1.4]
- jsonlite      [* -> 1.8.4]
- later         [* -> 1.3.0]
- lifecycle     [* -> 1.0.3]
- magrittr      [* -> 2.0.3]
- memoise       [* -> 2.0.1]
- mime          [* -> 0.12]
- promises      [* -> 1.2.0.1]
- rappdirs      [* -> 0.3.3]
- remotes       [* -> 2.4.2]
- rlang         [* -> 1.0.6]
- rprojroot     [* -> 2.0.3]
- sass          [* -> 0.4.5]
- shiny         [* -> 1.7.4]
- sourcetools   [* -> 0.1.7-1]
- withr         [* -> 2.5.0]
- xtable        [* -> 1.8-4]
- yaml          [* -> 2.3.7]

# Local ==============================
- golem         [* -> 0.4.0]

The version of R recorded in the lockfile will be updated:
- R             [*] -> [4.2.2]

* Lockfile written to '/var/folders/9w/zdlv83ws6csdjnfc5x819gtr0000gn/T/RtmpabnvVw/deploy/renv.lock.prod'.
ℹ Please wait while we compute system requirements...
Fetching system dependencies for 38 package records.
✔ Done
Error in get_current_config(path) : 
  The golem-config.yml file doesn't exist.
Calls: <Anonymous> ... <Anonymous> -> get_golem_things -> get_current_config
Execution halted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants