bitshares / bitshares/bitshares-core

Unbearable linking speed when building on Mingw

Open
#1,738 10 comments 0 reactions 0 assignees View on GitHub
0 Awaiting End User Feedback 6 Build
Dominant language
C++
Stars
1.2k
Forks
660
Avg merge
8h 17m
Merged PRs (30d)
26

Description

When building the fc library on Mingw64/Msys2 platform, the linking process of api.exe takes unbearable time.

I'm trying to do some work for #964, starting with fc library first.
It's almost done at [cwyyprog/bitshares-fc](/cwyyprog/bitshares-fc/tree/master), the problem defeated me is that ld.exe works too slowly when linking api.exe and reaches the 1 hour limit of appveyor.

The appveror conf is :
``` yml
version: 1.0.{build}.mingw64
branches:
only:
- master
skip_tags: true
image: Visual Studio 2017
init:
- ps: $blockRdp = $false; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
clone_script:
- cmd: git clone --recursive https://github.com/cwyyprog/bitshares-fc.git
build_script:
- cmd: >-
set MSYSTEM=MINGW64
cd %APPVEYOR_BUILD_FOLDER%

c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syu"

c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syu"
C:\msys64\usr\bin\bash -lc $APPVEYOR_BUILD_FOLDER/bitshares-fc/appveyor.bash
test: off
deploy: off
```
and the build script is:
``` bash
#!/usr/bin/bash
export MSYSTEM=MINGW64
pacman --noconfirm -S mingw-w64-x86_64-boost; #mingw-w64-x86_64-openssl
mkdir /msys64
mount C:/msys64 /msys64;
cd $APPVEYOR_BUILD_FOLDER/bitshares-fc;
cmake -G "MSYS Makefiles" . -DOPENSSL_CONF_SOURCE="C:/msys64/mingw64/ssl/openssl.cnf" -DOPENSSL_ROOT_DIR=/mingw64 -DBOOST_ROOT=/mingw64;
#cmake --build . -j 2 --target all_tests;
cmake --build . -j 2 --target log_test;
cmake --build . -j 2 --target bloom_test;
cmake --build . -j 2 --target hmac_test;
cmake --build . -j 2 --target blind;
cmake --build . -j 2 --target task_cancel_test;
cmake --build . -j 2 --target api;
cmake --build . -j 2 --target real128_test;
cmake --build . -j 2 --target ecc_test;
cmake --build . -j 2 --target bip_lock;
echo "Build finished!"
```
The latest build log can be found at https://ci.appveyor.com/project/cwyyprog/bitshares-fc.
As far as I know, Ccache can save the compiling time, but it's still not enough to meet the 1-hour limit, due to ld.exe takes hours to link api.exe on my laptop.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided AppVeyor configuration and build script, then inspect the CMake configuration for the api target. Reproduce the build on Mingw64/Msys2 and review the AppVeyor build log around api.exe linking. Done means identifying and addressing the cause of the link step taking hours and confirming the listed build completes within the one-hour limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.