-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Completely static Windows build on CircleCI #9811
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
860226e
Allow statically linked windows build in CMake.
ekpyron d66b6f1
CircleCI Windows config and install_deps.ps1 script.
ekpyron d0fa9a5
Update AppVeyor config to set Boost_USE_STATIC_RUNTIME.
ekpyron b97ce76
Upload binaries individually as artifacts.
ekpyron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cd "$PSScriptRoot\.." | ||
mkdir build | ||
cd build | ||
$boost_dir=(Resolve-Path $PSScriptRoot\..\deps\boost\lib\cmake\Boost-*) | ||
..\deps\cmake\bin\cmake -G "Visual Studio 16 2019" -DBoost_DIR="$boost_dir\" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_INSTALL_PREFIX="$PSScriptRoot\..\upload" .. | ||
msbuild solidity.sln /p:Configuration=Release /m:5 /v:minimal | ||
..\deps\cmake\bin\cmake --build . -j 5 --target install --config Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Needed for Invoke-WebRequest to work via CI. | ||
$progressPreference = "silentlyContinue" | ||
|
||
New-Item -ItemType Directory -Force -Path "$PSScriptRoot\..\deps" | ||
|
||
Invoke-WebRequest -URI "https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2-win64-x64.zip" -OutFile cmake.zip | ||
tar -xf cmake.zip | ||
mv cmake-3.18.2-win64-x64 "$PSScriptRoot\..\deps\cmake" | ||
|
||
Invoke-WebRequest -URI "https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.zip" -OutFile boost.zip | ||
tar -xf boost.zip | ||
cd boost_1_74_0 | ||
.\bootstrap.bat | ||
.\b2 -j4 -d0 link=static runtime-link=static variant=release threading=multi address-model=64 --with-filesystem --with-system --with-program_options --with-test --prefix="$PSScriptRoot\..\deps\boost" install | ||
cd .. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm actually not sure if this should default to
OFF
and only be set toON
in CI...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.
Then again the boost binary distribution also doesn't have static libraries in general, so the same holds for
Boost_USE_STATIC_LIBS
above...The problem is that linking entirely statically will only happen if one additionally uses
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
- but that again only works with CMake 3.16+ :-)...I think otherwise building will also work (if a static boost library linked against a static runtime is found, like the one built by the new
scripts/install_deps.ps1
), but then boost will be linked against a static C++ runtime while solidity will link against a dynamic one, which is asking for trouble, unless both are compiled together using the exact same libraries... although it may be that MSVC has a stable ABI in the C++ library within each version anyways, so maybe it's fine...Not sure how large the actual danger in all this is, though - and we can just take care to document all of this properly... So I guess we can merge this PR regardless, but I thought better to mention this - and we should at least update the docs soon after and before the next 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.
But defaulting to
ON
here will always break the existing AppVeyor builds, if we don't change the config for those :-)...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 just pushed another commit setting that for AppVeyor to at least give it a chance :-).