Skip to content
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

Building release on Windows #9476

Merged
merged 1 commit into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .circleci/build_win.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
cd "$PSScriptRoot\.."

if ("$Env:FORCE_RELEASE") {
New-Item prerelease.txt -type file
Write-Host "Building release version."
}

mkdir build
cd build
$boost_dir=(Resolve-Path $PSScriptRoot\..\deps\boost\lib\cmake\Boost-*)
Expand Down
9 changes: 8 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ jobs:
- run: *gitter_notify_failure
- run: *gitter_notify_success

b_win:
b_win: &b_win
executor:
name: win/default
shell: powershell.exe
Expand All @@ -906,6 +906,12 @@ jobs:
- store_artifacts: *artifact_solc_windows
- persist_to_workspace: *artifacts_build_dir

b_win_release:
<<: *b_win
environment:
FORCE_RELEASE: ON


workflows:
version: 2

Expand Down Expand Up @@ -959,6 +965,7 @@ workflows:

# Windows build and tests
- b_win: *workflow_trigger_on_tags
- b_win_release: *workflow_trigger_on_tags

nightly:

Expand Down
3 changes: 2 additions & 1 deletion ReleaseChecklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
- [ ] Create a pull request from ``develop`` to ``release``, wait for the tests, then merge it.
- [ ] Make a final check that there are no platform-dependency issues in the ``solidity-test-bytecode`` repository.
- [ ] Wait for the tests for the commit on ``release``, create a release in Github, creating the tag (click the `PUBLISH RELEASE` button on the release page.)
- [ ] Wait for the CI runs on the tag itself (travis and appveyor should push artifacts onto the Github release page).
- [ ] Wait for the CI runs on the tag itself (travis should push artifacts onto the Github release page).
- [ ] Take the ``solc.exe`` binary from the ``b_win_release`` run of the released commit in circle-ci and add it to the release page as ``solc-windows.exe``.
- [ ] Run ``scripts/create_source_tarball.sh`` while being on the tag to create the source tarball. Make sure to create ``prerelease.txt`` before: (``echo -n > prerelease.txt``). This will create the tarball in a directory called ``upload``.
- [ ] Take the tarball from the upload directory (its name should be ``solidity_x.x.x.tar.gz``, otherwise ``prerelease.txt`` was missing in the step before) and upload the source tarball to the release page.

Expand Down
36 changes: 21 additions & 15 deletions docs/installing-solidity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ The following C++ compilers and their minimum versions can build the Solidity co

- `GCC <https://gcc.gnu.org>`_, version 5+
- `Clang <https://clang.llvm.org/>`_, version 3.4+
- `MSVC <https://docs.microsoft.com/en-us/cpp/?view=vs-2019>`_, version 2017+
- `MSVC <https://visualstudio.microsoft.com/vs/>`_, version 2019+

Prerequisites - macOS
---------------------
Expand Down Expand Up @@ -262,29 +262,29 @@ You need to install the following dependencies for Windows builds of Solidity:
+-----------------------------------+-------------------------------------------------------+
| Software | Notes |
+===================================+=======================================================+
| `Visual Studio 2017 Build Tools`_ | C++ compiler |
| `Visual Studio 2019 Build Tools`_ | C++ compiler |
+-----------------------------------+-------------------------------------------------------+
| `Visual Studio 2017`_ (Optional) | C++ compiler and dev environment. |
| `Visual Studio 2019`_ (Optional) | C++ compiler and dev environment. |
+-----------------------------------+-------------------------------------------------------+

If you already have one IDE and only need the compiler and libraries,
you could install Visual Studio 2017 Build Tools.
you could install Visual Studio 2019 Build Tools.

Visual Studio 2017 provides both IDE and necessary compiler and libraries.
So if you have not got an IDE and prefer to develop solidity, Visual Studio 2017
Visual Studio 2019 provides both IDE and necessary compiler and libraries.
So if you have not got an IDE and prefer to develop solidity, Visual Studio 2019
may be a choice for you to get everything setup easily.

Here is the list of components that should be installed
in Visual Studio 2017 Build Tools or Visual Studio 2017:
in Visual Studio 2019 Build Tools or Visual Studio 2019:

* Visual Studio C++ core features
* VC++ 2017 v141 toolset (x86,x64)
* VC++ 2019 v141 toolset (x86,x64)
* Windows Universal CRT SDK
* Windows 8.1 SDK
* C++/CLI support

.. _Visual Studio 2017: https://www.visualstudio.com/vs/
.. _Visual Studio 2017 Build Tools: https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017
.. _Visual Studio 2019: https://www.visualstudio.com/vs/
.. _Visual Studio 2019 Build Tools: https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2019

Dependencies Helper Script
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should switch the Or, on windows: part of this to scripts/install_deps.ps1 now? And maybe mention that that doesn't attempt to install dependencies globally, but just puts them in deps/... and that it will not only build boost, but also fetch a cmake version that can be used to deps/cmake...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so we can remove scripts/install_deps.bat...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do that, please? :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just quickly wrote up something at both places, but in a hurry, so better to have another look later I guess.

--------------------------
Expand All @@ -300,7 +300,10 @@ Or, on Windows:

.. code-block:: bat

scripts\install_deps.bat
scripts\install_deps.ps1

Note that the latter command will install ``boost`` and ``cmake`` to the ``deps`` subdirectory, while the former command
will attempt to install the dependencies globally.

Clone the Repository
--------------------
Expand Down Expand Up @@ -362,11 +365,14 @@ And for Windows:

mkdir build
cd build
cmake -G "Visual Studio 15 2017 Win64" ..
cmake -G "Visual Studio 16 2019 Win64" ..
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should also mention here that, if this is supposed to use the boost version built by install_deps.ps1, it also needs -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded and -DBoost_DIR="..\deps\boost\lib\cmake\Boost-<BoostVersion>?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Which is the complications I warned about in #9811 (comment) ;-))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do that change, please?


In case you want to use the version of boost installed by ``./scripts/install_deps.ps1``, you will
additionally need to pass ``-DBoost_DIR="..\deps\boost\lib\cmake\Boost-*"`` and ``-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded``
as arguments to the call to ``cmake``.

This latter set of instructions should result in the creation of
**solidity.sln** in that build directory. Double-clicking on that file
should result in Visual Studio firing up. We suggest building
This should result in the creation of **solidity.sln** in that build directory.
Double-clicking on that file should result in Visual Studio firing up. We suggest building
**Release** configuration, but all others work.

Alternatively, you can build for Windows on the command-line, like so:
Expand Down
38 changes: 0 additions & 38 deletions scripts/release.bat

This file was deleted.