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

Repairing MacOs build on develop #3977

Merged
merged 14 commits into from
Oct 20, 2023
Merged

Repairing MacOs build on develop #3977

merged 14 commits into from
Oct 20, 2023

Conversation

baziorek
Copy link
Contributor

@baziorek baziorek commented Oct 9, 2023

Description

develop -> master is failing to compile in MacOs: #3960

That is why I need to repair the compilation. It looks that GTest is not compilling for MacOS because compiler is now newer than before (newer compiler usually is more strict). Newer compiler signals some things as warnings, but GTest has -Werror compilation flag. So the solution is to create patch for vcpkg port of gtest to remove the flag (how to create patch is here: https://stackoverflow.com/questions/72588408/vcpkg-how-to-edit-package-file-when-compilation-fails-when-installing-package).

Details of what was done: #3977 (comment)

Linked issue

Closes #{issue_number}

Benefits

We will be able to upgrade main branch with changes from develop

Checklist

  • I've read CONTRIBUTING.md
  • I've used the standard signed-off commit format (or will squash just before merging)
  • All applicable CI checks pass (or I promised to make them pass later)
  • (optional) I've written unit tests for the code changes
  • I replied to all comments after code review, marking all implemented changes with thumbs up

@baziorek baziorek self-assigned this Oct 9, 2023
@baziorek baziorek changed the base branch from main to develop October 9, 2023 16:39
mversic
mversic previously approved these changes Oct 10, 2023
@baziorek
Copy link
Contributor Author

It is not ready yet. I need some way to run:
image
but I unfortunately can not find the option anywhere, could somebody help?

It will be great if somebody runs also:
image
it is waiting about 12 hours:)

@baziorek
Copy link
Contributor Author

@safinsaf I hope that this PR (#3977) is fix for: #3960, but to make sure we need to enable checks:
image
image

Those checks seems to be enabled only when we want to merge something into main branch, but we need to enable them also for other branches. Unfortunately I'm not CI expert and I can't find where it is enabled only for main. Could You help, please?

@baziorek baziorek mentioned this pull request Oct 14, 2023
5 tasks
@baziorek baziorek added the build label Oct 14, 2023
@baziorek
Copy link
Contributor Author

It looks that everything works expect for building on MacOs:
image

  • DCO:D.

When I check details about Building on MacOS I see that building dependencies is fixed (what was problem here: #3960):
image

Unfortunately Iroha is not building on MacOS (interesting thing is that on Linux it is building). Details of compilation failures:
image

I see three solutions (I don't know if they will help):

  1. Try to downgrade protobuf (it was upgraded here: Trying to upgrade libraries in VCPKG #3862)
  2. Can we change compiler on MacOs from clion to gcc10?
  3. Try to fix on MacOS with current configuration - but I don't have MacOs, so I can not try that way.

@baziorek
Copy link
Contributor Author

baziorek commented Oct 18, 2023

We have problem, because it is not that easy to fix its, according to possible solutions from another post (#3977 (comment)):

  1. Downgrading protobuf is not working, so I'll revert reverting commit (fc4ebec) - didn't help
  2. Changing compiler into g++-10 on MacOs - didn't help.

@baziorek
Copy link
Contributor Author

baziorek commented Oct 18, 2023

UPDATE: I noticed that compilation problems are in iroha-lib (what was done during last year internship project): #3977 (comment)

So I decided - let's check if after commenting them everything is going to compile. Unfortunately we faced linkage error:
image
We can come back to clang compiler and maybe it will pass:)

safinsaf and others added 14 commits October 19, 2023 12:59
Signed-off-by: safinsaf <[email protected]>
Signed-off-by: safinsaf <[email protected]>
Signed-off-by: safinsaf <[email protected]>
Signed-off-by: safinsaf <[email protected]>
Signed-off-by: safinsaf <[email protected]>
Signed-off-by: safinsaf <[email protected]>
Signed-off-by: safinsaf <[email protected]>
Signed-off-by: safinsaf <[email protected]>
Signed-off-by: safinsaf <[email protected]>
Signed-off-by: safinsaf <[email protected]>
Signed-off-by: safinsaf <[email protected]>
…n MacOS by removing -Werror flag

Signed-off-by: Grzegorz Bazior (Yodiss PSA) <[email protected]>
Signed-off-by: Grzegorz Bazior (Yodiss PSA) <[email protected]>
Signed-off-by: safinsaf <[email protected]>
@baziorek baziorek force-pushed the develop_repairingMacOs branch from 850bf96 to 22dd81a Compare October 19, 2023 12:48
@baziorek
Copy link
Contributor Author

Summary (it looks that we fixed with @safinsaf), but the solution is not best possible.
MacOS build was failing, because dependencies were not compiling. So I've created path for VCPKG GTest port and dependencies are building. Another problem was compilation of internship project to create iroha-lib in C++ inside the main repository. As I see probably it never compiled for MacOS (but I can be wrong). The current problem with compilation is connected with examples for the iroha-lib (details of compilation error: #3977 (comment)), unfortunately changing compiler didn't help. So I added some kind of dirty hack - I've added conditional compilation in CMake of the iroha-lib (if(NOT APPLE) compile). Now everything passes.
Unfortunately I can't fix this better way, because I don't have MacOS.

So the question for somebody who is deciding about future of Iroha 1 - can we leave like that?

@baziorek baziorek merged commit 80c0636 into develop Oct 20, 2023
@baziorek baziorek deleted the develop_repairingMacOs branch October 24, 2023 09:07
baziorek added a commit to dominious1/iroha that referenced this pull request Jan 26, 2024
* Turn macos on on CI

Signed-off-by: safinsaf <[email protected]>

* Debug matrix

Signed-off-by: safinsaf <[email protected]>

* Check comment body

Signed-off-by: safinsaf <[email protected]>

* Check new line

Signed-off-by: safinsaf <[email protected]>

* Check new line

Signed-off-by: safinsaf <[email protected]>

* Check new line

Signed-off-by: safinsaf <[email protected]>

* Remove debug data

Signed-off-by: safinsaf <[email protected]>

* Try gcc for mac

Signed-off-by: safinsaf <[email protected]>

* Try gcc-10

Signed-off-by: safinsaf <[email protected]>

* Debug macos

Signed-off-by: safinsaf <[email protected]>

* Update gen matrix file

Signed-off-by: safinsaf <[email protected]>

* Added patch which is fixing vcpkg dependency build of GTest library on MacOS by removing -Werror flag

Signed-off-by: Grzegorz Bazior (Yodiss PSA) <[email protected]>

* Disabled compilation of iroha-lib for MacOS

Signed-off-by: Grzegorz Bazior (Yodiss PSA) <[email protected]>

* Move to clang

Signed-off-by: safinsaf <[email protected]>

---------

Signed-off-by: safinsaf <[email protected]>
Signed-off-by: Grzegorz Bazior (Yodiss PSA) <[email protected]>
Co-authored-by: safinsaf <[email protected]>
Co-authored-by: Grzegorz Bazior (Yodiss PSA) <[email protected]>
baziorek added a commit to dominious1/iroha that referenced this pull request Jan 26, 2024
* Turn macos on on CI

Signed-off-by: safinsaf <[email protected]>

* Debug matrix

Signed-off-by: safinsaf <[email protected]>

* Check comment body

Signed-off-by: safinsaf <[email protected]>

* Check new line

Signed-off-by: safinsaf <[email protected]>

* Check new line

Signed-off-by: safinsaf <[email protected]>

* Check new line

Signed-off-by: safinsaf <[email protected]>

* Remove debug data

Signed-off-by: safinsaf <[email protected]>

* Try gcc for mac

Signed-off-by: safinsaf <[email protected]>

* Try gcc-10

Signed-off-by: safinsaf <[email protected]>

* Debug macos

Signed-off-by: safinsaf <[email protected]>

* Update gen matrix file

Signed-off-by: safinsaf <[email protected]>

* Added patch which is fixing vcpkg dependency build of GTest library on MacOS by removing -Werror flag

Signed-off-by: Grzegorz Bazior (Yodiss PSA) <[email protected]>

* Disabled compilation of iroha-lib for MacOS

Signed-off-by: Grzegorz Bazior (Yodiss PSA) <[email protected]>

* Move to clang

Signed-off-by: safinsaf <[email protected]>

---------

Signed-off-by: safinsaf <[email protected]>
Signed-off-by: Grzegorz Bazior (Yodiss PSA) <[email protected]>
Co-authored-by: safinsaf <[email protected]>
Co-authored-by: Grzegorz Bazior (Yodiss PSA) <[email protected]>
@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 build iroha1 The legacy version of Iroha.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants