Operating System - OpenVMS
1752753 Members
4577 Online
108789 Solutions
New Discussion юеВ

Re: GNV: make hitting command line maximum length

 
SOLVED
Go to solution
Maxy2
Advisor

Re: GNV: make hitting command line maximum length

Thanks, but our system is Itanium OpenVMS 8.3.
Maxy2
Advisor

Re: GNV: make hitting command line maximum length

It looks like I left out a line that is relevant. Here is a complete makefile that shows two problems:

SHELL = /gnu/bin/bash
MYFILES = file01.txt file02.txt file03.txt file04.txt file05.txt \
file06.txt file07.txt file08.txt file09.txt file10.txt \
file11.txt file12.txt file13.txt file14.txt file15.txt \
file16.txt file17.txt file18.txt file19.txt file20.txt \
file21.txt file22.txt file23.txt file24.txt file25.txt

.PHONY: test1 test2
test1:
touch $(MYFILES)

test2:
DCL show time

I had the SHELL line in my example before, but I didn't think it was relevant. Turns out it is. In this makefile, test1 fails and test2 works. If you take out the SHELL line, test1 works and test2 fails, returning an error that stops make from proceeding:

bash$ make -f support4.mak test2
DCL show time
27-JUL-2009 12:21:04
/gnu/bin/make: *** [test2] Error 1
bash$

I had no idea that my fix for test2 actually caused of the problem with test1.
Maxy2
Advisor

Re: GNV: make hitting command line maximum length

Sorry, one more thing. The reason why there is an Exit 1 error from make is because the DCL command (all of them) are returning an error code 1.

bash$ ls hello.c
hello.c
bash$ echo $?
0
bash$ dcl show time
27-JUL-2009 12:35:31
bash$ echo $?
1
bash$
Hoff
Honored Contributor

Re: GNV: make hitting command line maximum length

Um, OpenVMS I64 V8.3 *is* newer than V7.3-1.
You'll want to look at the update.
Maxy2
Advisor

Re: GNV: make hitting command line maximum length

I was just assuming that any executable built for Alpha would not run on Itanium.
Hoff
Honored Contributor

Re: GNV: make hitting command line maximum length

That wasn't my reading of that note. You're correct that you do need a platform-specific executable, but I'd confirm that the port of make isn't applicable in your environment. I'd expect the intent of the comment was not that Alpha was central, but that the port required some feature of OpenVMS that first arrived with V7.3-1.

If you're using gnv, you're going to want to rummage around for (newer) pieces. What's in gnv is often a little stale, and there can be updates and fixes around. John Malmberg posted various updates to gnv over at the Eisner host, for instance. Though the gnv bits have moved (and there are references at the following), start reading here:

http://eisner.encompasserve.org/~malmberg/GNV/

There's been an associated and running discussion about gnv and about other open source on OpenVMS in general, too. (It'd be nice to see the latest gnv bits available out at sourceforge, for instance.)
H.Becker
Honored Contributor
Solution

Re: GNV: make hitting command line maximum length

As said in the other thread, the dcl utility has a bug, it should not return a VMS success status.

Using GNV make from bash ...

If you have the SHELL specified, your action line for test2 really is $(SHELL) -c 'dcl show time'. So you get the 0 returned from shell and make sees success.

The same applies to your action line for test1, now you have $(SHELL) -c 'touch file01.txt file02.txt file03.txt file04.txt file05.txt ...'

That fails in my environment with
make: execv 2: /gnu/bin/bash: no such file or directory
make: execv 2: -c: no such file or directory
make: execv 2: touch file01.txt file02.txt file03.txt

At the moment I can't explain the behavior of GNV make, here.

It looks like you need the SHELL only to work around the bug in the dcl utility. So you may want to use /gnu/bin/bash -c 'show time' for such actions. (However, fixing the bug in the dcl utility seems easier :-)

Using GNU make 3.81 ...

GNU make for VMS will not use the specified SHELL. In my environment it works for test1 And if you remove the dcl in the other action line, it works for test2, too. Both from bash and (the real) DCL.

I do have zipped GNU make 3.81, built on V8.3 on Integrity, about 400 disk blocks. Let me know where to copy it or if you want me to attach it, here.
Maxy2
Advisor

Re: GNV: make hitting command line maximum length

Some things are finally starting to become clear. The reason defining SHELL improved my situation was because of the issue with DCL return codes. This really only masked the situation, and created another problem of severely limiting the command line length. So, to summarize:

DON'T define makefile SHELL variable. Even if correctly defined, this will severely limit the maximum command line length.

DO define an alias for make with the full path (i.e. alias make=/gnu/bin/make). Otherwise make can't properly re-execute itself when needed.

DCL commands don't return zero on success. Therefore, if you use them in a makefile, either instruct make to ignore the return value with "-" or invoke something after the DCL command that will return a zero on success, like:

DCL DIR /FULL | grep MAKEFILE

or
DCL DIR MYFILE.TXT ; dcl_return $?

where dcl_return is:

#!/gnu/bin/bash
# Converts DCL return value into bash return code
# In DCL, odd value means success. In bash, 0 value means success.
# If DCL failure (even), return the DCL return value.
if [ $(( $1 & 1 )) -eq "1" ]
then
exit 0
else
exit $1
fi