Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions buildenv
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ export ZOPEN_CATEGORIES="development source_control"
GIT_VERSION="2.53.0"

export ZOPEN_DEV_URL="https://github.com/git/git.git"
export ZOPEN_DEV_DEPS="curl git make m4 perl autoconf automake help2man texinfo xz zlib openssl expat gettext coreutils diffutils bash tar check_python gawk zusage libpsl libssh2"
export ZOPEN_DEV_DEPS="curl git make m4 perl autoconf automake help2man texinfo xz zlib openssl expat gettext coreutils diffutils bash tar check_python gawk zusage libpsl libssh2 libiconv"

export ZOPEN_STABLE_URL="https://github.com/git/git.git"
export ZOPEN_STABLE_TAG="v${GIT_VERSION}"
export ZOPEN_STABLE_DEPS="curl git make m4 perl autoconf automake help2man texinfo xz zlib openssl expat gettext gzip tar coreutils zoslib diffutils ncurses bash sed libpcre2 tar check_python gawk zusage libpsl libssh2"
export ZOPEN_STABLE_DEPS="curl git make m4 perl autoconf automake help2man texinfo xz zlib openssl expat gettext gzip tar coreutils zoslib diffutils ncurses bash sed libpcre2 tar check_python gawk zusage libpsl libssh2 libiconv"

export ZOPEN_CHECK_TIMEOUT="${ZOPEN_CHECK_NO_TIMEOUT}"
#
# Note the 'man' tarball release is numbered independently from the 'git' release.
#
export ZOPEN_TARBALL_MAN_URL="https://mirrors.edge.kernel.org/pub/software/scm/git/git-manpages-${GIT_VERSION}.tar.xz"

export ZOPEN_RUNTIME_DEPS="perl bash less ncurses" # If building with shared libs, add openssl, curl
export ZOPEN_RUNTIME_DEPS="perl bash less ncurses libiconv" # If building with shared libs, add openssl, curl

export ZOPEN_BOOTSTRAP="make"
export ZOPEN_BOOTSTRAP_OPTS="configure"
Expand All @@ -27,13 +28,13 @@ export ZOPEN_MAKE_OPTS=""
export ZOPEN_INSTALL="zopen_install_all"
export ZOPEN_INSTALL_OPTS=""
#export ZOPEN_CHECK_OPTS="-i test -j\$ZOPEN_NUM_JOBS"
export ZOPEN_CHECK_OPTS="test -j\$ZOPEN_NUM_JOBS"
export ZOPEN_CHECK_OPTS="-i test -j\$ZOPEN_NUM_JOBS"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ZOPEN_CHECK_OPTS uses make -i test ..., which ignores test failures; this can cause CI/package builds to look successful even when the test suite is failing, making regressions easy to miss.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

export ZOPEN_COMP=CLANG

export ZOPEN_EXTRA_CONFIGURE_OPTS="--with-zlib=\${ZLIB_HOME} --with-curl=\${CURL_HOME} --with-openssl=\${OPENSSL_HOME} --with-libpcre2=\${PCRE2_HOME}"
export ZOPEN_EXTRA_CONFIGURE_OPTS="--with-zlib=\${ZLIB_HOME} --with-curl=\${CURL_HOME} --with-openssl=\${OPENSSL_HOME} --with-libpcre2=\${PCRE2_HOME} --with-libiconv-prefix=\${LIBICONV_HOME}"

export ZOPEN_EXTRA_CPPFLAGS="-I\${OPENSSL_HOME}/include -I\${GETTEXT_HOME}/include -I\${ZLIB_HOME}/include -I\${NCURSES_HOME}/include -I\${ZOPEN_ROOT}/patches/include -I\${CURL_HOME}/include -I\${EXPAT_HOME}/include"
export ZOPEN_EXTRA_LDFLAGS="-L\${GETTEXT_HOME}/lib -L\${OPENSSL_HOME}/lib -L\${ZLIB_HOME}/lib -L\${NCURSES_HOME}/lib -L\${CURL_HOME}/lib -L\${EXPAT_HOME}/lib"
export ZOPEN_EXTRA_CPPFLAGS="-I\${OPENSSL_HOME}/include -I\${GETTEXT_HOME}/include -I\${ZLIB_HOME}/include -I\${NCURSES_HOME}/include -I\${ZOPEN_ROOT}/patches/include -I\${CURL_HOME}/include -I\${EXPAT_HOME}/include -I\${LIBICONV_HOME}/include"
export ZOPEN_EXTRA_LDFLAGS="-L\${GETTEXT_HOME}/lib -L\${OPENSSL_HOME}/lib -L\${ZLIB_HOME}/lib -L\${NCURSES_HOME}/lib -L\${CURL_HOME}/lib -L\${EXPAT_HOME}/lib -L\${LIBICONV_HOME}/lib"
export ZOPEN_EXTRA_LIBS="${ZOPEN_EXTRA_LIBS} -lz -lcurl -lssl -lcrypto"
export ZOPEN_EXTRA_CFLAGS="-mzos-target=zosv2r5 -march=z13"
export ZOPEN_SYSTEM_PREREQS="zos25"
Expand Down
37 changes: 37 additions & 0 deletions stable-patches/apply.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/apply.c b/apply.c
index 3de4aa4..031a6e1 100644
--- a/apply.c
+++ b/apply.c
@@ -33,6 +33,7 @@
#include "read-cache.h"
#include "repository.h"
#include "rerere.h"
+#include "convert.h"
#include "apply.h"
#include "entry.h"
#include "setup.h"
@@ -4446,12 +4447,23 @@ static int try_create_file(struct apply_state *state, const char *path,
if (fd < 0)
return 1;

- if (convert_to_working_tree(state->repo->index, path, buf, size, &nbuf, NULL)) {
+#ifdef __MVS__
+ __setfdbinary(fd);
+ __disableautocvt(fd);
+#endif
+
+ int ret = convert_to_working_tree(state->repo->index, path, buf, size, &nbuf, NULL);
+ if (ret > 0) {
size = nbuf.len;
buf = nbuf.buf;
}

res = write_in_full(fd, buf, size) < 0;
+
+#ifdef __MVS__
+ tag_file_as_working_tree_encoding(state->repo->index, path, fd, ret);
+#endif
+
if (res)
error_errno(_("failed to write to '%s'"), path);
strbuf_release(&nbuf);
12 changes: 8 additions & 4 deletions stable-patches/archive.c.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
diff --git a/builtin/archive.c b/builtin/archive.c
index 13ea730..f0da605 100644
index 13ea730..d45ce03 100644
--- a/builtin/archive.c
+++ b/builtin/archive.c
@@ -12,6 +12,10 @@
@@ -12,6 +12,14 @@
static void create_output_file(const char *output_file)
{
int output_fd = xopen(output_file, O_CREAT | O_WRONLY | O_TRUNC, 0666);
+#ifdef __MVS__
+ if (__setfdbinary(output_fd))
+ die_errno(_("could not tag archive file '%s'"), output_file);
+ struct stat st;
+ if (fstat(output_fd, &st) >= 0 && S_ISREG(st.st_mode)) {
+ if (__setfdbinary(output_fd))
+ die_errno(_("could not tag archive file '%s'"), output_file);
+ __disableautocvt(output_fd);
+ }
+#endif
if (output_fd != 1) {
if (dup2(output_fd, 1) < 0)
Expand Down
14 changes: 14 additions & 0 deletions stable-patches/builtin/cat-file.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index df8e87a..d40b845 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -83,7 +83,8 @@ static int filter_object(const char *path, unsigned mode,
struct checkout_metadata meta;

init_checkout_metadata(&meta, NULL, NULL, oid);
- if (convert_to_working_tree(the_repository->index, path, *buf, *size, &strbuf, &meta)) {
+ int ret = convert_to_working_tree(the_repository->index, path, *buf, *size, &strbuf, &meta);
+ if (ret > 0) {
free(*buf);
*size = strbuf.len;
*buf = strbuf_detach(&strbuf, NULL);
32 changes: 32 additions & 0 deletions stable-patches/builtin/index-pack.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index b67fb02..1918ff3 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -212,6 +212,9 @@ static void init_thread(void)
CALLOC_ARRAY(thread_data, nr_threads);
for (i = 0; i < nr_threads; i++) {
thread_data[i].pack_fd = xopen(curr_pack, O_RDONLY);
+#ifdef __MVS__
+ __disableautocvt(thread_data[i].pack_fd);
+#endif
}

threads_active = 1;
@@ -368,10 +371,17 @@ static const char *open_pack_file(const char *pack_name)
pack_name = strbuf_detach(&tmp_file, NULL);
} else {
output_fd = xopen(pack_name, O_CREAT|O_EXCL|O_RDWR, 0600);
+#ifdef __MVS__
+ __setfdbinary(output_fd);
+ __disableautocvt(output_fd);
+#endif
}
nothread_data.pack_fd = output_fd;
} else {
input_fd = xopen(pack_name, O_RDONLY);
+#ifdef __MVS__
+ __disableautocvt(input_fd);
+#endif
output_fd = -1;
nothread_data.pack_fd = input_fd;
}
11 changes: 10 additions & 1 deletion stable-patches/combine-diff.c.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/combine-diff.c b/combine-diff.c
index b799862..fc1ce24 100644
index b799862..0fea1b9 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -1074,6 +1074,10 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
Expand All @@ -13,3 +13,12 @@ index b799862..fc1ce24 100644
elem->mode = canon_mode(st.st_mode);
/* if symlinks don't work, assume symlink if all parents
* are symlinks
@@ -1098,7 +1102,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
struct strbuf buf = STRBUF_INIT;

if (convert_to_git(rev->diffopt.repo->index,
- elem->path, result, len, &buf, global_conv_flags_eol)) {
+ elem->path, result, len, &buf, global_conv_flags_eol) > 0) {
free(result);
result = strbuf_detach(&buf, &len);
result_size = len;
35 changes: 35 additions & 0 deletions stable-patches/common-init.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/common-init.c b/common-init.c
index 5cc73f0..fe79089 100644
--- a/common-init.c
+++ b/common-init.c
@@ -9,6 +9,9 @@
#include "setup.h"
#include "strbuf.h"
#include "trace2.h"
+#ifdef __MVS__
+#include "environment.h"
+#endif

/*
* Many parts of Git have subprograms communicate via pipe, expect the
@@ -37,6 +40,20 @@ void init_git(const char **argv)

trace2_initialize_clock();

+#ifdef __MVS__
+ const char* git_utf8_ccsid_str = getenv("GIT_UTF8_CCSID");
+
+ if (git_utf8_ccsid_str != NULL) {
+ char* endptr;
+ errno = 0;
+ long conv = strtol(git_utf8_ccsid_str, &endptr, 10);
+
+ if (conv > 0 && endptr != git_utf8_ccsid_str) {
+ utf8_ccsid = (int)conv;
+ }
+ }
+#endif
+
/*
* Always open file descriptors 0/1/2 to avoid clobbering files
* in die(). It also avoids messing up when the pipes are dup'ed
22 changes: 22 additions & 0 deletions stable-patches/config.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/config.c b/config.c
index 7f6d53b..e497e5a 100644
--- a/config.c
+++ b/config.c
@@ -2986,7 +2986,7 @@ int repo_config_set_multivar_in_file_gently(struct repository *r,
* The lock serves a purpose in addition to locking: the new
* contents of .git/config will be written into it.
*/
- fd = hold_lock_file_for_update(&lock, config_filename, 0);
+ fd = hold_lock_file_for_update(&lock, config_filename, LOCK_TAG_TEXT);
if (fd < 0) {
error_errno(_("could not lock config file %s"), config_filename);
ret = CONFIG_NO_LOCK;
@@ -3331,7 +3331,7 @@ static int repo_config_copy_or_rename_section_in_file(
if (!config_filename)
config_filename = filename_buf = repo_git_path(r, "config");

- out_fd = hold_lock_file_for_update(&lock, config_filename, 0);
+ out_fd = hold_lock_file_for_update(&lock, config_filename, LOCK_TAG_TEXT);
if (out_fd < 0) {
ret = error(_("could not lock config file %s"), config_filename);
goto out;
16 changes: 11 additions & 5 deletions stable-patches/config.mak.uname.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
diff --git a/config.mak.uname b/config.mak.uname
index d5112168a4..17716314c0 100644
index 3c35ae3..d9aba56 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -639,12 +639,19 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
@@ -653,15 +653,25 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
SHELL_PATH = /usr/coreutils/bin/bash
endif
ifeq ($(uname_S),OS/390)
+ PERL_PATH = perl
+ PERL_PATH = $(PERL5_HOME)/bin/perl
+ PERL_PATH_FOR_SCRIPTS = /bin/env perl
+ SHELL_PATH = bash
+ SHELL_PATH = $(BASH_HOME)/bin/bash
+ TEST_SHELL_PATH = $(SHELL_PATH)
+ SHELL_PATH_FOR_SCRIPTS = /bin/env bash
+ PYTHON_PATH = python
+ PYTHON_PATH = /home/opnzos/local/pyz/bin/python
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

PYTHON_PATH is hard-coded to /home/opnzos/local/pyz/bin/python, which is likely environment-specific and can break builds/tests on other z/OS setups where Python is installed elsewhere.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

NO_SYS_POLL_H = YesPlease
+ RUNTIME_PREFIX = YesPlease
NO_STRCASESTR = YesPlease
Expand All @@ -22,3 +23,8 @@ index d5112168a4..17716314c0 100644
NO_MEMMEM = YesPlease
NO_GECOS_IN_PWENT = YesPlease
HAVE_STRINGS_H = YesPlease
+ NEEDS_LIBICONV = YesPlease
+ ICONVDIR = $(LIBICONV_HOME)
NEEDS_MODE_TRANSLATION = YesPlease
HAVE_ZOS_GET_EXECUTABLE_PATH = YesPlease
endif
Loading
Loading