Skip to content

Dependent rules issues #11

@devclinton

Description

@devclinton

I have encountered two issues with rule dependencies

The first is with comment after a dependency

depa:
	@python -c "print('A')"

all: depa # comment after dependency
	@python -c "print('TEST-PASS')"

The above will fail when running pymake all with

(venv) C:\Dev\idmtools\test_makefile>pymake all
depa # comment after dependency
Traceback (most recent call last):
  File "C:\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python\Python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Dev\idmtools\venv\Scripts\pymake.exe\__main__.py", line 7, in <module>
  File "c:\dev\idmtools\venv\lib\site-packages\pymake\_main.py", line 60, in main
    execute_makefile_commands(commands, target,
  File "c:\dev\idmtools\venv\lib\site-packages\pymake\_pymake.py", line 143, in execute_makefile_commands
    check_call(parsed_cmd)
  File "C:\Python\Python38\lib\subprocess.py", line 359, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Python\Python38\lib\subprocess.py", line 340, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Python\Python38\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Python\Python38\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

You can observe it is attempting to run the command depa # comment after dependency

The other related issue(I think) it multiple dependencies

depb:
	@python -c "print('A')"

depa:
	@python -c "print('A')"

all: depa depb
	@python -c "print('TEST-PASS')"

which fails with

(venv) C:\Dev\idmtools\test_makefile>pymake all
depa depb
Traceback (most recent call last):
  File "C:\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python\Python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Dev\idmtools\venv\Scripts\pymake.exe\__main__.py", line 7, in <module>
  File "c:\dev\idmtools\venv\lib\site-packages\pymake\_main.py", line 60, in main
    execute_makefile_commands(commands, target,
  File "c:\dev\idmtools\venv\lib\site-packages\pymake\_pymake.py", line 143, in execute_makefile_commands
    check_call(parsed_cmd)
  File "C:\Python\Python38\lib\subprocess.py", line 359, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Python\Python38\lib\subprocess.py", line 340, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Python\Python38\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Python\Python38\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

I suspect there needs to be some parsing happening on the dependencies portion of rules before execution

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions