Skip to content

Conversation

@vlascik
Copy link
Contributor

@vlascik vlascik commented Sep 25, 2025

Pull Request Description

Fix: install missing cmake and protobuf to docker image for windows build, to align with other platforms.

Build is broken otherwise.

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/'"
Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

zanesq and others added 27 commits September 25, 2025 07:08
…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>
jalateras and others added 15 commits September 29, 2025 10:08
…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>
thebristolsound and others added 2 commits September 30, 2025 08:58
…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>
exitcode0 and others added 5 commits September 30, 2025 10:12
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>
@vlascik vlascik requested a review from a team as a code owner September 30, 2025 15:29
@vlascik
Copy link
Contributor Author

vlascik commented Sep 30, 2025

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 😄.

@vlascik vlascik closed this Sep 30, 2025
@alexhancock
Copy link
Collaborator

No problem. Ping me on the new PR

@vlascik vlascik deleted the fix-missing-cmake-on-windows branch October 23, 2025 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.