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
build, libglusterfs, tests: use system xxhash if installed #3127
build, libglusterfs, tests: use system xxhash if installed #3127
Conversation
CLANG-FORMAT FAILURE: index f01134315..793f9f69e 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -69,7 +69,7 @@
#else /* not a convenient LP64 ABI */
#define XXH64_FMT "llx"
#endif /* ABI selection */
-#else /* use from contrib */
+#else /* use from contrib */
#define XXH64_FMT "llx"
#endif /* HAVE_LIBXXHASH */
@@ -303,7 +303,8 @@ gf_gfid_generate_from_xxh64(uuid_t gfid, char *key)
}
gf_msg_debug(this->name, 0,
- "gfid generated is %s (hash1: %" XXH64_FMT ") "
+ "gfid generated is %s (hash1: %" XXH64_FMT
+ ") "
"hash2: %" XXH64_FMT ", xxh64_1: %s xxh64_2: %s",
uuid_utoa(gfid), hash_1, hash_2, xxh64_1, xxh64_2);
@@ -5474,7 +5475,7 @@ gf_pipe(int fd[2], int flags)
int ret = 0;
#if defined(HAVE_PIPE2)
ret = pipe2(fd, flags);
-#else /* not HAVE_PIPE2 */
+#else /* not HAVE_PIPE2 */
ret = pipe(fd);
if (ret < 0)
return ret; |
/run regression |
@sac ☝️ |
@@ -59,6 +63,16 @@ | |||
#undef BIT_SET | |||
#endif | |||
|
|||
#if defined(HAVE_LIBXXHASH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use PRIx64? Both %ld and %lld are handled by PRIx64.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's kinda weird. PRIx64
is %lx
(unsigned long
) on a convenient 64-bit system but contrib/xxhash/xxhash.h
defines XXH64_hash_t
as unsigned long long
everywhere (so %llx
is needed everywhere as well). And never (as of >= 0.8) xxhash
defines XXH64_hash_t
as unsigned long
on 64-bit system and unsigned long long
on a 32-bit one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, still may be simplified to:
#if defined(HAVE_LIBXXHASH)
#define XXH64_FMT PRIx64
#else /* use from contrib */
#define XXH64_FMT "llx"
#endif /* HAVE_LIBXXHASH */
libglusterfs/src/common-utils.c
Outdated
@@ -50,7 +50,11 @@ | |||
#include "glusterfs/syscall.h" | |||
#include "glusterfs/globals.h" | |||
#define XXH_INLINE_ALL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which version of xxhash are you using? With xxhash-8.0 on ubuntu compile fails if XXH_NAMESPACE and XXH_INLINE_ALL are both defined. You may have to remove XXH_NAMESPACE.
xxhash.h
116 # ifdef XXH_NAMESPACE
117 # error "XXH_INLINE_ALL with XXH_NAMESPACE is not supported"
118 /*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.8.1. Don't see any issues with or without XXH_NAMESPACE
defined. Please share your error log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making all in src
make[1]: Entering directory '/tmp/glusterfs/libglusterfs/src'
make all-am
make[2]: Entering directory '/tmp/glusterfs/libglusterfs/src'
CC libglusterfs_la-common-utils.lo
In file included from common-utils.c:54:
/usr/include/xxhash.h:127:6: error: #error "XXH_INLINE_ALL with XXH_NAMESPACE is not supported"
127 | # error "XXH_INLINE_ALL with XXH_NAMESPACE is not supported"
| ^~~~~
make[2]: *** [Makefile:1105: libglusterfs_la-common-utils.lo] Error 1
make[2]: Leaving directory '/tmp/glusterfs/libglusterfs/src'
make[1]: *** [Makefile:894: all] Error 2
make[1]: Leaving directory '/tmp/glusterfs/libglusterfs/src'
make: *** [Makefile:467: all-recursive] Error 1
sac@kadalu:/tmp/glusterfs/libglusterfs$
And my package:
sac@kadalu:/tmp/glusterfs/libglusterfs$ apt-cache policy libxxhash0
libxxhash0:
Installed: 0.8.0-2build1
Candidate: 0.8.0-2build1
Version table:
*** 0.8.0-2build1 500
500 http://in.archive.ubuntu.com/ubuntu impish/main amd64 Packages
100 /var/lib/dpkg/status
sac@kadalu:/tmp/glusterfs/libglusterfs$
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... there is no such #error
neither in 0.8.1 nor in https://github.com/Cyan4973/xxHash/blob/dev/xxhash.h. It was removed in Cyan4973/xxHash@81d343d, so I would suggest to update to 0.8.1 and consider 0.8.0 as broken in this area.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, good find.
1 test(s) failed 0 test(s) generated core 5 test(s) needed retry 2 flaky test(s) marked as success even though they failed |
960f903
to
17b29ee
Compare
Otherwise everything looks good. |
CLANG-FORMAT FAILURE: index 316520545..56d6159d9 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -295,7 +295,8 @@ gf_gfid_generate_from_xxh64(uuid_t gfid, char *key)
}
gf_msg_debug(this->name, 0,
- "gfid generated is %s (hash1: %" XXH64_FMT ") "
+ "gfid generated is %s (hash1: %" XXH64_FMT
+ ") "
"hash2: %" XXH64_FMT ", xxh64_1: %s xxh64_2: %s",
uuid_utoa(gfid), hash_1, hash_2, xxh64_1, xxh64_2);
@@ -5466,7 +5467,7 @@ gf_pipe(int fd[2], int flags)
int ret = 0;
#if defined(HAVE_PIPE2)
ret = pipe2(fd, flags);
-#else /* not HAVE_PIPE2 */
+#else /* not HAVE_PIPE2 */
ret = pipe(fd);
if (ret < 0)
return ret; |
/run regression |
1 test(s) failed 0 test(s) generated core 3 test(s) needed retry 1 flaky test(s) marked as success even though they failed |
17b29ee
to
21002ef
Compare
CLANG-FORMAT FAILURE: index 316520545..56d6159d9 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -295,7 +295,8 @@ gf_gfid_generate_from_xxh64(uuid_t gfid, char *key)
}
gf_msg_debug(this->name, 0,
- "gfid generated is %s (hash1: %" XXH64_FMT ") "
+ "gfid generated is %s (hash1: %" XXH64_FMT
+ ") "
"hash2: %" XXH64_FMT ", xxh64_1: %s xxh64_2: %s",
uuid_utoa(gfid), hash_1, hash_2, xxh64_1, xxh64_2);
@@ -5466,7 +5467,7 @@ gf_pipe(int fd[2], int flags)
int ret = 0;
#if defined(HAVE_PIPE2)
ret = pipe2(fd, flags);
-#else /* not HAVE_PIPE2 */
+#else /* not HAVE_PIPE2 */
ret = pipe(fd);
if (ret < 0)
return ret; |
/run regression |
2 similar comments
/run regression |
/run regression |
1 test(s) failed 0 test(s) generated core 6 test(s) needed retry 2 flaky test(s) marked as success even though they failed |
This patch assumes that both
|
We'll need an issue / send a patch to https://github.com/gluster/project-infrastructure |
I have already raised a request for that and @mscherer has fixed the build machines. Please take a look at the issue and update the issue if you need anything more. Should you be adding the xxhash to the install list of packages in tests/vagrant/vagrant-template-centos6/roles/install-pkgs/tasks/main.yml and tests/vagrant/vagrant-template-fedora/roles/install-pkgs/tasks/main.yml ? |
So I can confirm that xxhash-devel is installed:
However, what is missing is xxhash directly. I am adding it. |
/run regression |
Use installed xxhash library and xxhsum binary if found, fallback to use everything from contrib/xxhash otherwise, adjust gfid2path FUSE and NFS tests accordingly. Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com> Updates: gluster#1000
21002ef
to
adae433
Compare
CLANG-FORMAT FAILURE: index 316520545..56d6159d9 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -295,7 +295,8 @@ gf_gfid_generate_from_xxh64(uuid_t gfid, char *key)
}
gf_msg_debug(this->name, 0,
- "gfid generated is %s (hash1: %" XXH64_FMT ") "
+ "gfid generated is %s (hash1: %" XXH64_FMT
+ ") "
"hash2: %" XXH64_FMT ", xxh64_1: %s xxh64_2: %s",
uuid_utoa(gfid), hash_1, hash_2, xxh64_1, xxh64_2);
@@ -5466,7 +5467,7 @@ gf_pipe(int fd[2], int flags)
int ret = 0;
#if defined(HAVE_PIPE2)
ret = pipe2(fd, flags);
-#else /* not HAVE_PIPE2 */
+#else /* not HAVE_PIPE2 */
ret = pipe(fd);
if (ret < 0)
return ret; |
/run regression |
Use installed
xxhash
library andxxhsum
binary if found,fallback to use everything from
contrib/xxhash
otherwise,adjust
gfid2path
FUSE and NFS tests accordingly.Signed-off-by: Dmitry Antipov dantipov@cloudlinux.com
Updates: #1000