zopencommunity / metaport

To be able to build the meta repo with zopen
Apache License 2.0
1 stars 2 forks source link

Problems installing zopen #3

Open mgrossmann opened 1 year ago

mgrossmann commented 1 year ago

Hello,

I tried to install version 0.6.0. My environment could not be named as of end of this month. So I'm not running bash but another nice shell.

According to the documentation I started running

. ./.env
./.env:1: parse error near `)'

So I fixed this issue by manually setting the path as in the .env script.

After installation I tried to source the new environment via:

. /u/ZOPEN/etc/.zopen-config

deleteDuplicateEntries:4: FSUZ0085 command not found: awk
deleteDuplicateEntries:4: FSUZ0085 command not found: sed
sanitizeEnvVar:8: FSUZ0085 command not found: awk
...
 Processing z/OS Open Tools configuration: % (/)
sanitizeEnvVar:8: FSUZ0085 command not found: awk
deleteDuplicateEntries:4: FSUZ0085 command not found: awk
...
- Processing z/OS Open Tools configuration: % (/)
sanitizeEnvVar:8: FSUZ0085 command not found: awk
deleteDuplicateEntries:4: FSUZ0085 command not found: awk
...
- Processing z/OS Open Tools configuration: % (/)
sanitizeEnvVar:8: FSUZ0085 command not found: awk
deleteDuplicateEntries:4: FSUZ0085 command not found: awk
...
sanitizeEnvVar:8: FSUZ0085 command not found: awk
deleteDuplicateEntries:4: FSUZ0085 command not found: awk
- Processed z/OS Open Tools configuration: 100% (/)

It looks like the shell function sanitizeEnvVar() {} failed and afterwards $PATH is missing the new PATH variable.

Thx, Mike

IgorTodorovskiIBM commented 1 year ago
. ./.env
./.env:1: parse error near `)'

This is strange, when you ran the above command was .env in the current working directory? What shell are you using?

For the missing commands, I don't see why it shouldn't work, unless your shell is evaluating PATH before calling sanitizeEnvvar()?

# Environment variables
PATH=\$ZOPEN_ROOTFS/usr/bin:\$ZOPEN_ROOTFS/bin:\$ZOPEN_ROOTFS/boot:\$(sanitizeEnvVar \"\$PATH\" \":\" \"^\$ZOPEN_PKGINSTALL/.*\$\")

Are you able to add a set -x to zopen-config and provide the output?

mgrossmann commented 1 year ago

Hello @IgorTodorovskiIBM

First things first. Using /bin/sh lets me install everything just fine. In my case, I'm using the ZSH. But BASH will behave in the same way, I'm pretty sure. I will test it tomorrow. In the meantime, I found the problem with .zopen-config.

The ZSH built-in function echo seems to dishonor the _BPXK_AUTOCVT setting. Issuing an echo "Hello" | more will output garbage. Using /bin/echo | more is working just fine. So the sanitizeEnvvar() produces an unpredictable output and the original $PATH got lost in the newly built PATH variable.

Regarding the sourcing of the .env file, I actually have no idea. It looks like the ZSH dies before just executing/sourcing the file. I already have added set -x and some echo statements. The shell is always complaining about an error near ')' in line 1.

More on this, tomorrow.

Best, Mike

MikeFultonDev commented 1 year ago

The 'nice shell' is an early drop of zsh ?

MikeFultonDev commented 1 year ago

echo is known to not be super-portable - @IgorTodorovskiIBM perhaps that is an issue... If this is zsh, we will be able to test easier after GA of z/OS 3.1

IgorTodorovskiIBM commented 1 year ago

In zsh, echo is a builtin, I wonder if the pipes are not properly tagged, because more is a ebcdic application.

mgrossmann commented 1 year ago

I'm not sure I'm allowed but I can do tests until GA of z/OS 3.1. Just a few weeks. :)

| The 'nice shell' is an early drop of zsh ? y e s

mgrossmann commented 1 year ago

@IgorTodorovskiIBM

more was just an example. I also tested it as echo "Hell" | echo or even with tee. So yes, I think the pipe produces the problem, when using the built-in.

IgorTodorovskiIBM commented 1 year ago

This is what I get with zsh:

./.env:1: FSUZ0202 unmatched '

The builtins seemed to be working though for me.

mgrossmann commented 1 year ago

@IgorTodorovskiIBM

You just tested .env or .zopen-config as well? I'm home in 20 minutes. Then I can connect to the host.

So if I could do / test anything, let me know.

IgorTodorovskiIBM commented 1 year ago

@IgorTodorovskiIBM

You just tested .env or .zopen-config as well? I'm home in 20 minutes. Then I can connect to the host.

So if I could do / test anything, let me know.

I can't get past the .env issue, even by setting the PATH to its directory. I wonder if we have different versions installed.

PLPSC% zsh --version
zsh 5.8.1 (i370-ibm-openedition)
mgrossmann commented 1 year ago

I'm currently on an older version.

MIKEG1@S0W1: ~ $ zsh --version
zsh 5.8.0.2-dev (i370-ibm-openedition)

But we will upgrade our system in the next days.

So in the end there are two problems, right? Both are related to not using /bin/sh as shell.

First is sourcing the .env file, second is sourcing the .zopen-config file.

The second one, is related to a pipe or echo built-in problem.

Could you please confirm the echo / pipe problem?

MIKEG1@S0W1: ~ $ echo "Hallo" 2>&1 | tee test
�/%%?�#                                                                                                                                                              
MIKEG1@S0W1: ~ $ cat test
�/%%?�#                                 

vs.

MIKEG1@S0W1: ~ $ /bin/echo "Hallo" 2>&1 | tee test
Hallo
MIKEG1@S0W1: ~ $ cat test
Hallo

/MIKE

mgrossmann commented 1 year ago

@IgorTodorovskiIBM You just tested .env or .zopen-config as well? I'm home in 20 minutes. Then I can connect to the host. So if I could do / test anything, let me know.

I can't get past the .env issue, even by setting the PATH to its directory. I wonder if we have different versions installed.

PLPSC% zsh --version
zsh 5.8.1 (i370-ibm-openedition)

I din't get .env working, either. I set up the path in the manual way, without using the .env file.

IgorTodorovskiIBM commented 1 year ago

The pipe issue seems to be resolved:

PLPSC% echo "Hallo" 2>&1 | tee testigor
Hallo
PLPSC% cat testigor
Hallo
PLPSC%
SunnyChenBJ commented 1 year ago

@IgorTodorovskiIBM , the current zsh is v5.8.1, in which the pipe issue was fixed. The output on AQ is as below:

6:50:30 ~ $echo "Hallo" 2>&1 | tee testme Hallo 6:50:37 ~ $cat testme Hallo

Sunny

MikeFultonDev commented 11 months ago

Can we close @mgrossmann ?