leanprover / elan

The Lean version manager
Apache License 2.0
316 stars 35 forks source link

How to build elan on windows #44

Open lovettchris opened 3 years ago

lovettchris commented 3 years ago

I figured out that I needed a windows friendly version of perl from https://strawberryperl.com/ because the one in "c:\Program Files\Git\usr\bin\perl.exe" doesn't work for some reason. So the openssl configure steps now works.

But the build still fails with this:

error: failed to run custom build command for `elan-dist v1.11.0 (D:\git\leanprover\elan\src\elan-dist)`

Caused by:
  process didn't exit successfully: `d:\git\leanprover\elan\target\debug\build\elan-dist-6a05c90498e27db7\build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src\elan-dist\build.rs:8:50
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

Possibly because these environment variables are not defined?

    let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
    let target = env::var("RELEASE_TARGET_NAME").unwrap();

If so, what should these be set to and why do I need to set them, and we need a readme to explain what to set them to, etc.

Kha commented 3 years ago

The error should be fixed by https://github.com/leanprover/elan/commit/8d1dec09d67b2ac1768b111d24f1a1cabdd563fa. For openssl, we could link to https://github.com/sfackler/rust-openssl/issues/1062#issuecomment-817181642. I didn't try it though.

lovettchris commented 2 years ago

I tried the vcpkg route to build openssl but it doesn't solve the problem.