Fix the nnpy installation failure for test_copp#22073
Merged
wangxin merged 1 commit intosonic-net:masterfrom Jan 26, 2026
Merged
Fix the nnpy installation failure for test_copp#22073wangxin merged 1 commit intosonic-net:masterfrom
wangxin merged 1 commit intosonic-net:masterfrom
Conversation
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
wangxin
approved these changes
Jan 26, 2026
justin-oliver
pushed a commit
to justin-oliver/sonic-mgmt
that referenced
this pull request
Jan 26, 2026
What is the motivation for this PR? To fix the failure of nnpy package installation, the root cause is This error—failed to map segment from shared object—is almost always caused by the /tmp partition being mounted with the noexec flag. In many security-hardened Linux environments (like those used for SONiC), the system prevents files in /tmp from being executed. Since pip creates a temporary build environment in /tmp to compile nnpy and cffi, the installation crashes when it tries to load the newly built library. The Fix: Change the Temporary Directory You can tell pip to use a different directory for building that has execution permissions (like your home directory or /var/tmp). Why nnpy specifically is failing? Unlike many other packages, nnpy is a "thick" wrapper around the C-library nanomsg. It uses a tool called CFFI (C Foreign Function Interface). pip downloads the nnpy source. It creates a "virtual" build environment in /tmp. It compiles a C-extension (_cffi_backend.so). It tries to "import" that C-extension to finish the metadata generation. The Linux kernel sees the file is in a noexec zone and kills the process, resulting in the error you saw. How did you do it? change to use /var/tmp-build as TMPDIR for cffi and nnpy installation. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Contributor
Author
|
@vmittal-msft could you pls approve the cherry-pick for 202511? it also happened on 202511. |
mssonicbld
pushed a commit
to mssonicbld/sonic-mgmt
that referenced
this pull request
Jan 29, 2026
What is the motivation for this PR? To fix the failure of nnpy package installation, the root cause is This error—failed to map segment from shared object—is almost always caused by the /tmp partition being mounted with the noexec flag. In many security-hardened Linux environments (like those used for SONiC), the system prevents files in /tmp from being executed. Since pip creates a temporary build environment in /tmp to compile nnpy and cffi, the installation crashes when it tries to load the newly built library. The Fix: Change the Temporary Directory You can tell pip to use a different directory for building that has execution permissions (like your home directory or /var/tmp). Why nnpy specifically is failing? Unlike many other packages, nnpy is a "thick" wrapper around the C-library nanomsg. It uses a tool called CFFI (C Foreign Function Interface). pip downloads the nnpy source. It creates a "virtual" build environment in /tmp. It compiles a C-extension (_cffi_backend.so). It tries to "import" that C-extension to finish the metadata generation. The Linux kernel sees the file is in a noexec zone and kills the process, resulting in the error you saw. How did you do it? change to use /var/tmp-build as TMPDIR for cffi and nnpy installation. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Collaborator
|
Cherry-pick PR to 202511: #22160 |
12 tasks
vmittal-msft
pushed a commit
that referenced
this pull request
Jan 30, 2026
What is the motivation for this PR? To fix the failure of nnpy package installation, the root cause is This error—failed to map segment from shared object—is almost always caused by the /tmp partition being mounted with the noexec flag. In many security-hardened Linux environments (like those used for SONiC), the system prevents files in /tmp from being executed. Since pip creates a temporary build environment in /tmp to compile nnpy and cffi, the installation crashes when it tries to load the newly built library. The Fix: Change the Temporary Directory You can tell pip to use a different directory for building that has execution permissions (like your home directory or /var/tmp). Why nnpy specifically is failing? Unlike many other packages, nnpy is a "thick" wrapper around the C-library nanomsg. It uses a tool called CFFI (C Foreign Function Interface). pip downloads the nnpy source. It creates a "virtual" build environment in /tmp. It compiles a C-extension (_cffi_backend.so). It tries to "import" that C-extension to finish the metadata generation. The Linux kernel sees the file is in a noexec zone and kills the process, resulting in the error you saw. How did you do it? change to use /var/tmp-build as TMPDIR for cffi and nnpy installation. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com> Co-authored-by: Zhaohui Sun <94606222+ZhaohuiS@users.noreply.github.com>
ytzur1
pushed a commit
to ytzur1/sonic-mgmt
that referenced
this pull request
Feb 2, 2026
What is the motivation for this PR? To fix the failure of nnpy package installation, the root cause is This error—failed to map segment from shared object—is almost always caused by the /tmp partition being mounted with the noexec flag. In many security-hardened Linux environments (like those used for SONiC), the system prevents files in /tmp from being executed. Since pip creates a temporary build environment in /tmp to compile nnpy and cffi, the installation crashes when it tries to load the newly built library. The Fix: Change the Temporary Directory You can tell pip to use a different directory for building that has execution permissions (like your home directory or /var/tmp). Why nnpy specifically is failing? Unlike many other packages, nnpy is a "thick" wrapper around the C-library nanomsg. It uses a tool called CFFI (C Foreign Function Interface). pip downloads the nnpy source. It creates a "virtual" build environment in /tmp. It compiles a C-extension (_cffi_backend.so). It tries to "import" that C-extension to finish the metadata generation. The Linux kernel sees the file is in a noexec zone and kills the process, resulting in the error you saw. How did you do it? change to use /var/tmp-build as TMPDIR for cffi and nnpy installation. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com> Signed-off-by: Yael Tzur <ytzur@nvidia.com>
abhishek-nexthop
pushed a commit
to nexthop-ai/sonic-mgmt
that referenced
this pull request
Feb 6, 2026
What is the motivation for this PR? To fix the failure of nnpy package installation, the root cause is This error—failed to map segment from shared object—is almost always caused by the /tmp partition being mounted with the noexec flag. In many security-hardened Linux environments (like those used for SONiC), the system prevents files in /tmp from being executed. Since pip creates a temporary build environment in /tmp to compile nnpy and cffi, the installation crashes when it tries to load the newly built library. The Fix: Change the Temporary Directory You can tell pip to use a different directory for building that has execution permissions (like your home directory or /var/tmp). Why nnpy specifically is failing? Unlike many other packages, nnpy is a "thick" wrapper around the C-library nanomsg. It uses a tool called CFFI (C Foreign Function Interface). pip downloads the nnpy source. It creates a "virtual" build environment in /tmp. It compiles a C-extension (_cffi_backend.so). It tries to "import" that C-extension to finish the metadata generation. The Linux kernel sees the file is in a noexec zone and kills the process, resulting in the error you saw. How did you do it? change to use /var/tmp-build as TMPDIR for cffi and nnpy installation. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Anirudh-nokia
pushed a commit
to Anirudh-nokia/sonic-mgmt-fork
that referenced
this pull request
Feb 6, 2026
What is the motivation for this PR? To fix the failure of nnpy package installation, the root cause is This error—failed to map segment from shared object—is almost always caused by the /tmp partition being mounted with the noexec flag. In many security-hardened Linux environments (like those used for SONiC), the system prevents files in /tmp from being executed. Since pip creates a temporary build environment in /tmp to compile nnpy and cffi, the installation crashes when it tries to load the newly built library. The Fix: Change the Temporary Directory You can tell pip to use a different directory for building that has execution permissions (like your home directory or /var/tmp). Why nnpy specifically is failing? Unlike many other packages, nnpy is a "thick" wrapper around the C-library nanomsg. It uses a tool called CFFI (C Foreign Function Interface). pip downloads the nnpy source. It creates a "virtual" build environment in /tmp. It compiles a C-extension (_cffi_backend.so). It tries to "import" that C-extension to finish the metadata generation. The Linux kernel sees the file is in a noexec zone and kills the process, resulting in the error you saw. How did you do it? change to use /var/tmp-build as TMPDIR for cffi and nnpy installation. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com> Signed-off-by: ayya <anirudh.ayya@nokia.com>
lakshmi-nexthop
pushed a commit
to lakshmi-nexthop/sonic-mgmt
that referenced
this pull request
Feb 11, 2026
…nic-net#22160) What is the motivation for this PR? To fix the failure of nnpy package installation, the root cause is This error—failed to map segment from shared object—is almost always caused by the /tmp partition being mounted with the noexec flag. In many security-hardened Linux environments (like those used for SONiC), the system prevents files in /tmp from being executed. Since pip creates a temporary build environment in /tmp to compile nnpy and cffi, the installation crashes when it tries to load the newly built library. The Fix: Change the Temporary Directory You can tell pip to use a different directory for building that has execution permissions (like your home directory or /var/tmp). Why nnpy specifically is failing? Unlike many other packages, nnpy is a "thick" wrapper around the C-library nanomsg. It uses a tool called CFFI (C Foreign Function Interface). pip downloads the nnpy source. It creates a "virtual" build environment in /tmp. It compiles a C-extension (_cffi_backend.so). It tries to "import" that C-extension to finish the metadata generation. The Linux kernel sees the file is in a noexec zone and kills the process, resulting in the error you saw. How did you do it? change to use /var/tmp-build as TMPDIR for cffi and nnpy installation. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com> Co-authored-by: Zhaohui Sun <94606222+ZhaohuiS@users.noreply.github.com> Signed-off-by: Lakshmi Yarramaneni <lakshmi@nexthop.ai>
nnelluri-cisco
pushed a commit
to nnelluri-cisco/sonic-mgmt
that referenced
this pull request
Feb 12, 2026
What is the motivation for this PR? To fix the failure of nnpy package installation, the root cause is This error—failed to map segment from shared object—is almost always caused by the /tmp partition being mounted with the noexec flag. In many security-hardened Linux environments (like those used for SONiC), the system prevents files in /tmp from being executed. Since pip creates a temporary build environment in /tmp to compile nnpy and cffi, the installation crashes when it tries to load the newly built library. The Fix: Change the Temporary Directory You can tell pip to use a different directory for building that has execution permissions (like your home directory or /var/tmp). Why nnpy specifically is failing? Unlike many other packages, nnpy is a "thick" wrapper around the C-library nanomsg. It uses a tool called CFFI (C Foreign Function Interface). pip downloads the nnpy source. It creates a "virtual" build environment in /tmp. It compiles a C-extension (_cffi_backend.so). It tries to "import" that C-extension to finish the metadata generation. The Linux kernel sees the file is in a noexec zone and kills the process, resulting in the error you saw. How did you do it? change to use /var/tmp-build as TMPDIR for cffi and nnpy installation. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com> Signed-off-by: nnelluri-cisco <nnelluri@cisco.com>
rraghav-cisco
pushed a commit
to rraghav-cisco/sonic-mgmt
that referenced
this pull request
Feb 13, 2026
What is the motivation for this PR? To fix the failure of nnpy package installation, the root cause is This error—failed to map segment from shared object—is almost always caused by the /tmp partition being mounted with the noexec flag. In many security-hardened Linux environments (like those used for SONiC), the system prevents files in /tmp from being executed. Since pip creates a temporary build environment in /tmp to compile nnpy and cffi, the installation crashes when it tries to load the newly built library. The Fix: Change the Temporary Directory You can tell pip to use a different directory for building that has execution permissions (like your home directory or /var/tmp). Why nnpy specifically is failing? Unlike many other packages, nnpy is a "thick" wrapper around the C-library nanomsg. It uses a tool called CFFI (C Foreign Function Interface). pip downloads the nnpy source. It creates a "virtual" build environment in /tmp. It compiles a C-extension (_cffi_backend.so). It tries to "import" that C-extension to finish the metadata generation. The Linux kernel sees the file is in a noexec zone and kills the process, resulting in the error you saw. How did you do it? change to use /var/tmp-build as TMPDIR for cffi and nnpy installation. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com> Signed-off-by: Raghavendran Ramanathan <rraghav@cisco.com>
anilal-amd
pushed a commit
to anilal-amd/anilal-forked-sonic-mgmt
that referenced
this pull request
Feb 19, 2026
What is the motivation for this PR? To fix the failure of nnpy package installation, the root cause is This error—failed to map segment from shared object—is almost always caused by the /tmp partition being mounted with the noexec flag. In many security-hardened Linux environments (like those used for SONiC), the system prevents files in /tmp from being executed. Since pip creates a temporary build environment in /tmp to compile nnpy and cffi, the installation crashes when it tries to load the newly built library. The Fix: Change the Temporary Directory You can tell pip to use a different directory for building that has execution permissions (like your home directory or /var/tmp). Why nnpy specifically is failing? Unlike many other packages, nnpy is a "thick" wrapper around the C-library nanomsg. It uses a tool called CFFI (C Foreign Function Interface). pip downloads the nnpy source. It creates a "virtual" build environment in /tmp. It compiles a C-extension (_cffi_backend.so). It tries to "import" that C-extension to finish the metadata generation. The Linux kernel sees the file is in a noexec zone and kills the process, resulting in the error you saw. How did you do it? change to use /var/tmp-build as TMPDIR for cffi and nnpy installation. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com> Signed-off-by: Zhuohui Tan <zhuohui.tan@amd.com>
Merged
12 tasks
Collaborator
|
Cherry-pick PR to msft-202412: Azure/sonic-mgmt.msft#1032 |
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.
Description of PR
Summary:
Fixes # (issue)
nnpy package installation failed in test_copp on master image.
Type of change
Back port request
Approach
What is the motivation for this PR?
To fix the failure of nnpy package installation, the root cause is
This error—failed to map segment from shared object—is almost always caused by the /tmp partition being mounted with the noexec flag.
In many security-hardened Linux environments (like those used for SONiC), the system prevents files in /tmp from being executed. Since pip creates a temporary build environment in /tmp to compile nnpy and cffi, the installation crashes when it tries to load the newly built library.
The Fix: Change the Temporary Directory
You can tell pip to use a different directory for building that has execution permissions (like your home directory or /var/tmp).
Why nnpy specifically is failing?
The Linux kernel sees the file is in a noexec zone and kills the process, resulting in the error you saw.
How did you do it?
change to use
/var/tmp-buildasTMPDIRforcffiandnnpyinstallation.How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation