Re: Max env-var size on Win-XP

2014-02-07 Thread Eli Zaretskii
 Date: Thu, 06 Feb 2014 16:36:52 +0200
 From: Eli Zaretskii e...@gnu.org
 Cc: bug-make@gnu.org
 
  From: Gisle Vanem gva...@yahoo.no
  Date: Thu, 6 Feb 2014 14:30:41 +0100
  
  Eli Zaretskii e...@gnu.org wrote:
  
   Wouldn't it be better to display the error only if CreateProcess fails
   with e=87 _and_ the environment is larger than 32KB?  That would allow
   us to avoid calling GetVersionEx, which MS wants to deprecate (see
   http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451%28v=vs.85%29.aspx).
   
   Would you like to write a modified patch along these lines?
  
  I did send you some patches for this, but nothing has happended to it; it's 
  not in the git-repo. Some problem with it?
 
 No problem, your patch is sitting in my inbox waiting for me to commit
 it.  I will do that when I have time.

Pushed, with some minor changes.

Thanks.

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: Max env-var size on Win-XP

2014-02-06 Thread Eli Zaretskii
 From: Gisle Vanem gva...@yahoo.no
 Date: Thu, 6 Feb 2014 14:30:41 +0100
 
 Eli Zaretskii e...@gnu.org wrote:
 
  Wouldn't it be better to display the error only if CreateProcess fails
  with e=87 _and_ the environment is larger than 32KB?  That would allow
  us to avoid calling GetVersionEx, which MS wants to deprecate (see
  http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451%28v=vs.85%29.aspx).
  
  Would you like to write a modified patch along these lines?
 
 I did send you some patches for this, but nothing has happended to it; it's 
 not in the git-repo. Some problem with it?

No problem, your patch is sitting in my inbox waiting for me to commit
it.  I will do that when I have time.

Thanks.

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: Max env-var size on Win-XP

2014-02-03 Thread Gisle Vanem

 Would you like to write a modified patch along these lines?

Okay, will do. 


Done. Output in this case is now something like:

 process_begin: CreateProcess(g:\MingW32\msys\bin\echo.exe, echo Generating 
.., ...) failed.
 CreateProcess probably failed due to a too large environment. Env-size is 
33881 bytes.
 make (e=87): Parameteren er feil


According to my references, GetVersionEx is supported on Windows 9X,
so there should be no problem using it.  However, I'd like to avoid
looking at the version.


My revised patch doesn't use GetVersionEx(). Attached.

--gv

env_size_warning.diff
Description: Binary data
___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: Max env-var size on Win-XP

2014-02-03 Thread Gisle Vanem

Gisle Vanem gva...@yahoo.no wrote:


My revised patch doesn't use GetVersionEx(). Attached.


I forgot the patch for proc.h:

diff --git a/w32/subproc/proc.h b/w32/subproc/proc.h
index 62ebf65..ed8d3d4 100644
--- a/w32/subproc/proc.h
+++ b/w32/subproc/proc.h
@@ -24,6 +24,6 @@ typedef int bool_t;
#define E_NO_MEM   103
#define E_FORK 104

-extern bool_t arr2envblk(char **arr, char **envblk_out);
+extern bool_t arr2envblk(char **arr, char **envblk_out, int *envsize_needed);

--gv

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: Max env-var size on Win-XP

2014-02-02 Thread Eli Zaretskii
 From: Gisle Vanem gva...@yahoo.no
 Date: Sun, 2 Feb 2014 15:06:23 +0100
 
 According to:
   
 http://msdn.microsoft.com/en-us/library/windows/desktop/ms682653(v=vs.85).aspx
 
 the total size of the environment is 32kByte. This has hit me several
 times in GNU-make when CreateProcess() triggers the mysterious error
 87 (ERROR_INVALID_PARAMETER). Like in a very simple rule that involves
 'echo':
 
 process_begin: CreateProcess(g:\MingW32\msys\bin\echo.exe, echo Generating 
 ..., ...) failed.
 make (e=87): Parameteren er feil   Invalid parameter.
 
 I've added a patch to arr2envblk() that checks the Win OS-version and prints 
 a warning
 if 'size_needed' exceeds 32 kByte. 

Wouldn't it be better to display the error only if CreateProcess fails
with e=87 _and_ the environment is larger than 32KB?  That would allow
us to avoid calling GetVersionEx, which MS wants to deprecate (see
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451%28v=vs.85%29.aspx).

Would you like to write a modified patch along these lines?

 I'm not sure if the warning should be printed only when --debug=jobs is in 
 effect
 or always. But only once. Your choice.

I think always is better, if we only print it in the case of a
failure.

Thanks.

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: Max env-var size on Win-XP

2014-02-02 Thread Gisle Vanem

Eli Zaretskii e...@gnu.org wrote:


Wouldn't it be better to display the error only if CreateProcess fails
with e=87 _and_ the environment is larger than 32KB?  That would allow
us to avoid calling GetVersionEx, which MS wants to deprecate (see
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451%28v=vs.85%29.aspx).


To use this new Version Helper API, much more rewrite is needed. 
Allthough GetVersionEx() is deprecated, it will still work for the foreseable future.



Would you like to write a modified patch along these lines?


Okay, will do. 

BTW. Do we support Win-9x/ME? If so, maybe we need to use GetVersionEx() more 
 carefully. I.e. loaded dynamically?


--gv

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make