-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: missing cmake and protobuf for windows build #4816
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
Conversation
Signed-off-by: V. Lascik <vlascik@users.noreply.github.com>
Signed-off-by: V. Lascik <vlascik@users.noreply.github.com>
Justfile
Outdated
| else | ||
| echo "Building Windows executable using Docker through PowerShell..." | ||
| powershell.exe -Command "docker volume create goose-windows-cache; docker run --rm -v ${PWD}:/usr/src/myapp -v goose-windows-cache:/usr/local/cargo/registry -w /usr/src/myapp rust:latest sh -c 'rustup target add x86_64-pc-windows-gnu && apt-get update && apt-get install -y mingw-w64 && cargo build --release --target x86_64-pc-windows-gnu && GCC_DIR=\$(ls -d /usr/lib/gcc/x86_64-w64-mingw32/*/ | head -n 1) && cp \$GCC_DIR/libstdc++-6.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/ && cp \$GCC_DIR/libgcc_s_seh-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/ && cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/'" | ||
| powershell.exe -Command "docker volume create goose-windows-cache; docker run --rm -v ${PWD}:/usr/src/myapp -v goose-windows-cache:/usr/local/cargo/registry -w /usr/src/myapp rust:latest sh -c 'rustup target add x86_64-pc-windows-gnu && apt-get update && apt-get install -y mingw-w64 protobuf-compiler cmake && export CC_x86_64_pc_windows_gnu=x86_64-w64-mingw32-gcc && export CXX_x86_64_pc_windows_gnu=x86_64-w64-mingw32-g++ && export AR_x86_64_pc_windows_gnu=x86_64-w64-mingw32-ar && export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=x86_64-w64-mingw32-gcc && export PKG_CONFIG_ALLOW_CROSS=1 && export PROTOC=/usr/bin/protoc && export PATH=/usr/bin:\$PATH && protoc --version && cargo build --release --target x86_64-pc-windows-gnu && GCC_DIR=\$(ls -d /usr/lib/gcc/x86_64-w64-mingw32/*/ | head -n 1) && cp \$GCC_DIR/libstdc++-6.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/ && cp \$GCC_DIR/libgcc_s_seh-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/ && cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we take this opportunity to break this out to different lines so it's more readable what's going on here?
also, a comment explaining what each thing added is for would help a lot with review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the original problem was that the windows build command apt-get install -y mingw-w64 protobuf-compiler cmake... was missing cmake and protobuf-compiler when started from powershell, and not sh. Apparently someone added it to sh, but forgot to put it to the powershell part, so if the build was started from powershell, it didn't work.
I extracted the command to a variable, this way it's in one place and people won't have to remember to make the changes twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Thanks for the clarification. Looks like there is a conflict to work out
I will see if I can run a full build of this before merge to verify everything works well for our automated windows builds.
…rs (block#4124) Signed-off-by: sings-to-bees-on-wednesdays <222684290+sings-to-bees-on-wednesdays@users.noreply.github.com> Co-authored-by: Jack Amadeo <jackamadeo@block.xyz> Co-authored-by: Jack Amadeo <jackamadeo@squareup.com>
Co-authored-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com> Co-authored-by: Tyler Longwell <tlongwell@squareup.com>
Signed-off-by: Angela Ning <aning@squareup.com>
Co-authored-by: Douwe Osinga <douwe@squareup.com>
Co-authored-by: taniashiba <126204004+taniashiba@users.noreply.github.com>
Co-authored-by: Tania Chakraborty <tchakraborty@block.xyz> Co-authored-by: Angie Jones <jones.angie@gmail.com>
…error (block#4621) Signed-off-by: jalateras <jima@comware.com.au>
Co-authored-by: Douwe Osinga <douwe@squareup.com>
Signed-off-by: sings-to-bees-on-wednesdays <222684290+sings-to-bees-on-wednesdays@users.noreply.github.com> main was broken. this seems important
Signed-off-by: Evanfeenstra <evanfeenstra@gmail.com>
Signed-off-by: AdemolaAri <ademola.ari@gmail.com>
… (block#4859) Signed-off-by: demetrio108 <demetrio108@protonmail.com>
Signed-off-by: jalateras <jima@comware.com.au> Co-authored-by: Ebony Louis <55366651+EbonyLouis@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Jack Amadeo <jackamadeo@squareup.com>
…th sh and pwsh contexts Signed-off-by: V. Lascik <vlascik@users.noreply.github.com>
…es (block#4464) Signed-off-by: Matt Donovan <mattddonovan@protonmail.com> Co-authored-by: Matt Donovan <mattddonovan@protonmail.com>
Co-authored-by: Douwe Osinga <douwe@squareup.com>
Signed-off-by: V. Lascik <vlascik@users.noreply.github.com>
…th sh and pwsh contexts Signed-off-by: V. Lascik <vlascik@users.noreply.github.com>
Signed-off-by: V. Lascik <vlascik@users.noreply.github.com>
|
So, there was a different problem in mod.rs file, I tried to be clever with the branching of the fixes, but someone else fixed it in the meantime, and it seems I messed this branch up royally. I'll close this and post the fix in a new PR, I'm too tired to try to unwind this mess. Sorry 😄. |
|
No problem. Ping me on the new PR |
Pull Request Description
Fix: install missing cmake and protobuf to docker image for windows build, to align with other platforms.
Build is broken otherwise.