bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH 2/2] Do not use DOS paths on Cygwin


From: Pavel Fedin
Subject: RE: [PATCH 2/2] Do not use DOS paths on Cygwin
Date: Wed, 31 Jul 2013 10:37:58 +0400

 Hello!

 The problem is revealed by make's own test suite. The following is test
results with DOS paths disabled:
--- cut ---
$ ./run_make_tests
----------------------------------------------------------------------------
--
Running tests for GNU make on CYGWIN_NT-6.1 fedinw7x64 1.7.22(0.268/5/3)
x86_64
                               GNU Make 3.82.90
----------------------------------------------------------------------------
--

Finding tests...

features/archives ....................................... ok     (7 passed)
features/comments ....................................... ok     (1 passed)
features/conditionals ................................... ok     (4 passed)
features/default_names .................................. ok     (2 passed)
features/double_colon ................................... ok     (11 passed)
features/echoing ........................................ ok     (4 passed)
features/errors ......................................... ok     (2 passed)
features/escape ......................................... ok     (6 passed)
features/export ......................................... ok     (12 passed)
features/include ........................................ ok     (10 passed)
features/mult_rules ..................................... ok     (2 passed)
features/mult_targets ................................... ok     (2 passed)
features/order_only ..................................... ok     (10 passed)
features/override ....................................... ok     (4 passed)
features/parallelism .................................... ok     (9 passed)
features/patspecific_vars ............................... ok     (10 passed)
features/patternrules ................................... ok     (10 passed)
features/quoting ........................................ ok     (1 passed)
features/recursion ...................................... ok     (2 passed)
features/reinvoke ....................................... ok     (5 passed)
features/se_explicit .................................... ok     (9 passed)
features/se_implicit .................................... ok     (9 passed)
features/se_statpat ..................................... ok     (4 passed)
features/shell_assignment ............................... ok     (4 passed)
features/statipattrules ................................. ok     (8 passed)
features/targetvars ..................................... ok     (25 passed)
features/varnesting ..................................... ok     (2 passed)
features/vpath .......................................... ok     (2 passed)
features/vpath2 ......................................... ok     (1 passed)
features/vpath3 ......................................... ok     (1 passed)
features/vpathgpath ..................................... ok     (1 passed)
features/vpathplus ...................................... ok     (4 passed)
functions/abspath ....................................... ok     (1 passed)
functions/addprefix ..................................... ok     (1 passed)
functions/addsuffix ..................................... ok     (2 passed)
functions/andor ......................................... ok     (2 passed)
functions/basename ...................................... ok     (1 passed)
functions/call .......................................... ok     (3 passed)
functions/dir ........................................... ok     (1 passed)
functions/error ......................................... ok     (5 passed)
functions/eval .......................................... ok     (9 passed)
functions/filter-out .................................... ok     (1 passed)
functions/findstring .................................... ok     (1 passed)
functions/flavor ........................................ ok     (1 passed)
functions/foreach ....................................... ok     (4 passed)
functions/if ............................................ ok     (1 passed)
functions/join .......................................... ok     (1 passed)
functions/notdir ........................................ ok     (1 passed)
functions/origin ........................................ ok     (1 passed)
functions/realpath ...................................... Error running make
(expected 0; got 512): make -f work/functions/realpath.mk
FAILED (0/1 passed)
functions/shell ......................................... ok     (2 passed)
functions/sort .......................................... ok     (2 passed)
functions/strip ......................................... ok     (2 passed)
functions/substitution .................................. ok     (3 passed)
functions/suffix ........................................ ok     (1 passed)
functions/value ......................................... ok     (1 passed)
functions/warning ....................................... ok     (4 passed)
functions/wildcard ...................................... ok     (6 passed)
functions/word .......................................... ok     (16 passed)
misc/bs-nl .............................................. ok     (16 passed)
misc/close_stdout ....................................... ok     (1 passed)
misc/general1 ........................................... ok     (1 passed)
misc/general2 ........................................... ok     (1 passed)
misc/general3 ........................................... ok     (10 passed)
misc/general4 ........................................... ok     (6 passed)
options/dash-B .......................................... ok     (8 passed)
options/dash-C .......................................... ok     (2 passed)
options/dash-I .......................................... ok     (3 passed)
options/dash-W .......................................... ok     (10 passed)
options/dash-e .......................................... ok     (1 passed)
options/dash-f .......................................... ok     (4 passed)
options/dash-k .......................................... ok     (3 passed)
options/dash-l .......................................... ok     (0 passed)
options/dash-n .......................................... ok     (5 passed)
options/dash-q .......................................... ok     (8 passed)
options/dash-t .......................................... ok     (2 passed)
options/eval ............................................ ok     (2 passed)
options/general ......................................... ok     (1 passed)
options/symlinks ........................................ N/A
options/warn-undefined-variables ........................ ok     (2 passed)
targets/DEFAULT ......................................... ok     (1 passed)
targets/FORCE ........................................... ok     (1 passed)
targets/INTERMEDIATE .................................... ok     (8 passed)
targets/ONESHELL ........................................ ok     (5 passed)
targets/PHONY ........................................... ok     (1 passed)
targets/POSIX ........................................... ok     (2 passed)
targets/SECONDARY ....................................... ok     (12 passed)
targets/SILENT .......................................... ok     (1 passed)
targets/clean ........................................... ok     (2 passed)
variables/CURDIR ........................................ ok     (1 passed)
variables/DEFAULT_GOAL .................................. ok     (5 passed)
variables/INCLUDE_DIRS .................................. ok     (2 passed)
variables/LIBPATTERNS ................................... ok     (2 passed)
variables/MAKE .......................................... ok     (1 passed)
variables/MAKECMDGOALS .................................. ok     (3 passed)
variables/MAKEFILES ..................................... ok     (2 passed)
variables/MAKEFLAGS ..................................... ok     (2 passed)
variables/MAKELEVEL ..................................... ok     (1 passed)
variables/MAKE_RESTARTS ................................. ok     (3 passed)
variables/MFILE_LIST .................................... ok     (1 passed)
variables/SHELL ......................................... ok     (7 passed)
variables/automatic ..................................... ok     (7 passed)
variables/define ........................................ ok     (15 passed)
variables/flavors ....................................... ok     (6 passed)
variables/negative ...................................... ok     (4 passed)
variables/private ....................................... ok     (9 passed)
variables/special ....................................... ok     (2 passed)
variables/undefine ...................................... ok     (4 passed)

1 Test in 1 Category Failed (See .diff files in work dir for details) :-(
--- cut ---
 Please don't pay attention to 'realpath' failed, it is not make's problem,
this is caused by my patch in cygwin.dll itself. I will fix it. This happens
because currently Cygwin fails with paths like '/..', while Linux
successfully resolves this to simply '/'.

 And this is with DOS paths enabled:
--- cut ---
$ ./run_make_tests -make /usr/src/make-test/make.exe
----------------------------------------------------------------------------
--
Running tests for GNU make on CYGWIN_NT-6.1 fedinw7x64 1.7.22(0.268/5/3)
x86_64
                               GNU Make 3.82.90
----------------------------------------------------------------------------
--

Clearing work...
Finding tests...

features/archives ....................................... ok     (7 passed)
features/comments ....................................... ok     (1 passed)
features/conditionals ................................... ok     (4 passed)
features/default_names .................................. ok     (2 passed)
features/double_colon ................................... ok     (11 passed)
features/echoing ........................................ ok     (4 passed)
features/errors ......................................... ok     (2 passed)
features/escape ......................................... ok     (6 passed)
features/export ......................................... ok     (12 passed)
features/include ........................................ ok     (10 passed)
features/mult_rules ..................................... ok     (2 passed)
features/mult_targets ................................... ok     (2 passed)
features/order_only ..................................... ok     (10 passed)
features/override ....................................... ok     (4 passed)
features/parallelism .................................... ok     (9 passed)
features/patspecific_vars ............................... ok     (10 passed)
features/patternrules ................................... ok     (10 passed)
features/quoting ........................................ ok     (1 passed)
features/recursion ...................................... ok     (2 passed)
features/reinvoke ....................................... ok     (5 passed)
features/se_explicit .................................... ok     (9 passed)
features/se_implicit .................................... ok     (9 passed)
features/se_statpat ..................................... ok     (4 passed)
features/shell_assignment ............................... ok     (4 passed)
features/statipattrules ................................. ok     (8 passed)
features/targetvars ..................................... ok     (25 passed)
features/varnesting ..................................... ok     (2 passed)
features/vpath .......................................... ok     (2 passed)
features/vpath2 ......................................... ok     (1 passed)
features/vpath3 ......................................... ok     (1 passed)
features/vpathgpath ..................................... ok     (1 passed)
features/vpathplus ...................................... ok     (4 passed)
functions/abspath ....................................... FAILED (0/1
passed)
functions/addprefix ..................................... ok     (1 passed)
functions/addsuffix ..................................... ok     (2 passed)
functions/andor ......................................... ok     (2 passed)
functions/basename ...................................... ok     (1 passed)
functions/call .......................................... ok     (3 passed)
functions/dir ........................................... ok     (1 passed)
functions/error ......................................... ok     (5 passed)
functions/eval .......................................... ok     (9 passed)
functions/filter-out .................................... ok     (1 passed)
functions/findstring .................................... ok     (1 passed)
functions/flavor ........................................ ok     (1 passed)
functions/foreach ....................................... ok     (4 passed)
functions/if ............................................ ok     (1 passed)
functions/join .......................................... ok     (1 passed)
functions/notdir ........................................ ok     (1 passed)
functions/origin ........................................ ok     (1 passed)
functions/realpath ...................................... Error running
/usr/src/make-test/make (expected 0; got 512): /usr/src/make-test/make -f
work/functions/realpath.mk
FAILED (0/1 passed)
functions/shell ......................................... ok     (2 passed)
functions/sort .......................................... ok     (2 passed)
functions/strip ......................................... ok     (2 passed)
functions/substitution .................................. ok     (3 passed)
functions/suffix ........................................ ok     (1 passed)
functions/value ......................................... ok     (1 passed)
functions/warning ....................................... ok     (4 passed)
functions/wildcard ...................................... ok     (6 passed)
functions/word .......................................... ok     (16 passed)
misc/bs-nl .............................................. ok     (16 passed)
misc/close_stdout ....................................... ok     (1 passed)
misc/general1 ........................................... ok     (1 passed)
misc/general2 ........................................... ok     (1 passed)
misc/general3 ........................................... ok     (10 passed)
misc/general4 ........................................... ok     (6 passed)
options/dash-B .......................................... ok     (8 passed)
options/dash-C .......................................... ok     (2 passed)
options/dash-I .......................................... ok     (3 passed)
options/dash-W .......................................... ok     (10 passed)
options/dash-e .......................................... ok     (1 passed)
options/dash-f .......................................... ok     (4 passed)
options/dash-k .......................................... ok     (3 passed)
options/dash-l .......................................... ok     (0 passed)
options/dash-n .......................................... ok     (5 passed)
options/dash-q .......................................... ok     (8 passed)
options/dash-t .......................................... ok     (2 passed)
options/eval ............................................ ok     (2 passed)
options/general ......................................... ok     (1 passed)
options/symlinks ........................................ N/A
options/warn-undefined-variables ........................ ok     (2 passed)
targets/DEFAULT ......................................... ok     (1 passed)
targets/FORCE ........................................... ok     (1 passed)
targets/INTERMEDIATE .................................... ok     (8 passed)
targets/ONESHELL ........................................ ok     (5 passed)
targets/PHONY ........................................... ok     (1 passed)
targets/POSIX ........................................... ok     (2 passed)
targets/SECONDARY ....................................... ok     (12 passed)
targets/SILENT .......................................... ok     (1 passed)
targets/clean ........................................... ok     (2 passed)
variables/CURDIR ........................................ ok     (1 passed)
variables/DEFAULT_GOAL .................................. ok     (5 passed)
variables/INCLUDE_DIRS .................................. ok     (2 passed)
variables/LIBPATTERNS ................................... ok     (2 passed)
variables/MAKE .......................................... ok     (1 passed)
variables/MAKECMDGOALS .................................. ok     (3 passed)
variables/MAKEFILES ..................................... ok     (2 passed)
variables/MAKEFLAGS ..................................... ok     (2 passed)
variables/MAKELEVEL ..................................... ok     (1 passed)
variables/MAKE_RESTARTS ................................. ok     (3 passed)
variables/MFILE_LIST .................................... ok     (1 passed)
variables/SHELL ......................................... ok     (7 passed)
variables/automatic ..................................... ok     (7 passed)
variables/define ........................................ ok     (15 passed)
variables/flavors ....................................... ok     (6 passed)
variables/negative ...................................... ok     (4 passed)
variables/private ....................................... ok     (9 passed)
variables/special ....................................... ok     (2 passed)
variables/undefine ...................................... ok     (4 passed)

2 Tests in 2 Categories Failed (See .diff files in work dir for details) :-(
--- cut ---
 Note 'abspath' test failed now. The test output (abspath.log) is:
--- cut ---
work/functions/abspath.mk:15: /: abspath="/us"
work/functions/abspath.mk:19: ///: abspath="//"
work/functions/abspath.mk:23: /.: abspath="/us"
work/functions/abspath.mk:27: ///.: abspath="//"
work/functions/abspath.mk:31: /./: abspath="/us"
work/functions/abspath.mk:35: /.///: abspath="/us"
work/functions/abspath.mk:39: /..: abspath="/us"
work/functions/abspath.mk:43: ///..: abspath="//"
work/functions/abspath.mk:47: /../: abspath="/us"
work/functions/abspath.mk:51: /..///: abspath="/us"
work/functions/abspath.mk:56: /foo/bar/..: abspath="/us/foo"
work/functions/abspath.mk:64: /foo/bar/../ /..: abspath="/us/foo /us"
--- cut ---
 Note garbage characters. '/us' is a part of '/usr/src/...', returned by
getcwd(). and stored in 'starting_directory'. Then the following happens
inside abspath() function:
--- cut ---
  if (!IS_ABSOLUTE(name)) /* This is evaluated as FALSE (see IS_ABSOLUTE()
definition) */
    {
      /* It is unlikely we would make it until here but just to make sure.
*/
      if (!starting_directory) 
        return NULL;

      strcpy (apath, starting_directory); /* Here 'apath' gets
'/usr/src/make/src/make-3.82.90/tests' (my current directory) */

#ifdef HAVE_DOS_PATHS
      if (IS_PATHSEP(name[0]))          /* TRUE */
        {
          if (IS_PATHSEP(name[1]))              /* FALSE */
            {
              /* A UNC.  Don't prepend a drive letter.  */
              apath[0] = name[0];
              apath[1] = name[1];
              root_len = 2;
            }
          /* We have /foo, an absolute file name except for the drive
             letter.  Assume the missing drive letter is the current
             drive, which we can get if we remove from starting_directory
             everything past the root directory.  */
          apath[root_len] = '\0';       /* ROOT_LEN is 3 because 'X:/' is
expected. We have got our '/us'. */
        }
#endif

      dest = strchr (apath, '\0');
    }
 --- cut ---

 Looks like, if you want DOS paths, and running under Cygwin, an explicit
conversion has to be performed on getcwd() result using cygwin_conv_path().
However i did not test this further because i follow official Cygwin way of
doing things, and Cygwin deprecates usage of DOS style paths, obviously
because they create lots of problems in UNIX utilities which are not
modified to handle them. Cygwin even warns you when some API functions get
DOS paths.
 Ok, actually i do not insist, if you still strongly disagree with me than
you can drop that small patch. Anyway Cygwin Make package has own workaround
for this. My initial goal was to submit fork()->spawn() modification, DOS
paths issue is a side effect.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia





reply via email to

[Prev in Thread] Current Thread [Next in Thread]