Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#780] [V70000] Address merge conflicts involving deleted files
* This commit addresses merge conflicts involving deleted files. * The list of deleted files was identified using the following commands as part of the prior commit (i.e. after the `git cherry-pick` command was run but before the `git commit` command was run). ```sh $ git status | grep 'deleted' deleted: sr_unix/buildaux_dbcertify.csh deleted: sr_unix/buildaux_ftok.csh deleted: sr_unix/buildaux_semstat2.csh deleted: sr_unix/dbcertify_cmd.c deleted: sr_unix/dbcertify_dbfilop.c deleted: sr_unix/dbcertify_parse_and_dispatch.c deleted by us: README deleted by us: sr_i386/cmerrors_ctl.c deleted by us: sr_i386/cmierrors_ctl.c deleted by us: sr_i386/gdeerrors_ctl.c deleted by them: sr_port/dbcertify.c deleted by them: sr_port/dbcertify.h deleted by them: sr_port/dbcertify_base_ch.c deleted by them: sr_port/dbcertify_certify_phase.c deleted by them: sr_port/dbcertify_funcs.c deleted by them: sr_port/dbcertify_scan_phase.c deleted by them: sr_port/dsewrap.mpt deleted by us: sr_port/get_spec.c deleted by them: sr_port/v5cbsu.m deleted by us: sr_unix/Makefile.mk deleted by them: sr_unix/dbcertify_deferred_exit_handler.c deleted by them: sr_unix/dbcertify_signal_handler.c deleted by them: sr_unix/ftok.c deleted by us: sr_unix/gtcmstub.c deleted by us: sr_unix/gtm_startup_chk.c deleted by us: sr_unix/gtm_test_install.csh deleted by us: sr_unix/gtm_tls_impl.c deleted by us: sr_unix/gtmcrypt_dbk_ref.c deleted by us: sr_unix/gtmcrypt_dbk_ref.h deleted by us: sr_unix/gtmcrypt_pk_ref.c deleted by us: sr_unix/gtmcrypt_ref.c deleted by us: sr_unix/gtmcrypt_util.c deleted by us: sr_unix/gtmcrypt_util.h deleted by us: sr_unix/gtminstall.sh deleted by us: sr_unix/gtmprofile.gtc deleted by us: sr_unix/kitstart.csh deleted by them: sr_unix/semstat2.c deleted by us: sr_unix_cm/rc_mval2subsc.c deleted by us: sr_unix_gnp/libgnpserver.list deleted by us: sr_x86_64/merrors_ansi.h deleted by us: sr_x86_64/merrors_ctl.c ``` * Those files that show up as just `deleted:` in the output above need no changes in this commit. This is because they would have been automatically deleted in the prior commit itself as those files were already deleted in the YottaDB side and were deleted in GT.M V7.0-000 in the GT.M side. * All files that show up as `deleted by us:` are deleted in this commit since those were deleted even before in the YDB git repository. That is a straightforward change. But each of these files needed to be reviewed to see if the GT.M changes to each file needs to be incorporated somewhere else in the YDB git repository. They are described below. - README : This file only has cosmetic changes in every GT.M release. No need to incorporate this into the README.md file (corresponding file in the YDB repository). - The following are all generated files and will be regenerated on the YDB side in a later commit so no need to incorporate any changes. The `sr_i386` files won't be regenerated as YottaDB does not support that architecture. Only the `sr_x86_64` files will be regenerated. - sr_i386/cmerrors_ctl.c - sr_i386/cmierrors_ctl.c - sr_i386/gdeerrors_ctl.c - sr_x86_64/merrors_ansi.h - sr_x86_64/merrors_ctl.c - sr_port/get_spec.c : This file was changed in the GT.M side to replace a `rts_error_csa()` call that issued a ERR_INVSPECREC error with the new `RTS_ERROR_CSA_ABT()` call. But as part of 0b74bdc, we had moved this error to only be issued from `mu_int_blk.c` and we use the `mu_int_err()` function to issue the error there. So no need to incorporate the GT.M changes. - sr_unix/Makefile.mk : This file was changed to issue a `UTF-8 mode library installation may fail if gtm_icu_version is not set` warning in the GT.M side. That warning had already been added to `YDBEncrypt/Makefile` in the YottaDB side as part of the first commit. So no need to incorporate the GT.M changes. - sr_unix/gtcmstub.c : This file was changed in the GT.M side to replace a `rts_error()` call with `RTS_ERROR_ABT()`. No other real change. Since this file itself has been deleted on the YottaDB side, no need to incorporate this otherwise cosmetic GT.M change. - sr_unix/gtm_startup_chk.c : The GT.M changes were - In the `gtm_chk_dist()` function to change `rts_error_csa()` with `RTS_ERROR_CSA_ABT` and remove the `CSA_ARG` from `CSA_ARG(NULL)` usages (as the first parameter). Those changes are now incorporated into `sr_unix/ydb_chk_dist.c` which is the corresponding YottaDB file. - `gtm_dist_len` was moved from being a local variable to a global variable. This change was not incorporated because I think it has a bug hidden inside. The `gtm_chk_dist()` function does a `realpath()` call on the string stored in `gtm_dist[]` global buffer and stores the result in a local variable `real_gtm_dist_path[]`. And then it does a `STRNLEN(real_dist, GTM_PATH_MAX, gtm_dist_len);` call where `real_dist` is a pointer to `real_gtm_dist_path[]`. This call will reset the global variable `gtm_dist_len` to the real path length of the path stored in `gtm_dist[]`. In case that happens to be a soft link that points to a much longer actual path name, `gtm_dist_len` after this point will contain the length of the much longer actual path name whereas `gtm_dist[]` will continue to point to the shorter soft link path name. The two will become out of sync. This can cause problems later when they are used for example in `sr_unix/secshr_client.c` where one copies this buffer using the out-of-sync length into the `gtmsecshr_path` buffer (e.g. `memcpy(gtmsecshr_path, gtm_dist, gtm_dist_len);`). In this case, `gtmsecshr_pathname.len` is set to include `gtm_dist_len` and so would hold an inflated value. And can cause confusing error messages. All of this only if `$gtm_dist` is a soft link to another path. In any case, all of this complexity can be avoided by not updating the global variable `gtm_dist_len` in this file and is why the GT.M change is not incorporated into `sr_unix/ydb_chk_dist.c`. - sr_unix/gtm_test_install.csh : This file was removed in the YottaDB side a while ago. So no need to incorporate any GT.M changes. - sr_unix/gtm_tls_impl.c : This file had been moved to YDBEncrypt/gtm_tls_impl.c (a different git repository) so I had to use the following commands to incorporate the changes. The following command (run in the YDB git repo) creates a patch file containing the GT.M V7.0-000 changes. ```sh cd YDB git show tags/V7.0-000 -- sr_unix/gtm_tls_impl.c > /tmp/patch ``` The following command (run in the YDBEncrypt git repo) applies the patch to the YDBEncrypt repo file. ```sh cd YDBEncrypt patch -i /tmp/patch gtm_tls_impl.c ``` The patch command produced the following output. ``` Hunk #1 succeeded at 1 with fuzz 1. Hunk #2 succeeded at 711 (offset 37 lines). Hunk #3 FAILED at 827. Hunk #4 FAILED at 836. Hunk #5 succeeded at 1175 (offset 38 lines). Hunk #6 succeeded at 1386 (offset 41 lines). Hunk #7 FAILED at 1358. Hunk #8 FAILED at 1430. Hunk #9 succeeded at 1753 (offset 83 lines). 4 out of 9 hunks FAILED -- saving rejects to file gtm_tls_impl.c.rej ``` The 5 Hunks that succeeded needed no intervention. The 4 Hunks that FAILED needed more review/intervention. Let us take `Hunk #3` as an example. I looked at `gtm_tls_impl.c.rej` (created by the patch command) and found the first hunk there. This would be `Hunk #3` since that was the first FAILED Hunk in the above output. Below is the corresponding diff. ```diff @@ -827,8 +827,9 @@ STATICFNDEF gtmtls_passwd_list_t *gtm_tls_find_pwent(const char *input_env_name) int gtm_tls_store_passwd(gtm_tls_ctx_t *tls_ctx, const char *tlsid, const char *obs_passwd) { - char *env_name_ptr, env_name[PASSPHRASE_ENVNAME_MAX]; - int env_name_len, obs_len; + char env_name[PASSPHRASE_ENVNAME_MAX]; + size_t env_name_idx; + size_t env_name_len, obs_len; gtmtls_passwd_list_t *pwent_node; passwd_entry_t *pwent; ``` The reason the patch failed is because the variables `env_name_ptr`, `env_name` and `env_name_len` have been removed in YDBEncrypt/gtm_tls_impl.c. So I discarded that part of the diff. But found that the type of `obs_len` has been changed from `int` to `size_t`. Therefore manually incorporated just that change into YDBEncrypt/gtm_tls_impl.c. Similar analysis/incorporation was done for each FAILED Hunk in the above output. Once all FAILED Hunks were addressed, the following files were removed as they were no longer needed. - gtm_tls_impl.c.orig - gtm_tls_impl.c.rej At a high level, all GT.M changes were picked up from the FAILED Hunks (`Hunk 4`, `Hunk 7` and `Hunk 8`). - sr_unix/gtmcrypt_dbk_ref.c : Used the same procedure as described in the `sr_unix/gtm_tls_impl.c` bullet above, merged the GT.M changes from YDB to YDBEncrypt/gtmcrypt_dbk_ref.c. - sr_unix/gtmcrypt_dbk_ref.h : This one was also a YDB -> YDBEncrypt patch merge. This one succeeded without any FAILED Hunks. - sr_unix/gtmcrypt_pk_ref.c : This one was also a YDB -> YDBEncrypt patch merge. This one has 1 FAILED Hunk. Manually retrofitted GT.M change on the FAILED Hunk. - sr_unix/gtmcrypt_ref.c : This one was also a YDB -> YDBEncrypt patch merge. This one succeeded without any FAILED Hunks. - sr_unix/gtmcrypt_util.c : This one was also a YDB -> YDBEncrypt patch merge. This one has 1 FAILED Hunk. Manually retrofitted GT.M change on the FAILED Hunk. - sr_unix/gtmcrypt_util.h : This one was also a YDB -> YDBEncrypt patch merge. This one has 1 FAILED Hunk. Manually retrofitted GT.M change on the FAILED Hunk. - sr_unix/gtminstall.sh : This one was a YDB -> YDB patch merge. From sr_unix/gtminstall.sh to sr_unix/ydbinstall.sh. This one was complicated because in the GT.M side, they removed support for a specific ICU version when specifying `--utf8`. Previously one needed to specify `--utf8 default` or `--utf8 7.1` (to indicate ICU version 7.1 needs to be used etc.). Since the GT.M change to no longer require `default` made sense, that was picked to be retrofitted onto the YottaDB side. Since `--utf8 default` is used in a lot of places across various YDB repositories (see list below) and could be relied upon by some user, it was decided to continue supporting it but treat it as if `--utf8` was specified (i.e. without `default`). But if the user specified `--utf8 7.1`, that will issue an error even in ydbinstall.sh as it is no longer a supported usage. In addition, found 8fe2516 had made a change to set `tmpdir` variable but the immediately next line used `$tmp` instead of `$tmpdir` to set `ydb_routines` env var. This clearly will result in a broken `ydb_routines` env var since `$tmp` will be the empty string in that case. But this did not break `ydbinstall.sh --plugins-only` so far so I concluded that setting `ydb_routines` was unnecessary altogether. So I removed that line instead of fixing the `$tmp` occurrence to `$tmpdir`. Additionally, I found a lot of `--utf8 default` usages across various repositories. Fixed all of those as well. The 2 `YDB` occurrences below were fixed in this commit. The occurrences in other repos were fixed in commits in those repos. ```sh YDBDoc/Plugins/ydbaim.rst: sudo ./ydbinstall.sh --utf8 default --verbose --aim YDBDoc/Plugins/ydbzlib.rst: sudo ./ydbinstall.sh --utf8 default --verbose --zlib YDBDoc/AdminOpsGuide/installydb.rst: sudo --preserve-env=ydb_icu_version ./ydbinstall.sh --installdir /opt/yottadb/ --utf8 default --verbose YDBDoc/AdminOpsGuide/installydb.rst: sudo --preserve-env=ydb_icu_version ./ydbinstall.sh --utf8 default --verbose YDBDoc/AdminOpsGuide/installydb.rst:For example, :code:`ydbinstall --from-source https://gitlab.com/ydbuser/YDB.git --branch working --utf8 default --aim --install-directory /usr/local/lib/yottadb/devel_$(date +%Y%m%d)` will checkout, build, and install the :code:`working` branch of YottaDB from the YDB repository of GitLab user :code:`ydbuser` in a date-stamped directory, along with the `Application Independent Metadata plugin <https://gitlab.com/YottaDB/Util/YDBAIM/>`_. YDBDoc/Plugins/ydbposix.rst: sudo ./ydbinstall.sh --utf8 default --verbose --posix YDBDoc/MultiLangProgGuide/MultiLangProgGuide.rst: - Run it with your choice of directory where you want it installed (omit the :code:`--verbose` option for less output): :code:`sudo ./ydbinstall.sh --utf8 default --verbose`. If you do not specify an installation directory with :code:`--installdir`, the script installs YottaDB in :code:`/usr/local/lib/yottadb/r###` where :code:`r###` is the release, e.g., :code:`r130`. YDBDoc/AcculturationGuide/acculturation.rst:- Run it (omit the :code:`--verbose` option if you want less output): :code:`sudo ./ydbinstall.sh --utf8 default --verbose` (This command installs YottaDB under :code:`/usr/local/lib/`.) YDBTest/docker/build_and_install_yottadb.csh:./ydbinstall --installdir=$gtm_root/$verno/dbg --utf8 default --keep-obj --ucaseonly-utils --prompt-for-group YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $4 --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --linkexec --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $4 --linkexec --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --nolinkexec --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $4 --linkenv --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --linkenv --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $4 --nolinkenv --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --linkexec $5 --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $4 --linkexec $5 --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --linkenv $6 --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $4 --linkenv $6 --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --copyexec --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $4 --copyenv --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --copyexec $5 --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb880.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $4 --copyenv $6 --utf8 default --user $USER $7 --nopkg-config --overwrite-existing YDBTest/sudo/u_inref/ydb894.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --nopkg-config --overwrite-existing --utf8 default --user $USER $4 YDBTest/sudo/u_inref/ydb910.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --from-source --overwrite-existing --utf8 default --user $USER $4 > ydbinstall_fromsource.txt 2>&1 YDBTest/sudo/u_inref/ydb924.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --overwrite-existing --utf8 default --dry-run $4 YDBTest/sudo/u_inref/ydb924.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --overwrite-existing --utf8 default $4 YDBTest/sudo/u_inref/ydb924.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --overwrite-existing --utf8 default --dry-run $4 YDBTest/sudo/u_inref/ydb924.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --overwrite-existing --utf8 default $4 YDBTest/sudo/u_inref/ydb783.csh:$sudostr /Distrib/YottaDB/$gtm_verno/$tst_image/yottadb_r*/ydbinstall --utf8 default --installdir $PWD/YDBUTF8 $installoptions YDBTest/sudo/u_inref/ydb783.csh:$sudostr /Distrib/YottaDB/$gtm_verno/$tst_image/yottadb_r*/ydbinstall --utf8 default --keep-obj --installdir $PWD/YDBUTF8NOSO $installoptions YDBTest/sudo/u_inref/ydb306.csh:#Tests that ydbinstall will not give an error when run with --zlib and --utf8 default YDBTest/sudo/u_inref/ydb306.sh:/Distrib/YottaDB/$1/$2/yottadb_r*/ydbinstall --installdir $3 --zlib --overwrite-existing --utf8 default --user $USER $4 YDBOcto/README.md:sudo ./ydbinstall.sh --utf8 default --verbose --octo YDBOcto/doc/developer_doc.rst: ./ydbinstall.sh --overwrite-existing --utf8 default --aim --posix YDBPython/tools/vm_scripts/clean_vm_test.sh: sudo ./ydbinstall.sh --force-install --utf8 default --verbose YDBPython/tools/vm_scripts/clean_vm_test.sh: sudo ./ydbinstall.sh --utf8 default --verbose YDBOctoVistA/OctoVistA.md:./ydbinstall --force-install --ucaseonly-utils --utf8 default --installdir /opt/yottadb/r1.25_x86_64 YDB/Dockerfile: /tmp/ydb-release/ydbinstall --utf8 default --installdir /opt/yottadb/current && \ YDB/Dockerfile-rocky: /tmp/ydb-release/ydbinstall --utf8 default --installdir /opt/yottadb/current && \ ``` - sr_unix/gtmprofile.gtc : This file was deleted on the YottaDB side a while ago (by 52822ee). The file `ydb_env_set` takes care of this functionality on the YottaDB side. The changes in the GT.M side for V7.0-000 to this file were to enhance error handling while trying to install GT.M with UTF-8 support. Such issues have already been ironed out in `ydb_env_set` for the YottaDB side so no need to incorporate any of this GT.M change into the YottaDB side. - sr_unix/kitstart.csh : This file deals with building the binary kits and has long been deleted on the YottaDB side. So no need to incorporate the changes to this file on the GT.M side (which are to remove `dbcertify` from the binary kit and to take the `configure.gtc` interface change into account where it now expects one less answer due to icu version no longer being supplied to it). - sr_unix_cm/rc_mval2subsc.c : This file is almost a duplicate of `mval2subsc.c` and so was removed on the YottaDB side a while ago. The changes to this file in the GT.M side are to change `rts_error_csa` calls with `RTS_ERROR_CSA_ABT`. Those changes will also show up in `mval2subsc.c` and will be addressed there. So no need to incorporate any of the `rc_mval2subsc.c` changes on the YottaDB side. - sr_unix_gnp/libgnpserver.list : This file was removed on the YottaDB side (as part of bf577ff) as there was no need to maintain a list of files related to individual utilities. The GT.M side added a new function `gtcmtr_get_key` to this file. New files will automatically get linked in to `libyottadb.so` which is what all utilities `dlopen()` so there is no need to incorporate the GT.M change to the YottaDB side. * All files that show up as `deleted by them:` are deleted in this commit since those were deleted in the GT.M repository. That is a straightforward change as we just need to delete them from the YottaDB side too. Below is the list of those files. - sr_port/dbcertify.c - sr_port/dbcertify.h - sr_port/dbcertify_base_ch.c - sr_port/dbcertify_certify_phase.c - sr_port/dbcertify_funcs.c - sr_port/dbcertify_scan_phase.c - sr_port/dsewrap.mpt - sr_port/v5cbsu.m - sr_unix/dbcertify_deferred_exit_handler.c - sr_unix/dbcertify_signal_handler.c - sr_unix/ftok.c - sr_unix/semstat2.c
- Loading branch information