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

Issue finding Unity on MacOS and Windows #4

Closed
wjones127 opened this issue Apr 25, 2022 · 6 comments
Closed

Issue finding Unity on MacOS and Windows #4

wjones127 opened this issue Apr 25, 2022 · 6 comments

Comments

@wjones127
Copy link
Contributor

Had issues finding Unity on MacOS. This is what I saw in my interactive session:

library(unifir)

options(unifir_unity_path="/Applications/Unity/Hub/Editor/2021.3.0f1/Unity.app/Contents/MacOS/Unity")
find_unity() # success on first call
# [1] "\"/Applications/Unity/Hub/Editor/2021.3.0f1/Unity.app/Contents/MacOS/Unity\""
find_unity() # failure on second call
# Error in find_unity() : Couldn't find Unity executable at provided path. 
# Please make sure the path provided to 'unity' is correct.
Sys.getenv("unifir_unity_path")
# [1] "\"/Applications/Unity/Hub/Editor/2021.3.0f1/Unity.app/Contents/MacOS/Unity\""

It works if I remove the logic that adds quotation marks to the path and add a beginning slash on this line:

https://github.com/mikemahoney218/unifir/blob/2e5f90cfc09b4456b3751f932f19da49e0dbebc7/R/find_unity.R#L86

On Windows, the windows_location() works fine, but file.exists(unity) always returns false with the extra " added to the path. I think this means even if the user profiles a different unity path, it will always select the default system one.

Relatedly, if I run the test locally on MacOS, I get this failure:

Failure (test-make_script.R:64:3): make_script always produces the same script
example_script$unity (`actual`) not identical to saved_script$unity (`expected`).

`actual`:   "junk_string"    
`expected`: "\"junk_string\""
@mikemahoney218
Copy link
Member

Gah! Thank you, will look into this today. Any chance you could post your sessionInfo()?

@wjones127
Copy link
Contributor Author

Sure!

R version 4.1.3 (2022-03-10)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.3.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] unifir_0.1.0

loaded via a namespace (and not attached):
[1] compiler_4.1.3        R6_2.5.1              tools_4.1.3           glue_1.6.2           
[5] proceduralnames_0.2.1

@mikemahoney218
Copy link
Member

Thanks! I made some changes in 128714f to hopefully address this (on the branch response_to_reviewers), though I haven't gotten to test them yet.

@wjones127
Copy link
Contributor Author

Great. I can confirm that branch fixes the issue for me. The unit tests pass and the Unity path is consistently found on MacOS.

@mikemahoney218
Copy link
Member

Fantastic, thanks!

Copy link

github-actions bot commented Feb 2, 2024

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants