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: could not find function "lang_unnamespace" #51

Closed
wlandau opened this issue Feb 20, 2018 · 9 comments
Closed

Error: could not find function "lang_unnamespace" #51

wlandau opened this issue Feb 20, 2018 · 9 comments

Comments

@wlandau
Copy link

wlandau commented Feb 20, 2018

I am trying to understand a Travis build error that I cannot reproduce locally. Both my local system and Travis use rlang 0.2.0 and tidyselect 0.2.3 (current CRAN). Clearing the cache seems to remove the error, but only for the build right after the cache is cleared. From this thread, there apparently once was a function called lang_unnamespace(), but it was removed. It might be nice to have some context about the role and erasure of lang_unnamespace so I can understand the problem.

@lionel-
Copy link
Member

lionel- commented Feb 20, 2018

This is probably linked to this line in tidyselect:

is_language <- is_lang

The purpose was to anticipate a renaming. However the alias is generated at build-time rather than load-time. So is_language() now contains the definition of is_lang() at the time of package build, which might be rlang 0.1.6. Lesson learned: never make build-time aliases of functions from other packages.

I'm not sure how the error comes about in your Travis build.

@lionel-
Copy link
Member

lionel- commented Feb 20, 2018

Note that lang_unnamespace() was an unexported function in rlang 0.1.6 that got removed in the new version. It was supposed to be private but I exposed it in tidyselect by copying the entire definition of the exported function is_lang() instead of calling it with an indirection.

lionel- added a commit that referenced this issue Feb 20, 2018
@wlandau
Copy link
Author

wlandau commented Feb 22, 2018

Thanks for explaining, @lionel-. The Travis failures went away, but AppVeyor started failing yesterday. I tried skipping the tests if the version of rlang is less than 0.2.0, but that did not work. Is there a compatible set of package versions I can force? Which packages would I need to consider? Related: ropensci/drake#276.

@lionel-
Copy link
Member

lionel- commented Feb 22, 2018

You need a freshly rebuilt tidyselect, and I don't know how to force that in AppVeyor, short of making it depend on the dev version. Once a new version of tidyselect is out you can force dependence on the new released version.

@lionel-
Copy link
Member

lionel- commented Feb 22, 2018

Maybe @krlmlr has other ideas?

@krlmlr
Copy link
Member

krlmlr commented Feb 22, 2018

I have seen this error locally, it went away after installing the dev version of tidyselect. Maybe the dev version of rlang is installed on Travis for some reason? Can you please try adding

Remotes:
    tidyverse/tidyselect

to DESCRIPTION?

@lionel-
Copy link
Member

lionel- commented Feb 22, 2018

it can also be the released version of tidyselect, but it has to be built against rlang 0.2.0 :(

@wlandau
Copy link
Author

wlandau commented Feb 22, 2018

@krlmlr That worked. Not an ideal long-term solution, but it will get us by until the next tidyselect is released.

@lionel-
Copy link
Member

lionel- commented Feb 22, 2018

I prefer to keep this open until a new tidyselect release in case anyone stumble on the issue.

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

3 participants