Skip to content

Commit

Permalink
Emit a warning & --no-deps suggestion (#181)
Browse files Browse the repository at this point in the history
As per
#176 (comment),
#176 (comment),
and
#176 (comment),
we suggest passing `--no-deps` when `make` complains `Argument list too
long` and `No rule to make target '.*.glob'`.
  • Loading branch information
JasonGross authored Nov 2, 2023
1 parent 7e70ce6 commit bddc2b8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions coq_tools/import_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,9 @@ def run_coq_makefile_and_make(v_files, targets, **kwargs):
make_cmds = ['make', '-k', '-f', mkfile] + keep_error_fragment + targets
kwargs['log'](' '.join(make_cmds))
try:
p_make = subprocess.Popen(make_cmds, stdin=subprocess.PIPE, stdout=sys.stderr) #, stdout=subprocess.PIPE)
return p_make.communicate()
p_make = subprocess.Popen(make_cmds, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
p_make_stdout, p_make_stderr = p_make.communicate()
return p_make_stdout.decode('utf-8')
finally:
for filename in (mkfile, mkfile + '.conf', mkfile + '.d', '.%s.d' % mkfile, '.coqdeps.d'):
if os.path.exists(filename):
Expand Down Expand Up @@ -484,7 +485,9 @@ def make_globs(logical_names, **kwargs):
for v_name in all_filenames_v:
make_one_glob_file(v_name, **kwargs)
else:
(stdout_make, stderr_make) = run_coq_makefile_and_make(tuple(sorted(filenames_v + extra_filenames_v)), filenames_glob, **kwargs)
stdouterr_make = run_coq_makefile_and_make(tuple(sorted(filenames_v + extra_filenames_v)), filenames_glob, **kwargs)
if 'Argument list too long' in stdouterr_make and re.search(r"No rule to make target '.*\.glob'", stdouterr_make):
kwargs['log']("WARNING: Making globs may not have succeeded, consider passing " + kwargs['cli_mapping']['use_coq_makefile_for_deps'][False][0])

def get_glob_file_for(filename, update_globs=False, **kwargs):
kwargs = fill_kwargs(kwargs)
Expand Down

0 comments on commit bddc2b8

Please sign in to comment.