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

Ci tests update #575

Closed
wants to merge 28 commits into from
Closed

Ci tests update #575

wants to merge 28 commits into from

Conversation

smk762
Copy link

@smk762 smk762 commented Mar 16, 2023

No description provided.

@DeckerSU
Copy link

As i see build failed with:

2023-03-17T11:43:10.8200340Z /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:190:6: note: declared here
2023-03-17T11:43:10.8200720Z  int  sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3);
2023-03-17T11:43:10.8200990Z       ^~~~~~~
2023-03-17T11:43:10.8201210Z In file included from main.cpp:7111:
2023-03-17T11:43:10.8202370Z komodo_nSPV_wallet.h:420:57: error: 'int sprintf(char*, const char*, ...)' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror=deprecated-declarations]
2023-03-17T11:43:10.8203190Z              sprintf(numstr,"%.8f",(double)rewardsum/COIN);

A temp solution could be add -Wno-deprecated-declarations in CXXFLAGS, like this:

diff --git a/zcutil/build-mac-dtest.sh b/zcutil/build-mac-dtest.sh
index 8104c7200..04c1d8ad8 100755
--- a/zcutil/build-mac-dtest.sh
+++ b/zcutil/build-mac-dtest.sh
@@ -52,7 +52,7 @@ cd $WD
 
 ./autogen.sh
 CPPFLAGS="-I$PREFIX/include -arch x86_64 -DTESTMODE" LDFLAGS="-L$PREFIX/lib -arch x86_64 -Wl,-no_pie" \
-CXXFLAGS='-arch x86_64 -I/usr/local/Cellar/gcc\@8/8.3.0/include/c++/8.3.0/ -I$PREFIX/include -fwrapv -fno-strict-aliasing -Wno-builtin-declaration-mismatch -Werror -Wno-error=attributes -g -Wl,-undefined -Wl,dynamic_lookup' \
+CXXFLAGS='-arch x86_64 -I/usr/local/Cellar/gcc\@8/8.3.0/include/c++/8.3.0/ -I$PREFIX/include -fwrapv -fno-strict-aliasing -Wno-builtin-declaration-mismatch -Wno-deprecated-declarations -Werror -Wno-error=attributes -g -Wl,-undefined -Wl,dynamic_lookup' \
 ./configure --prefix="${PREFIX}" --with-gui=no "$HARDENING_ARG" "$LCOV_ARG"
 
 make "$@" V=1 NO_GTEST=1 STATIC=1

smk762 and others added 5 commits March 17, 2023 20:15
TODO: get rid of gcc on darwin, we should use clang for native darwin
builds.
```
cc/import.cpp: In function 'int32_t CheckCODAimport(CTransaction, CTransaction, std::vector<CTxOut>, std::string, std::string)':
cc/import.cpp:260:12: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
  260 |     out[65]='\0';
      |     ~~~~~~~^~~~~
cc/import.cpp:247:44: note: at offset 65 into destination object 'out' of size 65
  247 |     cJSON *result,*tmp,*tmp1; char *retstr,out[SHA256_DIGEST_LENGTH*2+1]; int i,n,m;
      |                                            ^~~
```

actually this is not needed, and the line out[64]='\0' could be commented,
as sprintf actually writes 3 bytes per call, i.e. for hash[i] = 0xca, it
will actually write the following sequence of bytes 'c', 'a', 0x00. So,
end of string will be always with end NUL byte.
@ca333 ca333 requested review from ca333, DeckerSU and dimxy March 25, 2023 17:40
@dimxy
Copy link
Collaborator

dimxy commented Mar 27, 2023

let's discuss and merge decker's fix #577 (migration to gcc-12 on mac)

@dimxy
Copy link
Collaborator

dimxy commented Mar 29, 2023

fixes #560 in Macos part

@dimxy
Copy link
Collaborator

dimxy commented Mar 29, 2023

I re-ran Macos tests here and they again failed with OSError: [Errno 8] Exec format error: '../../src/komodod'
Maybe when we apply Decker's #577 which switches to gcc-12 this error will be fixed

@DeckerSU
Copy link

DeckerSU commented Mar 29, 2023

I re-ran Macos tests here and they again failed with OSError: [Errno 8] Exec format error: '../../src/komodod' Maybe when we apply Decker's #577 which switches to gcc-12 this error will be fixed

Exactly ... the gcc-8 seems produce incorrect binaries on MacOS 12 / latest XCode ... Have no idea why, didn't investigate this case, but with gcc-12 - seems everything is Ok.

Copy link
Collaborator

@dimxy dimxy left a comment

Choose a reason for hiding this comment

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

I suggest first merging two PRs waiting for merge into this branch and then review this PR

@ca333
Copy link

ca333 commented Jan 29, 2024

archive

@ca333 ca333 closed this Jan 29, 2024
who-biz pushed a commit to who-biz/komodo that referenced this pull request Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants