From 21938ed9f0d4a7382cf796a93881582862798ed4 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 10 Nov 2024 19:01:12 +0100 Subject: [PATCH 1/2] fix: macOS tests --- tests/python-tests.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/python-tests.ps1 b/tests/python-tests.ps1 index 8acbd9c2..1eb5cb20 100644 --- a/tests/python-tests.ps1 +++ b/tests/python-tests.ps1 @@ -94,7 +94,9 @@ Describe "Tests" { It "Check if shared libraries are linked correctly" { "bash ./sources/psutil-install-test.sh" | Should -ReturnZeroExitCode } + } + if (($Platform -match "ubuntu") -or ($Platform -match "linux")) { It "Relocatable Python" { $semversion = [semver] $Version $pyfilename = "python$($semversion.Major).$($semversion.Minor)" From 2733e1b4ab624ee4f6ffd682109651c58c582b85 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 10 Nov 2024 19:04:47 +0100 Subject: [PATCH 2/2] fix: use LIBS instead of LDFLAGS LDFLAGS applies to everything including later user builds (e.g. building a wheel) LDFLAGS_NODIST could be used but is probably unnecessary (also applies to cpython stdlib C modules which is probably unwanted) LIBS only applies to the python executable and libpython library, this is most likely enough. https://docs.python.org/3/using/configure.html#envvar-LIBS --- builders/ubuntu-python-builder.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builders/ubuntu-python-builder.psm1 b/builders/ubuntu-python-builder.psm1 index e7a6eb3c..9b486629 100644 --- a/builders/ubuntu-python-builder.psm1 +++ b/builders/ubuntu-python-builder.psm1 @@ -31,7 +31,7 @@ class UbuntuPythonBuilder : NixPythonBuilder { $pythonBinariesLocation = $this.GetFullPythonToolcacheLocation() ### To build Python with SO, passing relative path W.r.t to the binary location. - $env:LDFLAGS="-Wl,-rpath='`$`$ORIGIN/../lib'" + $env:LIBS = "-Wl,--enable-new-dtags,-rpath='`$`$ORIGIN/../lib'" $configureString = "./configure" $configureString += " --prefix=$pythonBinariesLocation" $configureString += " --enable-shared" @@ -43,7 +43,7 @@ class UbuntuPythonBuilder : NixPythonBuilder { Write-Host "The passed configure options are: " Write-Host $configureString - Write-Host "LDFLAGS: $env:LDFLAGS" + Write-Host "LIBS: $env:LIBS" Execute-Command -Command $configureString }