[Scons-users] Random build failure with 'Resource temporarily unavailable' on mac

Julien Pommier pommier at pianoteq.com
Wed Jun 10 06:58:18 EDT 2020


Hi,

I have an issue that has been randomly annoying me for a few years, when building a largish application on macs. From time to time, the build will fail with this error:

 *** [build/darwin/foo.o] Resource temporarily unavailable

It does not always happen at the same place in the build, it is really random and hard to reproduce. I have finally traced which instruction is failing in scons, and it turns out it is:

                sys.stdout.write(s + u"\n”) , in print_cmd_line in Action.py 

which sometime throws an IOError (errno=35) exception. 

I feel that this happens only when building with more than one job, so maybe this is related to a threading issue or bug in python ? This happens when running scons with the system installed python 2.7 (which I usually do), but also with python3 — in that case, the error reported with python 3 is

scons:  *** [build/darwin/foo.o] write could not complete without blocking

The exception stack trace is:

  File "/usr/local/Cellar/scons/3.1.1/libexec/scons-local/SCons/Taskmaster.py", line 255, in execute
    self.targets[0].build()
  File "/usr/local/Cellar/scons/3.1.1/libexec/scons-local/SCons/Node/__init__.py", line 765, in build
    self.get_executor()(self, **kw)
  File "/usr/local/Cellar/scons/3.1.1/libexec/scons-local/SCons/Executor.py", line 397, in __call__
    return _do_execute_map[self._do_execute](self, target, kw)
  File "/usr/local/Cellar/scons/3.1.1/libexec/scons-local/SCons/Executor.py", line 128, in execute_action_list
    status = act(*args, **kw)
  File "/usr/local/Cellar/scons/3.1.1/libexec/scons-local/SCons/Action.py", line 1056, in __call__
    show, execute, chdir, executor)
  File "/usr/local/Cellar/scons/3.1.1/libexec/scons-local/SCons/Action.py", line 1123, in __call__
    return c.__call__(self, target, source, env, *args, **kw)
  File "/usr/local/Cellar/scons/3.1.1/libexec/scons-local/SCons/Action.py", line 705, in __call__
    print_func(cmd, target, source, env)
  File "/usr/local/Cellar/scons/3.1.1/libexec/scons-local/SCons/Action.py", line 639, in print_cmd_line
    sys.stdout.write(s + u"\n")
scons: *** [build/darwin/foo.o] write could not complete without blocking

I have figured a “fix” which is to just ignore IOError exceptions in the print_cmd_line function, but of course this is not very satisfactory.





More information about the Scons-users mailing list