0004-wafsamba-avoid-pre-forking-if-cross-compilation-is-e.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 9c3cf5f67053124c6bbdf9c4705fa1d2d416f873 Mon Sep 17 00:00:00 2001
  2. From: Uri Simchoni <uri@samba.org>
  3. Date: Mon, 7 Oct 2019 00:37:31 +0300
  4. Subject: [PATCH] wafsamba: avoid pre-forking if cross-compilation is enabled
  5. Waf supports pre-forking to run configuration tests, but this
  6. doesn't play well with Samba's cross-compilation support, because
  7. Samba monkey-patches the actual fork+exec, which doesn't happen
  8. in a pre-forked process pool.
  9. This patch emulates the impact of WAF_NO_PREFORK env var when
  10. cross-compilation is enabled.
  11. The blueprint for the solution has been suggested by Thomas Nagy
  12. in https://bugzilla.samba.org/show_bug.cgi?id=13846#c7 (item #2)
  13. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13846
  14. Signed-off-by: Uri Simchoni <uri@samba.org>
  15. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  16. ---
  17. buildtools/wafsamba/samba_cross.py | 2 ++
  18. 1 file changed, 2 insertions(+)
  19. diff --git a/buildtools/wafsamba/samba_cross.py b/buildtools/wafsamba/samba_cross.py
  20. index 60ddf967237..6fca470f2b7 100644
  21. --- a/buildtools/wafsamba/samba_cross.py
  22. +++ b/buildtools/wafsamba/samba_cross.py
  23. @@ -147,6 +147,8 @@ def SAMBA_CROSS_ARGS(conf, msg=None):
  24. if real_Popen is None:
  25. real_Popen = Utils.subprocess.Popen
  26. Utils.subprocess.Popen = cross_Popen
  27. + Utils.run_process = Utils.run_regular_process
  28. + Utils.get_process = Utils.alloc_process_pool = Utils.nada
  29. ret = []
  30. --
  31. 2.20.1