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

Repaired building iroha according to instruction: Added patch file to make sure abseil library is building without changes #2902

Merged

Conversation

baziorek
Copy link
Contributor

@baziorek baziorek commented Oct 24, 2022

Description of the Change

When building according to the instruction: https://iroha.readthedocs.io/en/develop/build/index.html#installing-dependencies-with-vcpkg-dependency-manager, which is with command:

./vcpkg/build_iroha_deps.sh $PWD/vcpkg-build

Suddently building is stopping with message:

Starting package 1/120: abseil:x64-linux
Building package abseil[core]:x64-linux...
-- Downloading https://github.com/abseil/abseil-cpp/archive/997aaf3a28308eba1b9156aa35ab7bca9688e9f6.tar.gz -> abseil-abseil-cpp-997aaf3a28308eba1b9156aa35ab7bca9688e9f6.tar.gz...
-- Extracting source /home/student/Desktop/iroha_code/baziorek/iroha/vcpkg-build/downloads/abseil-abseil-cpp-997aaf3a28308eba1b9156aa35ab7bca9688e9f6.tar.gz
-- Applying patch fix-cxx-standard.patch
-- Using source at /home/student/Desktop/iroha_code/baziorek/iroha/vcpkg-build/buildtrees/abseil/src/ca9688e9f6-e4cda1d679.clean
-- Found external ninja('1.10.1').
-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
-- Building x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:146 (message):
    Command failed: /usr/bin/cmake --build . --config Debug --target install -- -v -j6
    Working Directory: /home/student/Desktop/iroha_code/baziorek/iroha/vcpkg-build/buildtrees/abseil/x64-linux-dbg
    See logs for more information:
      /home/student/Desktop/iroha_code/baziorek/iroha/vcpkg-build/buildtrees/abseil/install-x64-linux-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_cmake.cmake:105 (vcpkg_execute_build_process)
  scripts/cmake/vcpkg_install_cmake.cmake:45 (vcpkg_build_cmake)
  ports/abseil/portfile.cmake:32 (vcpkg_install_cmake)
  scripts/ports.cmake:142 (include)


Error: Building package abseil:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `./vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: abseil:x64-linux
  Vcpkg version: 2021-01-13-unknownhash

Additionally, attach any relevant sections from the log files above.

In the log file is problem:

...
/home/student/Desktop/iroha_code/baziorek/iroha/vcpkg-build/buildtrees/abseil/src/ca9688e9f6-e4cda1d679.clean/absl/debugging/failure_signal_handler.cc:139:32: error: no matching function for call to ‘max(long int, int)’
  139 |   size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~
...

So to fix its both arguments have to have the same type, or to specify type of std::max. Because result is assigned to variable size_t stack_size, so I assume that the type should be size_t.

So I've corrected this according to instruction: https://stackoverflow.com/questions/72588408/vcpkg-how-to-edit-package-file-when-compilation-fails-when-installing-package


I'm using Ubuntu 22.04, with version of g++: g++ (Ubuntu 11.2.0-19ubuntu1) 11.2.0. As I know @andprogrammer had the same problem.

Issue

Benefits

Automatic build of HL Iroha

Possible Drawbacks

Chosen way of fix can be not best possible.

Usage Examples or Tests [optional]

After the fix the command:

./vcpkg/build_iroha_deps.sh $PWD/vcpkg-build

is passing to build abseil without any hacks described here.

Alternate Designs [optional]

Another possibility to fix the issue would be to upgrade version of abseil, but it is always dangerous that something somewhere would stop compiling or worse - start working different way.


PS: There is another problem with auto-build: benchmark library is failing to compile. But I'd prefer another PR.

… repair building of abseil library: std::max ambiguous call

Signed-off-by: Grzegorz Bazior <bazior@agh.edu.pl>
@baziorek baziorek added Bug Something isn't working 1.x build 1.5 Dev defect The defect was found at the development stage. Did not have an impact on users. labels Oct 24, 2022
@baziorek baziorek self-assigned this Oct 24, 2022
@baziorek baziorek temporarily deployed to test-env October 24, 2022 00:34 Inactive
@baziorek baziorek temporarily deployed to test-env October 24, 2022 00:34 Inactive
@baziorek baziorek temporarily deployed to test-env October 24, 2022 00:34 Inactive
@baziorek baziorek temporarily deployed to test-env October 24, 2022 00:34 Inactive
Copy link
Contributor

@6r1d 6r1d left a comment

Choose a reason for hiding this comment

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

The patch structure in VCPkg looks new to me, but your explanation is detailed and the code looks good. Approving.

@baziorek
Copy link
Contributor Author

baziorek commented Oct 24, 2022

The patch structure in VCPkg looks new to me, but your explanation is detailed and the code looks good. Approving.

It was also new for me. Especially because it was required to create patch which contains another patch:D.


So what should I do now? It is approved, so could I press: "Squash and merge"?

@baziorek baziorek enabled auto-merge (squash) October 24, 2022 07:09
@baziorek
Copy link
Contributor Author

I see that one of checks: build-UD (ubuntu gcc-10 Debug normal) is failing, but I don't see any serious reason, only:
obraz
And this (but I don't see description of what is wrong):
obraz


But what is really good information is that build-UR (ubuntu gcc-10 Release normal) is passing. IMO it is enough to tell that PR #2902 passes checks, because #2902 contains changes which affects vcpkg-dependencies:
obraz
which should (as I think) be the same for both build-UR and build-UD

@baziorek baziorek temporarily deployed to test-env October 24, 2022 11:53 Inactive
@baziorek baziorek temporarily deployed to test-env October 24, 2022 11:53 Inactive
@baziorek baziorek temporarily deployed to test-env October 24, 2022 11:53 Inactive
@baziorek baziorek temporarily deployed to test-env October 24, 2022 11:53 Inactive
@baziorek baziorek merged commit 925163c into hyperledger-iroha:develop Oct 24, 2022
@baziorek baziorek deleted the building_with_vcpkg_fix branch November 11, 2022 11:02
6r1d pushed a commit to 6r1d/iroha that referenced this pull request Aug 28, 2023
… repair building of abseil library: std::max ambiguous call (hyperledger-iroha#2902)

Signed-off-by: Grzegorz Bazior <bazior@agh.edu.pl>

Signed-off-by: Grzegorz Bazior <bazior@agh.edu.pl>
@nxsaken nxsaken added the iroha1 The legacy version of Iroha. label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.5 Bug Something isn't working build Dev defect The defect was found at the development stage. Did not have an impact on users. iroha1 The legacy version of Iroha.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants