Bjam max_cmd ...

July 18th, 2007

I got the following error when I run my fresh compile of bjam, v1.14 from boost_1_34:

Building Boost.Regex with the optional Unicode/ICU support disabled.
Please refer to the Boost.Regex documentation for more information
(don't panic: this is a strictly optional feature).
...found 7995 targets...
...updating 1 target...
testing.unit-test actions too long (max 2047):

I think I already posted this some time ago, with boost_1_33.

According to MS, commandlengths can be 8192. (It’s still a limit, but it’s a start – on XP / using CMD.EXE).

You will need to recompile bjam with the following change in execnt.c (line nr 113), change the 2047 to 8191:

    /* Set the maximum command line length according to the OS */
    return is_nt_351 ? 996
        : is_win95 ? 1023
        : 8191;

And your problem will go away – for (lets hope) a while.

NB – the code has changed in boost_1_35 (but you can still find the 2047).

When the title of this entry looks familiar (You must have been directed here by a search engine. :)) my guess is that you have been using libCurl and somehow got it to report this error message.

In my case it happened because I was doing a download, an upload, and a download again. The last download failed with the above error. Searching for an answer got me to think it was the server side not responding well to a request. This wasn’t the case at all.

The reason was simple. I was re-using a transfer class and not resetting all the libCurl options to their defaults, so some of the upload options leaked to the last download call.