Open VictorKoenders opened 3 years ago
The Failed to find tool. Is lib.exe installed?
Seems to be related to https://github.com/alexcrichton/cc-rs/issues/523. Not sure how to fix this...
The issue with the wget %20 is because alpine has it's own special little wget installed by default. Installing the "normal" wget fixes the naming issue
I'm trying to set up msvc-wine-rust in an alpine container. This is mostly documentation on what I needed to go to get it to work.
When it gets to the
sha256sum --quiet --check dl.sha256 || exit 2
step, the script exits out with the messageReplacing the call with
sha256sum -s -c dl.sha256 || exit 2
does seem to work. I used this sed script:Then I got the error
When checking the
dl
folder it seems like the files are there but the space is replaced by a %20Simply replacing the files with a
\
works:After that I get the error
unzip: can't open tracted/tools[.zip]
This seems to be fixed by replacing the entire
extract_vsix
function with the following code:After fiddling some time with missing alpine packages, I ended up on cargo trying to build x86_64-pc-windows-msvc, but it resulted in this error:
Which might be an issue with
spirv_cross
, I'm not sure yet. Will investigate moreMy current script is:
get.sh.patch
```patch diff --git a/get.sh b/get.sh index c378e61..65a5ffd 100755 --- a/get.sh +++ b/get.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -ex wine_exec=${WINE_EXEC:=wine} @@ -16,7 +16,7 @@ function dl() { function download() { mkdir -p dl - mkdir -p extracted + mkdir -p extracted/tools # Obtain the SDK installer. It contains the license @@ -98,12 +98,15 @@ function download() { # Extracts the given .vsix files function extract_vsix() { - mkdir -p $1 - for f in ${@:2}; do - unzip $f 'Contents/*' -d $1 + DIR=$1 + shift + echo $1 + while [ -n "$1" ]; do + unzip $1 'Contents/*' -d $DIR + shift done - cp -Ra $1/Contents/. $1 - rm -rf $1/Contents + cp -Ra $DIR/Contents/. $DIR + rm -rf $DIR/Contents } # Extracts a given msi file @@ -115,7 +118,7 @@ function extract_msi() { } function extract() { - mkdir -p extracted + mkdir -p extracted/tools # Extract the tools extract_vsix extracted/tools dl/microsoft.visualcpp.tools.*.vsix @@ -143,7 +146,7 @@ case "$1" in download # Verify the downloaded files - sha256sum --quiet --check dl.sha256 || exit 2 + sha256sum -s -c dl.sha256 || exit 2 # NOTE: Create the file using: # sha256sum dl/* > dl.sha256 @@ -156,7 +159,7 @@ case "$1" in *) # Extract, then download: download - sha256sum --quiet --check dl.sha256 || exit 2 + sha256sum -s -c dl.sha256 || exit 2 extract ;; esac ```Dockerfile
```docker from alpine:latest ENV PATH=$PATH:/root/.cargo/bin ENV WINE_EXEC=/usr/bin/wine64 RUN apk update RUN apk add curl wine p7zip git msitools build-base cmake pkgconfig freetype-dev expat-dev RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ sh -s -- -y --profile minimal RUN rustup target add x86_64-pc-windows-msvc WORKDIR /app/msvc-wine-rust RUN git clone https://github.com/est31/msvc-wine-rust . COPY .docker_msvc/get.sh.patch get.sh.patch RUN git apply get.sh.patch RUN sh get.sh licenses-accepted || true RUN mv dl/Universal%20CRT%20Headers%20Libraries%20and%20Sources-x86_en-us.msi \ dl/Universal\ CRT\ Headers\ Libraries\ and\ Sources-x86_en-us.msi RUN mv dl/Windows%20SDK%20Desktop%20Libs%20x64-x86_en-us.msi \ dl/Windows\ SDK\ Desktop\ Libs\ x64-x86_en-us.msi RUN mv dl/Windows%20SDK%20Desktop%20Libs%20x86-x86_en-us.msi \ dl/Windows\ SDK\ Desktop\ Libs\ x86-x86_en-us.msi RUN mv dl/Windows%20SDK%20for%20Windows%20Store%20Apps%20Libs-x86_en-us.msi \ dl/Windows\ SDK\ for\ Windows\ Store\ Apps\ Libs-x86_en-us.msi RUN sha256sum -s -c dl.sha256 || exit 2 RUN sh get.sh extract WORKDIR /app/src ENTRYPOINT ls -lah && \ mkdir -p .cargo && \ echo "[target.x86_64-pc-windows-msvc]" >> .cargo/config && \ echo "linker = \"/app/msvc-wine-rust/linker-scripts/linkx64.sh\"" >> .cargo/config && \ cargo build --release --target x86_64-pc-windows-msvc ```