Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 948897 - sci-ml/{caffe2,pytorch}: ebuilds do not respect $EPREFIX
Summary: sci-ml/{caffe2,pytorch}: ebuilds do not respect $EPREFIX
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Tupone Alfredo
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-27 12:19 UTC by Michael Schubert
Modified: 2025-03-26 07:41 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patches to respect $EPREFIX (pytorch.patch,1.80 KB, patch)
2025-01-27 12:20 UTC, Michael Schubert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Schubert 2025-01-27 12:19:02 UTC
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
Comment 1 Michael Schubert 2025-01-27 12:20:22 UTC
Created attachment 917594 [details, diff]
Patches to respect $EPREFIX
Comment 2 Mike Gilbert gentoo-dev 2025-01-28 21:04:55 UTC
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}".
Comment 3 Fabian Groffen gentoo-dev 2025-01-28 21:05:50 UTC
and use $(get_libname) instead of .so
Comment 4 Larry the Git Cow gentoo-dev 2025-03-17 20:56:38 UTC
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(-)
Comment 5 Tupone Alfredo gentoo-dev 2025-03-17 21:05:53 UTC
I think ${ED} should go on both side of the 2 mv instead of ${D}
Comment 6 Michael Schubert 2025-03-19 10:15:26 UTC
$(python_get_sitedir) should include ${EPREFIX}
Comment 7 Larry the Git Cow gentoo-dev 2025-03-21 22:12:54 UTC
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(-)
Comment 8 Michael Schubert 2025-03-25 11:50:56 UTC
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
Comment 9 Larry the Git Cow gentoo-dev 2025-03-26 07:41:52 UTC
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(-)