-
Notifications
You must be signed in to change notification settings - Fork 305
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
DAOS-15961 cart: Reorganize how envs are handled #14504
Conversation
Change to how cart deals with envariables: - env list is now controlled by CRT_ENV_LIST macro in crt_types_internal.h - all envs stored in structure generated from CRT_ENV_LST (g_env) now, ENV is read out at crt_env_init() time and env strings deallocated at crt_env_fini(). - accsor functions/macros crt_env_init/fini/get/dump are provided. - string-type envs no longer need to be freed after retrieval. With this change, any env to be used will need to appear on the list first, ensuring it gets dumped as well as ensuring proper name usage later. Env name typos when using crt_env_get() will now result in compile time errors Required-githooks: true Signed-off-by: Alexander A Oganezov <[email protected]>
Required-githooks: true Signed-off-by: Alexander A Oganezov <[email protected]>
Ticket title is 'Reorganize how cart handles envariables' |
Test stage Build on Leap 15.5 with Intel-C and TARGET_PREFIX completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14504/2/execution/node/384/log |
Test stage Build RPM on EL 9 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14504/2/execution/node/315/log |
Test stage Build RPM on Leap 15.5 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14504/2/execution/node/308/log |
Test stage Build RPM on EL 8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14504/2/execution/node/318/log |
Test stage Build DEB on Ubuntu 20.04 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14504/2/execution/node/358/log |
Required-githooks: true Signed-off-by: Alexander A Oganezov <[email protected]>
Test stage NLT on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-14504/3/testReport/ |
Test stage Functional on EL 8.8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14504/3/execution/node/1188/log |
- add flag to indicate whether g_envs was inited - assert on crt_env_get() if called when env is not inited - move crt_env_get() in utils after crt_init() Required-githooks: true Signed-off-by: Alexander A Oganezov <[email protected]>
Test stage NLT on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-14504/4/testReport/ |
Required-githooks: true Signed-off-by: Alexander A Oganezov <[email protected]>
Test stage NLT on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-14504/5/testReport/ |
Test stage Functional on EL 8.8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14504/6/execution/node/1184/log |
Required-githooks: true Signed-off-by: Alexander A Oganezov <[email protected]>
Test stage Functional on EL 8.8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14504/9/execution/node/1229/log |
setting and querying env. Required-githooks: true Signed-off-by: Alexander A Oganezov <[email protected]>
Required-githooks: true Signed-off-by: Alexander A Oganezov <[email protected]>
Test stage Build on Leap 15.5 with Intel-C and TARGET_PREFIX completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14504/11/execution/node/502/log |
Required-githooks: true Signed-off-by: Alexander A Oganezov <[email protected]>
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.
a few minor things but looks good to me otherwise.
src/cart/crt_init.c
Outdated
@@ -13,48 +13,11 @@ | |||
#include "crt_internal.h" | |||
|
|||
struct crt_gdata crt_gdata; | |||
struct crt_envs_t g_envs; |
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.
we should be consistent and prefix global variables with crt_, even more if it's not static.
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.
ok
src/cart/crt_init.c
Outdated
@@ -90,6 +53,9 @@ crt_lib_init(void) | |||
crt_gdata.cg_rpcid = start_rpcid; | |||
crt_gdata.cg_num_cores = sysconf(_SC_NPROCESSORS_ONLN); | |||
crt_gdata.cg_iv_inline_limit = 19456; /* 19KB */ | |||
|
|||
/* envs not inited until crt_init() time */ | |||
memset(&g_envs, 0x0, sizeof(struct crt_envs_t)); |
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.
you could do sizeof(g_envs)
to not worry about the type.
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.
ok
src/cart/crt_internal_types.h
Outdated
|
||
#define ENV_STR_NO_PRINT(x) ENV_STR(x) | ||
|
||
struct crt_envs_t { |
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.
we should not not use _t
after struct names :)
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.
ok
src/cart/crt_internal_types.h
Outdated
#undef ENV_STR | ||
#undef ENV_STR_NO_PRINT | ||
|
||
extern struct crt_envs_t g_envs; |
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.
ideally you'd want to use __attribute__ ((visibility ("hidden")))
for all global private declarations so that they remain hidden from public users.
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.. i remember before we had something in scons to make everything hidden by default, but i cant find it. Does it ring any bells @jolivier23 ?
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.
anyway, i tried adding visibility hidden here and it has issues linking numerous files:
build/release/gcc/src/cart/utils/s_crt_utils.os: In function
write_completion_file':
/home/aaoganez/github/daos_master/src/cart/utils/crt_utils.c:104: undefined reference to crt_genvs' /home/aaoganez/github/daos_master/src/cart/utils/crt_utils.c:104: undefined reference to
crt_genvs'
/home/aaoganez/github/daos_master/src/cart/utils/crt_utils.c:104: undefined reference to crt_genvs'
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.
Ah ok well if you use it in crt_utils then it's not really private 😄
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.
Yeah, we did this in CPPR and IOF via an option to the linker and then defined a PUBLIC define to mark things visible
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.
Looks like it carried over to src/client/dfuse/SConstruct where we set -fvisibility=hidden and then we use DFUSE_PUBLIC to mark the visible routines.
Required-githooks: true Signed-off-by: Alexander A Oganezov <[email protected]>
Change to how cart deals with envariables: - env list is now controlled by CRT_ENV_LIST macro in crt_types_internal.h - all envs stored in structure generated from CRT_ENV_LST (crrt_genv) now, ENV is read out at crt_env_init() time and env strings deallocated at crt_env_fini(). - accsor functions/macros crt_env_init/fini/get/dump are provided. - string-type envs no longer need to be freed after retrieval. - Change cart utility function to populate crt_init_options_t instead of setting and querying env. With this change, any env to be used will need to appear on the list first, ensuring it gets dumped as well as ensuring proper name usage later. Env name typos when using crt_env_get() will now result in compile time errors Required-githooks: true Signed-off-by: Alexander A Oganezov <[email protected]>
Change to how cart deals with envariables: - env list is now controlled by CRT_ENV_LIST macro in crt_types_internal.h - all envs stored in structure generated from CRT_ENV_LST (crrt_genv) now, ENV is read out at crt_env_init() time and env strings deallocated at crt_env_fini(). - accsor functions/macros crt_env_init/fini/get/dump are provided. - string-type envs no longer need to be freed after retrieval. - Change cart utility function to populate crt_init_options_t instead of setting and querying env. With this change, any env to be used will need to appear on the list first, ensuring it gets dumped as well as ensuring proper name usage later. Env name typos when using crt_env_get() will now result in compile time errors Required-githooks: true Signed-off-by: Alexander A Oganezov <[email protected]>
Change to how cart deals with envariables: - env list is now controlled by CRT_ENV_LIST macro in crt_types_internal.h - all envs stored in structure generated from CRT_ENV_LST (crrt_genv) now, ENV is read out at crt_env_init() time and env strings deallocated at crt_env_fini(). - accsor functions/macros crt_env_init/fini/get/dump are provided. - string-type envs no longer need to be freed after retrieval. - Change cart utility function to populate crt_init_options_t instead of setting and querying env. With this change, any env to be used will need to appear on the list first, ensuring it gets dumped as well as ensuring proper name usage later. Env name typos when using crt_env_get() will now result in compile time errors Signed-off-by: Alexander A Oganezov <[email protected]>
Change to how cart deals with envariables:
With this change, any env to be used will need to appear on the list first, ensuring it gets dumped as well as ensuring proper name usage later. Env name typos when using crt_env_get() will now result in compile time errors
Required-githooks: true
Before requesting gatekeeper:
Features:
(orTest-tag*
) commit pragma was used or there is a reason documented that there are no appropriate tags for this PR.Gatekeeper: