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

autodep regression by #2321 #2344

Open
3 tasks done
heavywatal opened this issue May 28, 2024 · 4 comments
Open
3 tasks done

autodep regression by #2321 #2344

heavywatal opened this issue May 28, 2024 · 4 comments
Assignees

Comments

@heavywatal
Copy link

The option autodep=TRUE does not work since #2321 even with the simplest example as follows:

```{r, setup}
knitr::opts_chunk$set(cache = TRUE)
knitr::opts_chunk$set(autodep = TRUE)
```

```{r, src}
x = 1
```

```{r, dst}
y = 10 * x
y
```

Modifying x in src chunk should invalidate the cache of the dependent chunk dst, but is ignored in the latest version. I have tried different versions with pak::pkg_install("yihui/knitr"). Here are the results:

  • OK: "yihui/knitr@v1.45"
  • OK: "yihui/knitr@74bcff85455a9f92a3099abecba1a8d70ab0cfa4" 74bcff8
  • NG: "yihui/knitr@f36e52cf39abba3be261e8e957c92587c63fa599" f36e52c
  • NG: "yihui/knitr@v1.46"
  • NG: "yihui/knitr" HEAD
> xfun::session_info('knitr')
R version 4.4.0 (2024-04-24)
Platform: x86_64-apple-darwin20
Running under: macOS Sonoma 14.5

Locale: C / en_US.UTF-8 / C / C / C / C

Package version:
  evaluate_0.23   grDevices_4.4.0 graphics_4.4.0  highr_0.11
  knitr_1.46.5    methods_4.4.0   stats_4.4.0     tools_4.4.0
  utils_4.4.0     xfun_0.44       yaml_2.3.8

By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('knitr'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/knitr').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@heavywatal
Copy link
Author

FYI, adding cache-globals does not help invalidation.

```{r, dst2}
#| cache-globals:
#|   - x
z = 100 * x
z
```

@yihui
Copy link
Owner

yihui commented May 28, 2024

@knokknok @atusy Could you take a look? Thanks!

@atusy
Copy link
Collaborator

atusy commented May 29, 2024

I will

@knokknok
Copy link
Contributor

Don't you need an initial dep_auto() to set-up the system?

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

No branches or pull requests

4 participants