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

R cmd check fails with latest rust-polars on macOS #35

Closed
sorhawell opened this issue Jan 31, 2023 · 6 comments
Closed

R cmd check fails with latest rust-polars on macOS #35

sorhawell opened this issue Jan 31, 2023 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@sorhawell
Copy link
Collaborator

sorhawell commented Jan 31, 2023

Test PR #34 shows r-polars fails R CMD check on macOS if upgrading rust-polars dependency beyond this polars commit

Windows:
Likely because polars included crate sysinfo which have a lot of system dependencies. For windows following mingw libraries -lntdll -lpsapi -liphlpapi -lpdh -lpowrprof -loleaut32 -lnetapi32 -lsecur32 can be included to the linker, and the problem is resolved.

However for macOS R CMD check throws the following error:

checking whether the package can be unloaded cleanly ... WARNING
  Error: package or namespace load failed forrpolarsin dyn.load(file, DLLpath = DLLpath, ...):
   unable to load shared object '/Users/runner/work/r-polars/r-polars/check/rpolars.Rcheck/rpolars/libs/rpolars.so':
    dlopen(/Users/runner/work/r-polars/r-polars/check/rpolars.Rcheck/rpolars/libs/rpolars.so, 0x0006): symbol not found in flat namespace (_IOBSDNameMatching)
  Execution haltedchecking whether the namespace can be loaded with stated dependencies ... WARNING
  Error in dyn.load(file, DLLpath = DLLpath, ...) : 
    unable to load shared object '/Users/runner/work/r-polars/r-polars/check/rpolars.Rcheck/rpolars/libs/rpolars.so':
    dlopen(/Users/runner/work/r-polars/r-polars/check/rpolars.Rcheck/rpolars/libs/rpolars.so, 0x0006): symbol not found in flat namespace (_IOBSDNameMatching)
  Calls: <Anonymous> ... eval -> eval -> loadNamespace -> library.dynam -> dyn.load
  Execution halted
  
  A namespace must be able to be loaded with just the base namespace
  loaded: otherwise if the namespace gets loaded by a saved object, the
  session will be unable to start.
  
  Probably some imports need to be declared in the NAMESPACE file.
@sorhawell
Copy link
Collaborator Author

sorhawell commented Jan 31, 2023

In the short run workflow will just ignore warnings/notes containing _IOBSDNameMatching. The macOS build still passes all unit tests.

I guess this could be resolved by figuring out what crate sysinfo is depending on and some how explicitly state this as a requirement in rpolars DESCRIPTION to satisfy R CMD check.

This was referenced Jan 31, 2023
@sorhawell
Copy link
Collaborator Author

r-polars works just fine for macOS. It is just matter figuring out if the rpolars relies on some system dependency and how to state this in the DESCRIPTION file. It could also be a false alarm, as rpolars is statically linked and all dependencies should be included in the binary.

@ghuls
Copy link

ghuls commented Feb 28, 2023

Not sure it objdump also works on Mac or if it is called differntly, but it might help if you can print all symbols.

objdump -T rpolars.so

@sorhawell
Copy link
Collaborator Author

thx I will try it out, seem there is a variant called otools which is recommended:
https://superuser.com/questions/206547/how-can-i-install-objdump-on-mac-os-x

@sorhawell sorhawell mentioned this issue Mar 19, 2023
@eitsupi eitsupi added bug Something isn't working help wanted Extra attention is needed labels Mar 19, 2023
@eitsupi eitsupi changed the title R cmd check fails on latest rust-polars R cmd check fails with latest rust-polars on macOS Mar 19, 2023
@sorhawell
Copy link
Collaborator Author

Found in writing R extensions how to use otool (objdump for mac) on rpolars.so

sorenwelling@Srens-MacBook-Pro libs % R CMD otool -L rpolars.so
rpolars.so:
	rpolars.so (compatibility version 0.0.0, current version 0.0.0)
	/Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libR.dylib (compatibility version 4.2.0, current version 4.2.3)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1953.255.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
sorenwelling@Srens-MacBook-Pro libs %

So there are some dependencies. I believe they come from the crate sysinfo which polars likely uses to get machine info.

@sorhawell
Copy link
Collaborator Author

Hurray don't know if cran check rules changed or what, but this is no longer an cran check error.

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

No branches or pull requests

3 participants