mainAutoconf - Support: sr #110289, "/bin/sh: line 1:...

 
 

sr #110289: "/bin/sh: line 1: ../tests/mktests.sh: not found" with dmake and separate build dir

Submitter:  Zack Weinberg <zackw>
Submitted:  Tue 04 Aug 2020 01:16:20 PM UTC
   
 
Priority:  * 5 - Unprioritized Severity:  3 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Operating System:  Solaris
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 18 Aug 2020 08:55:34 PM UTC, comment #2: 

It was a little more involved than just not using 'cd', but this is now fixed in 17a7ec16a7b72a82286034c4e0cccf964a9a8afd.

Zack Weinberg <zackw>
Group administrator
Tue 04 Aug 2020 11:32:19 PM UTC, comment #1: 

The usual fix for this sort of problem is to not use 'cd'. Does that work? That is, can you replace the offending shell command with:

        $(SHELL) $(srcdir)/tests/mktests.sh \
          `echo " "$(AUTOCONF_FILES) | sed 's, [^ ]*/, $(srcdir)/lib/autoconf/,g'`

Anyway, as I understand it, this problem should not occur when building with a distribution tarball because such a tarball already contains an up-to-date mktests.stamp. So the problem should occur only when building from Git, or when someone has changed one of mktests.stamp's dependencies and is developing Autoconf rather than just building it.

If the problem is limited to Solaris dmake and doesn't occur with GNU make, it's a low-priority bug - we can just tell people to use a GNU-compatible 'make' if they want to develop (as opposed to merely build) Autoconf. This would be a reasonable approach to take if the abovementioned trivial patch does not work.

Paul Eggert <eggert>
Group administrator
Tue 04 Aug 2020 01:16:20 PM UTC, original submission:  

Solaris' dmake mishandles this Makefile rule when the source and build directories are separate and configure was invoked via a relative path:

    tests/mktests.stamp : tests/mktests.sh $(AUTOCONF_FILES)
        @rm -f tests/mktests.tmp
        @touch tests/mktests.tmp
        cd $(srcdir) && $(SHELL) tests/mktests.sh \
          `echo " "$(AUTOCONF_FILES) | sed 's, [^ ]*/, lib/autoconf/,g'`
        @mv -f tests/mktests.tmp $@

It rewrites all occurrences of the dependencies (tests/mktests.sh and the files in the expansion of $(AUTOCONF_FILES)) to include the VPATH component where they were found.  For instance, if the build is taking place in a subdirectory of the source directory, VPATH will be `..` and `tests/mktests.sh` will become `../tests/mktests.sh`.

But the commands start with `cd $(srcdir)`, which invalidates all of these paths and causes the rule to fail.

I'm not sure what we can dp for a workaround, or even if we should work around it in the code, but it probably at least deserves mention in the release notes.

(Ideally we wouldn't be writing to the source directory during the build at all, ever, but that's a much bigger project.)

Zack Weinberg <zackw>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by eggert (Posted a comment)
  • -email is unavailable- added by zackw (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-08-18 zackw StatusConfirmed Done
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code