mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
build: pass directory instead of list of files to js2c.py
On Windows there is a limit to the length of commands, so there will be an error once the lengths of the JS file names combined exceed that limit. This patch modifies js2c.py so that it now takes a --directory argument to glob for .js and .mjs files in addition to the list of files passed directly. We still pass the additional files we include from deps/ directly through the command line, as we only includes some of them so we cannot simply glob, but those are limited so listing them out should be fine. Refs: https://docs.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation PR-URL: https://github.com/nodejs/node/pull/39069 Refs: https://github.com/nodejs/node/pull/38971 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
11430a6de3
commit
44ecd41892
4 changed files with 63 additions and 247 deletions
|
@ -26,8 +26,10 @@
|
|||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
import glob
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
|
||||
|
||||
# Reads a .list file into an array of strings
|
||||
|
@ -106,3 +108,10 @@ def GuessArchitecture():
|
|||
|
||||
def IsWindows():
|
||||
return GuessOS() == 'win32'
|
||||
|
||||
|
||||
def SearchFiles(dir, ext):
|
||||
list = glob.glob(dir+ '/**/*.' + ext, recursive=True)
|
||||
if sys.platform == 'win32':
|
||||
list = [ x.replace('\\', '/')for x in list]
|
||||
return list
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue