Skip to content

Commit 8352b86

Browse files
authored
Enable pickyness by default in Git repo builds (#2631)
* Enable pickyness by default in Git repo builds Just to avoid committing things that fail the enable-devel-check builds. Includes several fixes to get the CI environments to build under this setting. Signed-off-by: Ralph Castain <[email protected]>
1 parent 03a8194 commit 8352b86

File tree

9 files changed

+52
-37
lines changed

9 files changed

+52
-37
lines changed

config/pmix.m4

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,6 @@ AC_DEFUN([PMIX_SETUP_CORE],[
185185
AC_DEFINE_UNQUOTED([PMIX_REPO_REV], ["$PMIX_REPO_REV"],
186186
[The OpenPMIx Git Revision])
187187

188-
# A hint to tell us if we are working with a build from Git or a tarball.
189-
# Helpful when preparing diagnostic output.
190-
if test -e $PMIX_TOP_SRCDIR/.git; then
191-
AC_DEFINE_UNQUOTED([PMIX_GIT_REPO_BUILD], ["1"],
192-
[If built from a git repo])
193-
fi
194-
195188
PMIX_RELEASE_DATE="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --release-date`"
196189
if test "$?" != "0"; then
197190
AC_MSG_ERROR([Cannot continue])
@@ -1017,6 +1010,15 @@ AC_DEFUN([PMIX_SETUP_CORE],[
10171010
])dnl
10181011

10191012
AC_DEFUN([PMIX_DEFINE_ARGS],[
1013+
1014+
# A hint to tell us if we are working with a build from Git or a tarball.
1015+
# Helpful when preparing diagnostic output.
1016+
if test -e $PMIX_TOP_SRCDIR/.git; then
1017+
AC_DEFINE_UNQUOTED([PMIX_GIT_REPO_BUILD], ["1"],
1018+
[If built from a git repo])
1019+
pmix_git_repo_build=yes
1020+
fi
1021+
10201022
# do we want dlopen support ?
10211023
AC_MSG_CHECKING([if want dlopen support])
10221024
AC_ARG_ENABLE([dlopen],
@@ -1047,6 +1049,12 @@ AC_ARG_ENABLE(devel-check,
10471049
if test "$enable_devel_check" = "yes"; then
10481050
AC_MSG_RESULT([yes])
10491051
WANT_PICKY_COMPILER=1
1052+
elif test "$enable_devel_check" = "no"; then
1053+
AC_MSG_RESULT([no])
1054+
WANT_PICKY_COMPILER=0
1055+
elif test "$pmix_git_repo_build" = "yes"; then
1056+
AC_MSG_RESULT([yes])
1057+
WANT_PICKY_COMPILER=1
10501058
else
10511059
AC_MSG_RESULT([no])
10521060
WANT_PICKY_COMPILER=0

examples/server.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ int main(int argc, char **argv)
301301
PMIX_RELEASE(x);
302302

303303
/* fork/exec the test */
304-
(void) strncpy(proc.nspace, "foobar", PMIX_MAX_NSLEN);
304+
PMIX_LOAD_NSPACE(proc.nspace, "foobar");
305305
for (n = 0; n < nprocs; n++) {
306306
proc.rank = n;
307307
if (PMIX_SUCCESS != (rc = PMIx_server_setup_fork(&proc, &client_env))) { // n
@@ -419,39 +419,39 @@ static void set_namespace(int nprocs, char *ranks, char *nspace, pmix_op_cbfunc_
419419
}
420420
PMIX_DESTRUCT(&myxfer);
421421

422-
(void) strncpy(x->info[i].key, PMIX_UNIV_SIZE, PMIX_MAX_KEYLEN);
422+
PMIX_LOAD_KEY(x->info[i].key, PMIX_UNIV_SIZE);
423423
x->info[i].value.type = PMIX_UINT32;
424424
x->info[i].value.data.uint32 = nprocs;
425425

426426
++i;
427-
(void) strncpy(x->info[i].key, PMIX_SPAWNED, PMIX_MAX_KEYLEN);
427+
PMIX_LOAD_KEY(x->info[i].key, PMIX_SPAWNED);
428428
x->info[i].value.type = PMIX_UINT32;
429429
x->info[i].value.data.uint32 = 0;
430430

431431
++i;
432-
(void) strncpy(x->info[i].key, PMIX_LOCAL_SIZE, PMIX_MAX_KEYLEN);
432+
PMIX_LOAD_KEY(x->info[i].key, PMIX_LOCAL_SIZE);
433433
x->info[i].value.type = PMIX_UINT32;
434434
x->info[i].value.data.uint32 = nprocs;
435435

436436
++i;
437-
(void) strncpy(x->info[i].key, PMIX_LOCAL_PEERS, PMIX_MAX_KEYLEN);
437+
PMIX_LOAD_KEY(x->info[i].key, PMIX_LOCAL_PEERS);
438438
x->info[i].value.type = PMIX_STRING;
439439
x->info[i].value.data.string = strdup(ranks);
440440

441441
++i;
442442
PMIx_generate_regex(hostname, &regex);
443-
(void) strncpy(x->info[i].key, PMIX_NODE_MAP, PMIX_MAX_KEYLEN);
443+
PMIX_LOAD_KEY(x->info[i].key, PMIX_NODE_MAP);
444444
x->info[i].value.type = PMIX_STRING;
445445
x->info[i].value.data.string = regex;
446446

447447
++i;
448448
PMIx_generate_ppn(ranks, &ppn);
449-
(void) strncpy(x->info[i].key, PMIX_PROC_MAP, PMIX_MAX_KEYLEN);
449+
PMIX_LOAD_KEY(x->info[i].key, PMIX_PROC_MAP);
450450
x->info[i].value.type = PMIX_STRING;
451451
x->info[i].value.data.string = ppn;
452452

453453
++i;
454-
(void) strncpy(x->info[i].key, PMIX_JOB_SIZE, PMIX_MAX_KEYLEN);
454+
PMIX_LOAD_KEY(x->info[i].key, PMIX_JOB_SIZE);
455455
x->info[i].value.type = PMIX_UINT32;
456456
x->info[i].value.data.uint32 = nprocs;
457457

@@ -528,14 +528,14 @@ static pmix_status_t abort_fn(const pmix_proc_t *proc, void *server_object, int
528528
/* use the myxfer_t object to ensure we release
529529
* the caller when notification has been queued */
530530
x = PMIX_NEW(myxfer_t);
531-
(void) strncpy(x->caller.nspace, proc->nspace, PMIX_MAX_NSLEN);
531+
PMIX_LOAD_NSPACE(x->caller.nspace, proc->nspace);
532532
x->caller.rank = proc->rank;
533533

534534
PMIX_INFO_CREATE(x->info, 2);
535-
(void) strncpy(x->info[0].key, "DARTH", PMIX_MAX_KEYLEN);
535+
PMIX_LOAD_KEY(x->info[0].key, "DARTH");
536536
x->info[0].value.type = PMIX_INT8;
537537
x->info[0].value.data.int8 = 12;
538-
(void) strncpy(x->info[1].key, "VADER", PMIX_MAX_KEYLEN);
538+
PMIX_LOAD_KEY(x->info[1].key, "VADER");
539539
x->info[1].value.type = PMIX_DOUBLE;
540540
x->info[1].value.data.dval = 12.34;
541541
x->cbfunc = cbfunc;
@@ -589,9 +589,9 @@ static pmix_status_t publish_fn(const pmix_proc_t *proc, const pmix_info_t info[
589589

590590
for (n = 0; n < ninfo; n++) {
591591
p = PMIX_NEW(pmix_locdat_t);
592-
(void) strncpy(p->pdata.proc.nspace, proc->nspace, PMIX_MAX_NSLEN);
592+
PMIX_LOAD_NSPACE(p->pdata.proc.nspace, proc->nspace);
593593
p->pdata.proc.rank = proc->rank;
594-
(void) strncpy(p->pdata.key, info[n].key, PMIX_MAX_KEYLEN);
594+
PMIX_LOAD_KEY(p->pdata.key, info[n].key);
595595
PMIx_Value_xfer(&p->pdata.value, (pmix_value_t *) &info[n].value);
596596
pmix_list_append(&pubdata, &p->super);
597597
}
@@ -619,9 +619,9 @@ static pmix_status_t lookup_fn(const pmix_proc_t *proc, char **keys, const pmix_
619619
PMIX_LIST_FOREACH (p, &pubdata, pmix_locdat_t) {
620620
if (0 == strncmp(keys[n], p->pdata.key, PMIX_MAX_KEYLEN)) {
621621
p2 = PMIX_NEW(pmix_locdat_t);
622-
(void) strncpy(p2->pdata.proc.nspace, p->pdata.proc.nspace, PMIX_MAX_NSLEN);
622+
PMIX_LOAD_NSPACE(p2->pdata.proc.nspace, p->pdata.proc.nspace);
623623
p2->pdata.proc.rank = p->pdata.proc.rank;
624-
(void) strncpy(p2->pdata.key, p->pdata.key, PMIX_MAX_KEYLEN);
624+
PMIX_LOAD_KEY(p2->pdata.key, p->pdata.key);
625625
PMIx_Value_xfer(&p2->pdata.value, &p->pdata.value);
626626
pmix_list_append(&results, &p2->super);
627627
break;
@@ -634,9 +634,9 @@ static pmix_status_t lookup_fn(const pmix_proc_t *proc, char **keys, const pmix_
634634
for (i = 0; i < n; i++) {
635635
p = (pmix_locdat_t *) pmix_list_remove_first(&results);
636636
if (p) {
637-
(void) strncpy(pd[i].proc.nspace, p->pdata.proc.nspace, PMIX_MAX_NSLEN);
637+
PMIX_LOAD_NSPACE(pd[i].proc.nspace, p->pdata.proc.nspace);
638638
pd[i].proc.rank = p->pdata.proc.rank;
639-
(void) strncpy(pd[i].key, p->pdata.key, PMIX_MAX_KEYLEN);
639+
PMIX_LOAD_KEY(pd[i].key, p->pdata.key);
640640
PMIx_Value_xfer(&pd[i].value, &p->pdata.value);
641641
}
642642
}
@@ -789,7 +789,7 @@ static pmix_status_t query_fn(pmix_proc_t *proct, pmix_query_t *queries, size_t
789789
/* keep this simple */
790790
PMIX_INFO_CREATE(info, nqueries);
791791
for (n = 0; n < nqueries; n++) {
792-
(void) strncpy(info[n].key, queries[n].keys[0], PMIX_MAX_KEYLEN);
792+
PMIX_LOAD_KEY(info[n].key, queries[n].keys[0]);
793793
info[n].value.type = PMIX_STRING;
794794
if (0 > asprintf(&info[n].value.data.string, "%d", (int) n)) {
795795
return PMIX_ERROR;
@@ -808,7 +808,7 @@ static void tool_connect_fn(pmix_info_t *info, size_t ninfo, pmix_tool_connectio
808808
pmix_output(0, "SERVER: TOOL CONNECT");
809809

810810
/* just pass back an arbitrary nspace */
811-
(void) strncpy(proc.nspace, "TOOL", PMIX_MAX_NSLEN);
811+
PMIX_LOAD_NSPACE(proc.nspace, "TOOL");
812812
proc.rank = 0;
813813

814814
if (NULL != cbfunc) {

src/include/pmix_stdint.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Copyright (c) 2016 Research Organization for Information Science
1616
* and Technology (RIST). All rights reserved.
1717
* Copyright (c) 2018 Intel, Inc. All rights reserved.
18-
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
18+
* Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
1919
* $COPYRIGHT$
2020
*
2121
* Additional copyrights may follow
@@ -97,7 +97,7 @@ typedef signed long intptr_t;
9797
typedef unsigned long uintptr_t;
9898
# endif
9999

100-
#elif HAVE_LONG_LONG && SIZEOF_VOID_P == SIZEOF_LONG_LONG
100+
#elif HAVE_LONG_LONG && defined(SIZEOF_LONG_LONG) && SIZEOF_VOID_P == SIZEOF_LONG_LONG
101101

102102
# ifndef HAVE_INTPTR_T
103103
typedef signed long long intptr_t;
@@ -120,7 +120,7 @@ typedef unsigned long long uintptr_t;
120120
# define PRIsize_t "zu"
121121
# elif SIZEOF_SIZE_T == SIZEOF_LONG
122122
# define PRIsize_t "lu"
123-
# elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
123+
# elif defined(SIZEOF_LONG_LONG) && SIZEOF_SIZE_T == SIZEOF_LONG_LONG
124124
# define PRIsize_t "llu"
125125
# else
126126
# define PRIsize_t "u"

src/mca/base/pmix_mca_base_component_repository.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ static int file_exists(const char *filename, const char *ext)
211211
int pmix_mca_base_component_repository_add(const char *project,
212212
const char *path)
213213
{
214-
PMIX_HIDE_UNUSED_PARAMS(path);
215214
#if PMIX_HAVE_PDL_SUPPORT
216215
char *path_to_use = NULL, *dir, *ctx;
217216
const char sep[] = {PMIX_ENV_SEP, '\0'};
@@ -236,7 +235,8 @@ int pmix_mca_base_component_repository_add(const char *project,
236235
} while (NULL != (dir = strtok_r(NULL, sep, &ctx)));
237236

238237
free(path_to_use);
239-
238+
#else
239+
PMIX_HIDE_UNUSED_PARAMS(project, path);
240240
#endif /* PMIX_HAVE_PDL_SUPPORT */
241241

242242
return PMIX_SUCCESS;

src/mca/base/pmix_mca_base_open.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ static void parse_verbose(char *e, pmix_output_stream_t *lds);
6868
*/
6969
int pmix_mca_base_open(const char *add_path)
7070
{
71-
char *value, **paths = NULL, *cptr;
71+
#if PMIX_WANT_HOME_CONFIG_FILES
72+
char *value;
73+
#endif
74+
char **paths = NULL, *cptr;
7275
pmix_output_stream_t lds;
7376
char hostname[PMIX_MAXHOSTNAMELEN] = {0};
7477
int var_id;

src/mca/gds/shmem/pmix_hash2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ pmix_status_t pmix_hash2_fetch(pmix_hash_table2_t *table,
320320
pmix_status_t rc = PMIX_SUCCESS;
321321
pmix_proc_data2_t *proc_data;
322322
pmix_dstor_t *hv;
323-
uint32_t id, kid;
323+
uint32_t id, kid=UINT32_MAX;
324324
char *node;
325325
pmix_regattr_input_t *p;
326326
pmix_info_t *iptr;
@@ -507,7 +507,7 @@ pmix_status_t pmix_hash2_remove_data(pmix_hash_table2_t *table,
507507
pmix_status_t rc = PMIX_SUCCESS;
508508
pmix_proc_data2_t *proc_data;
509509
pmix_dstor_t *d;
510-
uint32_t id, kid;
510+
uint32_t id, kid=UINT32_MAX;
511511
int n;
512512
char *node;
513513
pmix_regattr_input_t *p;

src/mca/psec/munge/psec_munge.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ static pmix_status_t create_cred(struct pmix_peer_t *peer, const pmix_info_t dir
9797
bool takeus;
9898
char **types;
9999
size_t n, m;
100+
PMIX_HIDE_UNUSED_PARAMS(peer);
100101

101102
PMIX_ACQUIRE_THREAD(&lock);
102103

src/util/pmix_hash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ pmix_status_t pmix_hash_fetch(pmix_hash_table_t *table,
254254
pmix_status_t rc = PMIX_SUCCESS;
255255
pmix_proc_data_t *proc_data;
256256
pmix_dstor_t *hv;
257-
uint32_t id, kid;
257+
uint32_t id, kid=UINT32_MAX;
258258
char *node;
259259
pmix_regattr_input_t *p;
260260
pmix_info_t *iptr;
@@ -411,7 +411,7 @@ pmix_status_t pmix_hash_remove_data(pmix_hash_table_t *table,
411411
pmix_status_t rc = PMIX_SUCCESS;
412412
pmix_proc_data_t *proc_data;
413413
pmix_dstor_t *d;
414-
uint32_t id, kid;
414+
uint32_t id, kid=UINT32_MAX;
415415
int n;
416416
char *node;
417417
pmix_regattr_input_t *p;

test/util/numa.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
int main(int argc, char **argv)
1010
{
1111
hwloc_topology_t topo;
12-
int ret, num, weight, N;
12+
#if HWLOC_API_VERSION >= 0x20000
13+
int ret;
14+
#endif
15+
int num, weight, N;
1316
hwloc_obj_t obj;
1417
unsigned width, w;
1518
hwloc_bitmap_t numas[100], result;

0 commit comments

Comments
 (0)