Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: macOS tests & use LIBS instead of LDFLAGS #1

Open
wants to merge 2 commits into
base: portable_python
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions builders/ubuntu-python-builder.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the benefit of LIBS over LDFLAGS?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's in the commit message:

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

$configureString = "./configure"
$configureString += " --prefix=$pythonBinariesLocation"
$configureString += " --enable-shared"
Expand All @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions tests/python-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down