Boost logo

Boost-Build :

From: K. Noel Belcourt (kbelco_at_[hidden])
Date: 2008-05-16 12:42:33


On May 16, 2008, at 6:34 AM, Dirk Griffioen wrote:

> Felipe Magno de Almeida wrote:
>>
>> PowerShell from Microsoft have higher limits, I wonder if it is
>> possible to configure boost.build to use powershell instead
>> of cmd.exe for execute commands.
>> I'm having problems with compile.rc giving actions too long errors
>> because it doesn't have the @ option as does
>> the link and cl commands.
>
> You could set the max to something like 8092 long - see
> http://www.code-shop.com/2007/7/18/bjam-max_path

We have the same problem (archive actions too long) under AIX
(default shell buffer is 8k). I modified jam.[hc] to subtract from
the default shell buffer size, the size of the user's environment.
This seems to work well for AIX and may work for you. Here's the
changes we made to jam.c:

Index: jam.c
===================================================================
--- jam.c (revision 45429)
+++ jam.c (working copy)

+#ifdef _AIX
+ int MAXLINE = SHELL_BUFFER_LENGTH
  #endif

  int main( int argc, char **argv, char **arg_environ )
      char ** arg_v = argv;
      const char *progname = argv[0];

+#ifdef _AIX
+ /* Eliminate AIX archive rule failures by subtracting the
+ * size of the user's environment from the available shell
+ * buffer size.
+ *
+ * Changed MAXLINE to an int from a macro so we can update
+ * it based on the size of the user's environment.
+ */
+ int sum = 0, i = 0;
+ while (arg_environ[i]) {
+ sum += strlen(arg_environ[i++]) + 1;
+ }
+ MAXLINE -= sum;
+#endif
+

and to jam.h

Index: jam.h
===================================================================
--- jam.h (revision 45429)
+++ jam.h (working copy)
@@ -218,7 +218,8 @@

  # ifdef _AIX
  # define unix
-# define MAXLINE 23552 /* 24k - 1k, longest 'together' actions */
+# define SHELL_BUFFER_LENGTH 24576; /* 24k, longest 'together'
actions */
+extern int MAXLINE;
  # define OSMINOR "OS=AIX"
  # define OS_AIX
  # define NO_VFORK

@@ -495,7 +494,7 @@
   * Jam implementation misc.
   */

-# ifndef MAXLINE
+# if !defined(MAXLINE) && !defined(_AIX)
  # define MAXLINE 102400 /* longest 'together' actions' */
  # endif

Perhaps we could generalize this and make it available to all
platform shells to avoid, where possible, the dreaded "action too
long" error message?

-- Noel


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk