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

Zola won't run on Windows without the Visual C++ 2015-2017 Redistributable? #1585

Closed
rdtrimble opened this issue Aug 12, 2021 · 7 comments
Closed
Labels
bug done in pr Already done in a PR

Comments

@rdtrimble
Copy link

Bug Report

Zola failed to run for me on Windows on my work computer. It complained about the following dlls being missing
VCRUNTIME140.dll
MSVCP140.dll

Saying:

The program can't start because X is missing from your computer. Try re-installing the program to fix this problem.

where X is the two dlls above.

It works for me on my home computer (where I have admin rights)

I have tried copying the dlls above from my home machine onto my work machine in the same directory as the zola executable.
After that it stopped complaining about the dlls but says

The application was unable to start correctly (0xc000007b). Click OK to close the application.

Environment

Works on Windows 10 Pro at home version 20H2
Fails on Windows 10 Pro at work!!
Also Fails on Windows 7 Pro at work!! SP1
I have checked these versions
Zola version: 0.14 and 0.13

Expected Behaviour

"Forget dependencies. Everything you need in one binary."

It should work even if I don't have admin rights to install dependencies (even if they are very common dependencies!) I'm afraid I don't know enough to suggest a solution, maybe there are some compile options you can alter to include the dependencies?

Current Behaviour

The program won't even run so I can't get a Rust backtrace for you.

Step to reproduce

type zola on a windows computer that doesn't have the Visual C++ 2015-2017 Redistributable installed

@Keats Keats added the bug label Aug 12, 2021
@Keats
Copy link
Collaborator

Keats commented Aug 12, 2021

Hu interesting.
Anyone has a Windows machine they can use to diagnose which crate causes that?

@rdtrimble
Copy link
Author

this old issue has a lot about needing tweaks to get libsass to build on windows #198 not sure if it is relevant or not as it is quite old.

@Keats
Copy link
Collaborator

Keats commented Aug 12, 2021

libsass should be built statically, it's only complicated if you are building from source afaik.
My money is on openssl or similar?

@rdtrimble
Copy link
Author

The same sort of error is referenced in this issue where there seems to be a useful discussion
The solution # 5 referenced here might be worth a shot?

Make a .cargo/config.toml file with these contents

# Windows 64 bit programs
[target.x86_64-pc-windows-msvc]
rustflags = [
	"-C", "link-arg=libvcruntime.lib"
]

# Windows 32 bit programs
[target.i686-pc-windows-msvc]
rustflags = [
	"-C", "link-arg=libvcruntime.lib"
]

i.e. with this sort of directory structure

.cargo
|  config.toml
src
|  main.rs
Cargo.toml

Apparently static vs dynamic linking on windows especially is a problem. Sorry I'm not savvy enough with rust to be able to try it myself.

@rgieseke
Copy link

rgieseke commented Aug 21, 2022

A friend running zola.exe on Windows is also getting this with 0.16.1 but not with 0.16.0.

error while loading shared libraries: VCRUNTIME140_1.dll: cannot open shared object file: No such file or directory

There was a change with the build image after 0.16.0 I think.

Maybe something like this could be a solution?

https://users.rust-lang.org/t/static-vcruntime-distribute-windows-msvc-binaries-without-needing-to-deploy-vcruntime-dll/57599

@Keats
Copy link
Collaborator

Keats commented Aug 21, 2022

Hopefully we are going to switch out of libsass for 0.17 which means zola should be straightforward to build on Windows. #1535 for reference

@Keats Keats added the done in pr Already done in a PR label Jan 12, 2023
@Keats Keats closed this as completed Feb 17, 2023
@colinkiama
Copy link

colinkiama commented Apr 19, 2023

Had same issue except that zola silently failed. installed Visual C++ Redistributable then tried again. After that, zola magically started working 🤷 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug done in pr Already done in a PR
Projects
None yet
Development

No branches or pull requests

4 participants