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

AIX build failing because of python.exp not being created before building shared modules. #96269

Closed
ayappanec opened this issue Aug 25, 2022 · 8 comments
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@ayappanec
Copy link
Contributor

ayappanec commented Aug 25, 2022

https://buildbot.python.org/all/#/builders/438/builds/3408

AIX build is failing with the main branch. The error thrown is "Modules/python.exp" file not found while building the shared modules. In AIX, the export file is required for the creation of shared modules.
So the "sharedmods" target needs "EXPORTSYMS" target to be built before so that the export file is created before building the shared modules.

@ayappanec ayappanec added the type-bug An unexpected behavior, bug, or error label Aug 25, 2022
@AlexWaygood AlexWaygood added the build The build process and cross-build label Aug 25, 2022
tiran added a commit to tiran/cpython that referenced this issue Aug 26, 2022
@tiran
Copy link
Member

tiran commented Aug 26, 2022

Problem is fixed in main branch.

@ayappanec
Copy link
Contributor Author

The fix didn't work actually. It introduced a circular dependency and the creation of libpython3.12.a didn't happen, so it ended up creating a empty python.exp file.

https://buildbot.python.org/all/#/builders/438/builds/3413/steps/3/logs/stdio

gmake: Circular Modules/python.exp <- libpython3.12.a dependency dropped.
./Modules/makexp_aix Modules/python.exp "."

I already have working fix for the original issue. Planning to create a PR.
@tiran Can you revert the changes ?

@tiran
Copy link
Member

tiran commented Aug 26, 2022

Does #96316 work for you?

@ayappanec
Copy link
Contributor Author

The above works.
But I have created a fix like this

diff --git a/Modules/makesetup b/Modules/makesetup
index 08303814c8..85bdf03187 100755
--- a/Modules/makesetup
+++ b/Modules/makesetup
@@ -99,6 +99,12 @@ CYGWIN*) if test $libdir = .
         ExtraLibs="-L$ExtraLibDir -lpython\$(LDVERSION)";;
 esac
 
+# AIX needs export file to build shared modules
+# So needs EXPORTSYMS target before building shared modules
+case `uname -s` in
+AIX*)    ExpFileTarget="\$(EXPORTSYMS)";;
+esac
+
 # Main loop
 for i in ${*-Setup}
 do
@@ -282,7 +288,7 @@ sed -e 's/[         ]*#.*//' -e '/^[        ]*$/d' |
                                BUILT_SHARED="$BUILT_SHARED $mod"
                                ;;
                        esac
-                       rule="$file: $objs"
+                       rule="$file: $objs $ExpFileTarget"
                        rule="$rule; \$(BLDSHARED) $objs $libs $ExtraLibs -o $file"
                        echo "$rule" >>$rulesf
                done

Let me know your opinion about my fix.

@ayappanec
Copy link
Contributor Author

#96316 also considers the static build of the modules case (where EXPORTSYMS is not required).
So I think we can go ahead with #96316.

@ayappanec
Copy link
Contributor Author

@tiran Can #96316 be merged? . This will fix one of the two build issues in AIX.

@ayappanec
Copy link
Contributor Author

@tiran

@ayappanec
Copy link
Contributor Author

Can this be merged please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants