Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 668680 - cargo.eclass does not set any dependencies
Summary: cargo.eclass does not set any dependencies
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo Rust Project
URL:
Whiteboard:
Keywords:
: 663520 663890 665290 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-10-15 07:06 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2018-10-15 19:36 UTC (History)
1 user (show)

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


Attachments
Patch (cargo.eclass.patch,1.09 KB, patch)
2018-10-15 07:14 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis 2018-10-15 07:06:05 UTC
cargo.eclass does not set any dependencies since https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79193548f4bf7d853c86cae4566fc74840be6e8c

commit 79193548f4bf7d853c86cae4566fc74840be6e8c
Author:     Dirkjan Ochtman <djc@gentoo.org>
AuthorDate: 2018-08-04 12:34:38 +0000
Commit:     Dirkjan Ochtman <djc@gentoo.org>
CommitDate: 2018-08-08 12:30:07 +0000

    cargo.eclass: support EAPI 7


...
 case ${EAPI} in
-	6) : ;;
+	6) : DEPEND="${DEPEND} ${CARGO_DEPEND}";;
+	7) : BDEPEND="${BDEPEND} ${CARGO_DEPEND}";;
...


":" is an empty command, which by itself does not do anything with its arguments, so passing argument looking like variable="value" to this command has no effect:

$ declare -p aaa
bash: declare: aaa: not found
$ : aaa="bbb"
$ declare -p aaa
bash: declare: aaa: not found
$ 


You might have mistaken it with the ${variable:=value} construction, which is sometimes used with ":" command.
${variable:=value} results in assigning a variable.
${variable:=value} can be used alone or with any other command, not necessarily ":" command, but if the only purpose is assigning a variable, then it happens to be usually used with ":" command:

$ declare -p file1 file2 file3
bash: declare: file1: not found
bash: declare: file2: not found
bash: declare: file3: not found
$ ${file1:=/usr/bin/git} --version
git version 2.19.1
$ ls -l ${file2:=/usr/bin/hg}
lrwxrwxrwx 1 root root 31 Oct 15 01:31 /usr/bin/hg -> ../lib/python-exec/python-exec2
$ : ${file3:=/usr/bin/svn}
$ declare -p file1 file2 file3
declare -- file1="/usr/bin/git"
declare -- file2="/usr/bin/hg"
declare -- file3="/usr/bin/svn"
$ 


In order to fix cargo.eclass, I suggest to simply directly assign DEPEND or BDEPEND variables.
These are the only assignments of these variables in this eclass, so there is no need to reference the earlier value which is always empty. (inherit() function provided by package manager clears value of IUSE, REQUIRED_USE and *DEPEND variables before each eclass.)
Comment 1 Arfrever Frehtes Taifersar Arahesis 2018-10-15 07:07:01 UTC
*** Bug 663520 has been marked as a duplicate of this bug. ***
Comment 2 Arfrever Frehtes Taifersar Arahesis 2018-10-15 07:07:07 UTC
*** Bug 663890 has been marked as a duplicate of this bug. ***
Comment 3 Arfrever Frehtes Taifersar Arahesis 2018-10-15 07:07:13 UTC
*** Bug 665290 has been marked as a duplicate of this bug. ***
Comment 4 Arfrever Frehtes Taifersar Arahesis 2018-10-15 07:14:57 UTC
Created attachment 551300 [details, diff]
Patch
Comment 5 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-10-15 08:46:22 UTC
Ugh, thanks for figuring that out. So, like this?

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index bb27aa315ee..c26619e0154 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -16,8 +16,8 @@ CARGO_DEPEND=""
 [[ ${CATEGORY}/${PN} != dev-util/cargo ]] && CARGO_DEPEND="virtual/cargo"

 case ${EAPI} in
-	6) : DEPEND="${DEPEND} ${CARGO_DEPEND}";;
-	7) : BDEPEND="${BDEPEND} ${CARGO_DEPEND}";;
+	6) DEPEND="${DEPEND} ${CARGO_DEPEND}";;
+	7) BDEPEND="${BDEPEND} ${CARGO_DEPEND}";;
 	*) die "EAPI=${EAPI:-0} is not supported" ;;
 esac
Comment 6 Arfrever Frehtes Taifersar Arahesis 2018-10-15 19:14:15 UTC
(In reply to Dirkjan Ochtman from comment #5)

I have attached the full patch.
You can download it and apply it using 'git am /path/to/patch'.
Comment 7 Larry the Git Cow gentoo-dev 2018-10-15 19:36:05 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a381a6fc38056ebf7d548445062bd38c3cfa911f

commit a381a6fc38056ebf7d548445062bd38c3cfa911f
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
AuthorDate: 2018-10-15 07:12:46 +0000
Commit:     Dirkjan Ochtman <djc@gentoo.org>
CommitDate: 2018-10-15 19:35:53 +0000

    cargo.eclass: Really set dependencies.
    
    Closes: https://bugs.gentoo.org/668680
    
    Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
    Signed-off-by: Dirkjan Ochtman <djc@gentoo.org>

 eclass/cargo.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Comment 8 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-10-15 19:36:38 UTC
Thanks!