orig_wrapped_math_build = read_file(self._wrapped_math_build_file)
without_strict_deps_wrapped_math_build = re.sub(
"strict_deps=False,", "", orig_wrapped_math_build)
safe_file_dump(self._wrapped_math_build_file, without_strict_deps_wrapped_math_build)
// This should fail because it does not turn on strict_deps for a target which requires it.
pants_binary_strict_deps_failure = self.run_pants_with_workdir(
command=["binary", self._binary_target_with_interop],
// Explicitly set to True (although this is the default).
config={"native-build-settings": {"strict_deps": True}},
workdir=os.path.join(buildroot.new_buildroot, ".pants.d"),
build_root=buildroot.new_buildroot)
self.assert_failure(pants_binary_strict_deps_failure)
self.assertIn("fatal error: "some_math.h" file not found",
pants_binary_strict_deps_failure.stdout_data)
pants_run_interop = self.run_pants(["-q", "run", self._binary_target_with_interop], config={
"native-build-settings": {
"strict_deps": False,
},
})
self.assert_success(pants_run_interop)
self.assertEqual("x=3, f(x)=299\n", pants_run_interop.stdout_data)
def test_ctypes_third_party_integration(self):