numpy: ignore installed packages during pip install#15
Open
viniciusferrao wants to merge 1 commit into
Open
Conversation
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
📦 Package Count Analysis ResultsEnvironment: UBI 10 Container 🏭 Factory RepositoriesStatus: ✅ Factory repositories analysis completed successfully
Analysis performed by OpenHPC Package Count CI |
🚀 CCache Statistics
📊 Detailed StatisticsopenEuler (aarch64)openEuler (x86_64)RHEL (aarch64/gnu15)RHEL (x86_64/gnu15)RHEL (x86_64/intel)🤖 Generated from workflow run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the OpenHPC NumPy RPM install step so it always installs the locally built wheel into the package buildroot, even when a distro
python3-numpypackage is already present in the build environment.This changes the NumPy
%installpip invocation to use--ignore-installedand adds a buildroot sanity check fornumpy/__init__.pyunder the module'slib64/python3.12/site-packagespath.Root Cause
The RHEL aarch64/GNU15 CI failure was not caused by SLURM environment propagation or a module
PYTHONPATHmismatch. The built aarch64python3-numpy-gnu15-ohpcRPM contained only docs, the modulefile, and thebin/python3symlink. It did not containsite-packages/numpy.The aarch64 build log shows why:
Because distro
python3-numpywas already installed in the build container, pip treated the requirement as satisfied and skipped installing the locally built OHPC NumPy wheel into%{buildroot}. The modulefile then pointedPYTHONPATHat an empty install tree, sosrun python3 MM.pyfailed withModuleNotFoundError: No module named 'numpy'.Why This Fix
--ignore-installedis the correct package-build behavior here because the RPM must be populated from the wheel produced in%build, independent of whatever Python packages happen to be installed in the mutable build environment. The addedtest -fcheck makes future pip no-op or layout regressions fail during RPM build instead of surfacing later as a runtime test failure.Validation
28473398738artifacts and logs:site-packages/numpypayload.numpy-2.4.4wheel when distro NumPy was not yet installed.VersatusHPC/ohpc:4.xis one commit and one file only.rpmspec --parseon rome01 confirms the expanded%installcommand uses--ignore-installedand includes the buildroot payload check.--ignore-installed, pip reportsRequirement already satisfiedand writes no buildroot files.--ignore-installed, pip processes the local platform wheel and writeslib64/python3.12/site-packages/numpy/__init__.py.git diff --checkpasses.