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

Error while generating NEWS #32

Closed
lionel- opened this issue Jul 29, 2020 · 2 comments
Closed

Error while generating NEWS #32

lionel- opened this issue Jul 29, 2020 · 2 comments

Comments

@lionel-
Copy link
Member

lionel- commented Jul 29, 2020

https://github.com/tidyverse/purrr/runs/922354204?check_suite_focus=true#step:9:211

pkgdown::build_news()
── Building news ────────────────────────────────────────────────────────────────────────
Error: `x` must be a package name or a function inheriting from a namespace.
Run `rlang::last_error()` to see where the error occurred.
Run `rlang::last_error()` to see where the error occurred.

rlang::last_trace()
#> Backtrace:
#>      █
#>   1. └─pkgdown::build_news()
#>   2.   └─pkgdown:::build_news_single(pkg)
#>   3.     └─pkgdown:::data_news(pkg)
#>   4.       └─pkgdown:::markdown(path(pkg$src_path, "NEWS.md"))
#>   5.         └─downlit::downlit_html_node(xml)
#>   6.           └─downlit:::tweak_children(x, xpath_inline, autolink, replace = "contents")
#>   7.             └─downlit:::map_chr(text, fun, ...)
#>   8.               └─base::vapply(.x, .f, ..., FUN.VALUE = character(1), USE.NAMES = FALSE)
#>   9.                 └─downlit:::FUN(X[[i]], ...)
#>  10.                   └─downlit::autolink_url(text)
#>  11.                     └─downlit:::href_expr(expr[[1]])
#>  12.                       └─downlit::href_topic(fun_name, pkg)
#>  13.                         └─downlit:::href_topic_local(topic)
#>  14.                           └─downlit:::href_topic_reexported(topic, getOption("downlit.package"))
#>  15.                             └─downlit:::find_reexport_source(obj, ns, topic)
#>  16.                               └─rlang::ns_env_name(get_env(obj))
#>  17.                                 └─rlang::ns_env(x)
#>  18.                                   └─rlang::abort("`x` must be a package name or a function inheriting from a namespace.")
#>  19.                                     └─rlang:::signal_abort(cnd)

Digging down the rabbit hole, it appears it's because purrr reexports is_null() from rlang. This symbol is an alias for is.null() so obj contains a primitive function here:

find_reexport_source(is.null, ns_env("purrr"), "is_null")
#> Error: `x` must be a package name or a function inheriting from a namespace.
@lionel-
Copy link
Member Author

lionel- commented Jul 29, 2020

hmm the problem is in rlang. get_env() should return the base namespace rather than the base env with primitive functions:

rlang::get_env(is.null)
#> <environment: base>

rlang::ns_env(is.null)
#> <environment: namespace:base>

lionel- added a commit to r-lib/rlang that referenced this issue Jul 29, 2020
@lionel-
Copy link
Member Author

lionel- commented Jul 29, 2020

Fixed in r-lib/rlang@1fb41d7 but I'll leave this open in case you want to add a unit test.

@hadley hadley closed this as completed in df7e9b0 Aug 26, 2020
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jan 1, 2021
# rlang 0.4.9

## Breaking changes

* Dropped support for the R 3.2 series.


## New features

* `inject()` evaluates its argument with `!!`, `!!!`, and `{{`
  support.

* New `enquo0()` and `enquos0()` operators for defusing function
  arguments without automatic injection (unquotation).

* `format_error_bullets()` is no longer experimental. The `message`
  arguments of `abort()`, `warn()`, and `inform()` are automatically
  passed to that function to make it easy to create messages with
  regular, info, and error bullets. See `?format_error_bullets` for
  more information.

* New `zap_srcref()` function to recursively remove source references
  from functions and calls.

* A new compat file for the zeallot operator `%<-%` is now available
  in the rlang repository.

* New `%<~%` operator to define a variable lazily.

* New `env_browse()` and `env_is_browsed()` functions. `env_browse()`
  is equivalent to evaluating `browser()` within an environment. It
  sets the environment to be persistently browsable (or unsets it if
  `value = FALSE` is supplied).

* Functions created from quosures with `as_function()` now print in a
  more user friendly way.

* New `rlang_print_backtrace` C callable for debugging from C
  interpreters (#1059).


## Bugfixes and improvements

* The `.data` pronoun no longer skips functions (#1061). This solves a
  dplyr issue involving rowwise data frames and list-columns of
  functions (tidyverse/dplyr#5608).

* `as_data_mask()` now intialises environments of the correct size to
  improve efficiency (#1048).

* `eval_bare()`, `eval_tidy()` (#961), and `with_handlers()` (#518)
  now propagate visibility.

* `cnd_signal()` now ignores `NULL` inputs.

* Fixed bug that prevented splicing a named empty vector with the
  `!!!` operator (#1045).

* The exit status of is now preserved in non-interactive sessions when
  `entrace()` is used as an `options(error = )` handler (#1052,
  rstudio/bookdown#920).

* `next` and `break` are now properly deparsed as nullary operators.


# rlang 0.4.8

* Backtraces now include native stacks (e.g. from C code) when the
  [winch](https://r-prof.github.io/winch/) package is installed and
  `rlang_trace_use_winch` is set to `TRUE` (@krlmlr).

* Compatibility with upcoming testthat 3 and magrittr 2 releases.

* `get_env()` now returns the proper environment with primitive
  functions, i.e. the base namespace rather than the base environment
  (r-lib/downlit#32).

* `entrace()` no longer handles non-rlang errors that carry a
  backtrace. This improves compatibility with packages like callr.

* Backtraces of unhandled errors are now displayed without truncation
  in non-interactive sessions (#856).

* `is_interactive()` no longer consults "rstudio.notebook.executing"
  option (#1031).
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

1 participant