Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 938893 - app-editors/zed: add arm64 support
Summary: app-editors/zed: add arm64 support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM64 Linux
: Normal enhancement
Assignee: Robert G. Siebeck
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-09-01 19:05 UTC by demize
Modified: 2024-10-19 13:02 UTC (History)
2 users (show)

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


Attachments
Proposed patch for ARM64 support (zed-r1.patch,834 bytes, patch)
2024-09-01 19:06 UTC, demize
Details | Diff
Updated patch after feedback (zed-r2.patch,970 bytes, patch)
2024-09-02 11:10 UTC, demize
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description demize 2024-09-01 19:05:57 UTC
Zed works fine on ARM64 machines, including Apple Silicon machines running the Asahi Gentoo remix. I'm running the Asahi Gentoo remix, and I want to use Zed, so I figured I'd make sure it works and open this, attaching the patch for the changes I made :)

I added a new USE flag here, as Asahi currently does not support Vulkan, and Zed (specifically blade, which Zed requires) needs specific build-time configuration to use GLES instead. I added a gles-only USE flag, and checked for it during package init; this is my first contribution to an ebuild, so if this isn't the correct (or best) way to do this, then please do update it to something more idiomatic. I also added an ~arm64 keyword 

I've tested Zed out a little to make sure it works as expected on ARM64 with GLES only, and I can confirm it does.

Reproducible: Always
Comment 1 demize 2024-09-01 19:06:35 UTC
Created attachment 901878 [details, diff]
Proposed patch for ARM64 support
Comment 2 Eli Schwartz gentoo-dev 2024-09-02 02:26:37 UTC
Comment on attachment 901878 [details, diff]
Proposed patch for ARM64 support

>--- a/app-editors/zed/zed-0.150.4.ebuild
>+++ b/app-editors/zed/zed-0.150.4.ebuild
>@@ -1119,6 +1120,10 @@
> 	export RUSTFLAGS="${RUSTFLAGS} -C symbol-mangling-version=v0 --cfg tokio_unstable -C link-arg=-fuse-ld=mold -C link-args=-Wl,--disable-new-dtags,-rpath,\$ORIGIN/../lib"
> 	# linking error with llvm-18
> 	export RUSTFLAGS="${RUSTFLAGS} -C link-args=-Wl,-z,nostart-stop-gc"
>+	# use gles (potential vulkan support workaround) if required
>+	if $(use gles-only); then


The $() here is totally extraneous, and also wrong. It evaluates "use gles-only", and inserts the stdout of that command as the argument to "if". You should just do

if use gles-only


>+		export RUSTFLAGS="${RUSTFLAGS} --cfg gles"
>+	fi
> }
> 
> src_prepare() {
Comment 3 demize 2024-09-02 11:10:34 UTC
Created attachment 901898 [details, diff]
Updated patch after feedback
Comment 4 demize 2024-09-02 11:12:07 UTC
Thanks for the feedback! Not as familiar with bash scripting as I'd like, so I'll happily take that.

Updated my patch and tested again to confirm it works as expected with both empty USE and USE=gles-only.
Comment 5 Larry the Git Cow gentoo-dev 2024-10-19 11:21:46 UTC
The bug has been closed via the following commit(s):

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

commit 92aa649837ee306fecfe94a92587151861450944
Author:     Robert Siebeck <gentoo.2019@r123.de>
AuthorDate: 2024-10-18 13:35:25 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2024-10-19 11:21:44 +0000

    app-editors/zed: add 0.157.5
    
    Add gles use flag
    
    Closes: https://bugs.gentoo.org/938893
    Signed-off-by: Robert Siebeck <gentoo.2019@r123.de>
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 app-editors/zed/Manifest           |   2 +
 app-editors/zed/metadata.xml       |   3 +
 app-editors/zed/zed-0.157.5.ebuild | 142 +++++++++++++++++++++++++++++++++++++
 3 files changed, 147 insertions(+)
Comment 6 Larry the Git Cow gentoo-dev 2024-10-19 12:57:14 UTC
The bug has been referenced in the following commit(s):

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

commit 8a33516254b92f702df6d158cf59e92e418cc45c
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2024-10-19 12:56:25 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2024-10-19 12:56:25 +0000

    profiles/arch/arm64: force app-editors/zed[gles]
    
    Bug: https://bugs.gentoo.org/938893
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 profiles/arch/arm64/package.use.force | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Comment 7 Joonas Niilola gentoo-dev 2024-10-19 13:02:12 UTC
Please track bug 941849 for the keywording. We generally don't let users keyword packages, even though I don't doubt you that it works.