-
Notifications
You must be signed in to change notification settings - Fork 434
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
Mac install #1145
Mac install #1145
Conversation
Here's the moltenvk_deps src in case anyone would like to see what it's doing in detail. |
Hey I just tried running this on my dad's MBP! It almost worked fine, however the env vars did not load automatically when I closed and re-opened the terminal. However, if I manually did |
Yeh I think you're right I might remove the .profile stuff and just have a .bash_profile. It means we only support bash but that is the default on macos since 10.1 and I'll put a note in the readme for other shells. |
Ok I've made those changes, you may need to run cargo update before testing it. |
There is also this PR which wanted to make homebrew the recommend way to install vulkan sdk #1028 |
@rukai I think recommending homebrew is a little controversial on macos as users are often split between macports and homebrew. It's also worth noting neither are installed by default, whereas this PR just uses default mac tooling which should already exist if they have rust setup. I guess it wouldn't hurt to mention it as an option in the case that the user already has homebrew installed? |
I think adding a mention of macports and homebrew would just further complicate an already large readme without much gain. What we need is a way to update the vulkan sdk installed by vulkano. |
I would hesitate to use homebrew to install the sdk as the user would need to call I'll make these changes and see what I can come up with. |
I'm stuck on automatic updates because I cannot find anyway to reliably get the latest version of the vulkan_sdk without downloading it. Additionally I can't rely on the user deleting We could however get them to set
Is this an appropriate solution? |
So earlier I said "However we should also install if VULKAN_SDK is set to the value that moltenvk_deps sets it to and the path points to a directory that does not exist." Then we don't need the |
Yeh good call, that's a lot simpler. I'll update the README with your with your changes and to reflect this behavior then push these changes. |
@freesig it looks like travis is failing due to trailing whitespace in one file? Builds fine on Linux (as expected) and also can confirm the auto-install runs smoothly on @JoshuaBatty's MBP! |
Hmm now it seems that although linux is building fine, macos is error-ing on a timeout in the tests. @freesig are you able to run the tests locally on macos or do they timeout for you too? I wonder if something can be done about the culprit test. |
Yeh this is a little weird. If the test was triggering a moltenvk_deps to ask for a sdk install then there would be text in the log. It can't try and download without the users permission. I will run the test locally and report back. |
I get different failures on my machine
I'll keep digging. I wonder which version of the sdk travis is using. |
|
I would personally be fine without any command-line user prompt whatsoever and just going ahead and installing if we can't find an existing installation. I think it would be better to have a function/method/parameter of some sort which allows a developer to opt out of auto-installation in their code in case they want to run their own GUI installer or something. I'd imagine most downstream games would want to go ahead and install vulkan or provide their own GUI installer rather than have a terminal open up for the user to answer? |
Yeh I see what you mean but also its ~125mb file and the user might not be in the best position to start a download (bad net connection etc.) and would rather continue the install themselves later or perhaps even manually. Not everyone would be comfortable with an automated install and without a prompt there's not really any good way to warn them (vulkano could be a downstream dependency and they don't read the vulkano docs). Perhaps I could make a function that in the vulkano api for the developer that's using vulkano to manually create a check for the dependencies before the instance is loaded (and us that in their gui). (although I'm not sure how easy this would be as the instance get's the library path with |
Another option here is to not use |
I managed to get this working on the current vulkano master so I will close this PR now. But I'm happy to make another PR if you would like instructions for how to use moltenvk_deps in your readme. |
CHANGELOG.md
if knowledge of this change could be valuable to usersThis PR automatically downloads and installs the latest Vulkan SDK from lunarg.
It will only do this if
VULKAN_SDK
is not set.The sdk will be installed at
$HOME/.vulkan_sdk
and the following environment variables will be set in the users
.profile
or.bash_profile
The only thing that isn't automated is the user will get a error about failing to link the vulkan libs. This is because the changes to their profile are not automatically refreshed.
They will need to either
source ~/.profile
orsource ~/.bash_profile
or reopen their terminal after the first time they build vulkano.If anyone knows how to automate this that would be super useful.
So far I have tried to pass the env var settings along from the build script to the lib using
cargo:rustc_env
but that only works if you are directly using Vulkano and not if it's a dependency.One thing we could do is assume that if the env vars are not set when Vulkano is run then they must just be set to the defaults and but the user has not sourced their profile. Then just
std::env::set_var
to set them temporarily.