Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 843815 - dev-lang/rust: Add use flag for `profiler` option
Summary: dev-lang/rust: Add use flag for `profiler` option
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Georgy Yakovlev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-11 19:26 UTC by Kirill Tribunsky
Modified: 2024-03-27 03:44 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kirill Tribunsky 2022-05-11 19:26:20 UTC
Hi,

I am trying to use system dev-lang/rust (current stable 1.59) while developing in IntelliJ IDEA with the Rust plugin.

The problem I've found is that code couldn't be run under coverage (regular builds and execution are OK). I'm getting the following error:

>cargo can't find crate for `profiler_builtins`

I'm pretty newbie with rust, but looks like the problem is in current ebuild, where profiler option is always set to `false` (anyway, I didn't notice if any existing USE-flags should change this switch).

I've done some *homework* and created ebuild in local overlay with just `profiler=true` option and currently I am able to run project under coverage.

But I have two main concerns about such a solution:

1. Looks like it won't work for any platform (as I've found on github, some rustc targets doesn't support profiling and it will cause failures during emerge).
2. Maybe this feature isn't needed as separate USE-flag and will fit perfectly to current `debug` flag.

P.S. I didn't check rust-bin
Comment 1 Georgy Yakovlev archtester gentoo-dev 2022-05-24 17:33:52 UTC
hi, 

looking at it right now.

looks like we also want to install rust-demangler tool if profiler is enabled.
Comment 2 Georgy Yakovlev archtester gentoo-dev 2022-05-24 17:34:53 UTC
as for rust-bin - does not look possible.

there are nightly tarballs with profiler enabled, but not release ones.

I'm still not sure if profiler requires USE=nightly, so that's something else to test.
Comment 3 Larry the Git Cow gentoo-dev 2022-05-24 18:09:12 UTC
The bug has been referenced in the following commit(s):

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

commit 2823c9e4b8bdda0b1adb9d534f316f18ee069fae
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2022-05-24 17:21:11 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2022-05-24 18:08:27 +0000

    dev-lang/rust: add profiler useflag
    
    Bug: https://bugs.gentoo.org/843815
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 dev-lang/rust/metadata.xml       |  1 +
 dev-lang/rust/rust-1.60.0.ebuild | 11 +++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

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

commit dab3bc4a74628a8666248c3757089e67f3241289
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2022-05-24 17:22:18 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2022-05-24 18:08:26 +0000

    profiles/base: stable-mask rust[profiler]
    
    Bug: https://bugs.gentoo.org/843815
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 profiles/base/package.use.stable.mask | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 4 Georgy Yakovlev archtester gentoo-dev 2022-05-24 18:10:45 UTC
added to 1.60.0, please test if it works for you if possible.

if no negative feedback received I might port it back to 1.59.0, since it's going to be stable until llvm-14 is stable.
Comment 5 Georgy Yakovlev archtester gentoo-dev 2022-05-24 18:29:03 UTC
I will be adding rust 1.61.0 today btw, so that one is probably better to test than 1.60.0
Comment 6 Kirill Tribunsky 2022-05-25 07:20:34 UTC
Hi!

I've emerged rust-1.61.0 with 'profiler' USE-flag and everything works fine on my amd64 machine.

Thanks a lot!
Comment 7 Georgy Yakovlev archtester gentoo-dev 2022-05-25 18:05:39 UTC
thanks for testing!

I'll close this one now.

I tested profiler on different arches, works for far on amd64, ppc64, arm64.

So I don't think we need a mask right now, but if someone reports an arch specific failure/incompatibility - we'll mask this flag on that arch.

It's stable-masked for now (which does not matter if you use ~arch rust).
I'll look at removing stable-mask after llvm14/rust-1.60+ go stable.