Trying to compile the ebuilds for caffe2 and pytorch, I'm getting errors concerning the missing files that stem from using root paths instead of $EPREFIX paths, and root paths in the patches. This is caused by the "mv" and "cp" commands used. I will attach a patch that works in my system. Reproducible: Always
Created attachment 917594 [details, diff] Patches to respect $EPREFIX
Comment on attachment 917594 [details, diff] Patches to respect $EPREFIX >diff --git a/sci-libs/pytorch/pytorch-2.5.1-r1.ebuild b/sci-libs/pytorch/pytorch-2.5.1-r1.ebuild >index e90ea383ae..5054abd9d4 100644 >--- a/sci-libs/pytorch/pytorch-2.5.1-r1.ebuild >+++ b/sci-libs/pytorch/pytorch-2.5.1-r1.ebuild >@@ -48,7 +48,7 @@ src_prepare() { > distutils-r1_src_prepare > > # Get object file from caffe2 >- cp /var/lib/caffe2/functorch.so functorch/functorch.so || die >+ cp "${EPREFIX}"/var/lib/caffe2/functorch.so functorch/functorch.so || die > > hprefixify tools/setup_helpers/env.py > } This should probably be "${ESYSROOT}" instead of "${EPREFIX}".
and use $(get_libname) instead of .so
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e0c68d4f02819eaf869827dd432ca906529030a commit 0e0c68d4f02819eaf869827dd432ca906529030a Author: Alfredo Tupone <tupone@gentoo.org> AuthorDate: 2025-03-17 20:56:06 +0000 Commit: Alfredo Tupone <tupone@gentoo.org> CommitDate: 2025-03-17 20:56:06 +0000 sci-ml/pytorch: fix build on prefix Bug: https://bugs.gentoo.org/948897 Signed-off-by: Alfredo Tupone <tupone@gentoo.org> sci-ml/pytorch/pytorch-2.5.1-r1.ebuild | 2 +- sci-ml/pytorch/pytorch-2.6.0.ebuild | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
I think ${ED} should go on both side of the 2 mv instead of ${D}
$(python_get_sitedir) should include ${EPREFIX}
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2cb3eedf9f08e841e4623c3636429a232135a9f5 commit 2cb3eedf9f08e841e4623c3636429a232135a9f5 Author: Alfredo Tupone <tupone@gentoo.org> AuthorDate: 2025-03-21 22:08:14 +0000 Commit: Alfredo Tupone <tupone@gentoo.org> CommitDate: 2025-03-21 22:12:37 +0000 sci-ml/caffe2: fix prefix Closes: https://bugs.gentoo.org/948897 Signed-off-by: Alfredo Tupone <tupone@gentoo.org> sci-ml/caffe2/caffe2-2.5.1-r8.ebuild | 4 ++-- sci-ml/caffe2/caffe2-2.6.0.ebuild | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
I think this does not yet include the proposed: """ diff --git a/sci-libs/caffe2/files/caffe2-2.5.1-newfix-functorch-install.patch b/sci-libs/caffe2/files/caffe2-2.5.1-newfix-functorch-install.patch index 499a3c74c8..fe16facb97 100644 --- a/sci-libs/caffe2/files/caffe2-2.5.1-newfix-functorch-install.patch +++ b/sci-libs/caffe2/files/caffe2-2.5.1-newfix-functorch-install.patch @@ -5,4 +5,4 @@ set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS ${TORCH_PYTHON_LINK_FLAGS}) endif() -install(TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}") -+install(TARGETS ${PROJECT_NAME} DESTINATION "/var/lib/caffe2/") ++install(TARGETS ${PROJECT_NAME} DESTINATION "$ENV{EPREFIX}/var/lib/caffe2/") """ resulting in: * QA Notice: the following files are outside of the prefix: * /var/lib/caffe2/functorch.so * ERROR: sci-ml/caffe2-2.6.0-r2::gentoo failed: * Aborting due to QA concerns: there are files installed outside the prefix
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b17c692c014c6985ffe4a113b70c8adc1a42bcb3 commit b17c692c014c6985ffe4a113b70c8adc1a42bcb3 Author: Alfredo Tupone <tupone@gentoo.org> AuthorDate: 2025-03-26 07:37:41 +0000 Commit: Alfredo Tupone <tupone@gentoo.org> CommitDate: 2025-03-26 07:38:16 +0000 sci-ml/caffe2: fix for prefix Bug: https://bugs.gentoo.org/948897 Signed-off-by: Alfredo Tupone <tupone@gentoo.org> sci-ml/caffe2/files/caffe2-2.5.1-newfix-functorch-install.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)