bugmake - Bugs: bug #15720, Expansion of variables inside...

 
 

bug #15720: Expansion of variables inside export fails on Win32

Submitter:  Agent Zhang <agent>
Submitted:  Sun 12 Feb 2006 10:04:24 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Not A Bug Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  None Operating System:  MS Windows
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 13 Feb 2006 09:54:37 PM UTC, comment #4: 

I'm closing this as a misunderstanding; I think any real errors here are covered adequately by bug #15718.

BTW, if someone has any ideas on how to make the test suite more portable, so it doesn't rely on having a UNIX shell, I'm interested.  But, only if it can be done in a fairly clean manner.

Paul D. Smith <psmith>
Group administrator
Mon 13 Feb 2006 06:48:22 AM UTC, comment #3: 

Indeed you're correct. My Win32 build of GNU make 3.81beta4 detects my Cygwin sh.exe automatically and makes use of it without a warning. Mixing Cygwin sh.exe with non-Cygwin app such as win32-make.exe can be problematic.

So I wrote a simple Bourne Shell simulator in Perl, and instructed `make' to use that, and variable exporting turns right since then:

C:\Temp>type Makefile
bar: export foo := foo
bar: ; @echo $(foo) $$foo

C:\Temp>win32-make
foo

C:\Temp>win32-make "SHELL = perl G:\script\sh"
foo foo

However, I can't simply move the `perl G:\script\sh' thing from command line into the Makefile itself because of [bug #15718]. The screen-shot is as follows:

C:\Temp>type Makefile
SHELL = perl G:\script\sh

bar: export foo := foo
bar: ; @echo $(foo) $$foo

C:\Temp>win32-make
foo

> P.S. Please don't assume that people who worfk
> on the Windows port don't run the test suite.
> I ran the entire test suite when I built the
> last beta, and everything worked as expected.


Glad you run the test suit as me. :=) That was solely a bad joke, please don't take it personally. I appologize for my rudeness.

Frankly speeking, the Win32 port of `make' is cute. You all have done a good job.

Blessings,
Agent

Agent Zhang <agent>
Sun 12 Feb 2006 08:09:31 PM UTC, comment #2: 

I cannot reproduce these problems with a MinGW build of native Windows port of Make 3.81beta4.

This could be a shell issue or an echo issue: the $$ construct is interpreted by the shell, and of course the stock Windows shell cmd.exe doesn't do what a Unixy shell does.

I have a native Windows port of zsh installed, and a GnuWin32 port of echo.exe from Coreutils.  With these two, both example Makefiles you posted to reproduce the problem work as expected (as the Cygwin build works for you).  If I rename sh.exe to something else, the test indeed doesn't work, but I wouldn't expect it to, since $$ is intended for a Unixy shell.

Admittedly, my make-3.81beta4 is patched to fix the problems discovered since the last pretest.  So perhaps try to build the current CVS version and see if the problem goes away.  If not, I'd suspect some incompatibility between Make and your shell/echo programs.

P.S.  Please don't assume that people who worfk on the Windows port don't run the test suite.  I ran the entire test suite when I built the last beta, and everything worked as expected.

Eli Zaretskii <eliz>
Group Member
Sun 12 Feb 2006 12:41:40 PM UTC, comment #1: 

When using Win32 build of GNU make 3.81 beta4 with sh.exe, `TEST #5' in the file 'tests/scripts/features/patspecific_vars' also fails. Here is the Makefile that demonstrates the exporting problem:

/%: export foo := foo

/bar:
@echo $(foo) $$foo

And here's the outputs of Win32 and Cygwin builds of  GNU make 3.81 beta4 on my Windows 2000:

C:\Temp>win32-make
foo

C:\Temp>cygwin-make
foo foo

Obviously the latter is correct.

Agent

Agent Zhang <agent>
Sun 12 Feb 2006 10:04:24 AM UTC, original submission:  

Hi~

My flatform is Windows 2000 Professional and I build GNU make 3.81 beta4 using Visual C++ .NET 2003 myself. The native Win32 build of GNU make fails the 7th test in make-3.81beta4\tests\scripts\features\export. To make the test case minimal, I'd like to give the sample Makefile that demonstrates the bug here:

--- BEGIN ---

foo = f-ok
bar = b-ok

FOO = foo
F = f

BAR = bar
B = b

export $(FOO)
export $(B)ar

all:
@echo foo=$(foo) bar=$(bar)
@echo foo=$$foo bar=$$bar

--- END ---

When use Cygwin build of make 3.81 beta4, I get what I expect:

C:\Temp>cygwin-make
foo=f-ok bar=b-ok
foo=f-ok bar=b-ok

However, when use Win32 build, I get the following:

C:\Temp>win32-make
foo=f-ok bar=b-ok
foo= bar=

I'm sure the Win32 porters of GNU make never try the GNU make test suit themselves since the test driver has some serious compatibility issues on Win32. But I do have a Win32 port of this test suit, so I can find Win32-specific bugs very easily. :=)

Cheers,
Agent

Agent Zhang <agent>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #1988:  Makefile added by agent (49B - application/octet-stream - Sample makefile triggers the problem)
file #1987:  Makefile added by agent (147B - application/octet-stream - Sample makefile that demonstrates the bug)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

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 9 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-02-13 psmith StatusNone Not A Bug
    Open/ClosedOpen Closed
2006-02-13 agent Carbon-Copy- Added -email is unavailable-
2006-02-13 agent Carbon-CopyRemoved suenlaye<layesuen@gmail.com> -
2006-02-13 agent Carbon-CopyRemoved -email is unavailable- -
2006-02-12 agent Attached File- Added Makefile, #3394
    Carbon-Copy- Added -email is unavailable-
2006-02-12 agent Attached File- Added Makefile, #3393
    Carbon-Copy- Added suenlaye<layesuen@gmail.com>

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code