Bug 278837 - editors/lapce: Update to 0.4.0
Summary: editors/lapce: Update to 0.4.0
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Nuno Teixeira
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-07 13:52 UTC by Mikael Urankar
Modified: 2024-05-09 11:54 UTC (History)
0 users

See Also:
eduardo: maintainer-feedback+


Attachments
v0 (167.77 KB, patch)
2024-05-07 13:52 UTC, Mikael Urankar
no flags Details | Diff
v1: reformat patches, fix hardcoded prefix in fontsdb patch (385.15 KB, patch)
2024-05-08 09:26 UTC, Nuno Teixeira
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Urankar freebsd_committer freebsd_triage 2024-05-07 13:52:59 UTC
Created attachment 250512 [details]
v0

patch-Cargo.toml is a bit hackish but I couldn't find a better way to build with the ports framework.

This version builds with rust 1.78.0, not tested with 1.77.0
Comment 1 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-07 19:32:35 UTC
(In reply to Mikael Urankar from comment #0)

Hello Mikael!

Nice that you find a way to buuld it.

Testport are OK with rust 1.77.0 on main and supported releases amd64. Will test aarch64 later.

Doubts:

1- openssl vendored

It seems that it is building with openssl vendored. Tomorrow I will hack it so it uses base ossl instead and then do a run test with both versions.

-------
Please make sure this port uses the system OpenSSL and consider removing
CARGO_CRATES=openssl-src-300.2.3+3.2.1 (a vendored copy of OpenSSL) from the
build, e.g., by patching Cargo.toml appropriately.
-------

What's your opinion on this?

2- patch-Cargo.toml: fix "key rev is ignored for dependency (tracing)"

There is an open PR at https://github.com/lapce/lapce/issues/3215
It would be nice that this could be fixed upstream to prevent future problems.

Tomorrow I will dig into it and try to understand how this was fixed since I didn't found a port with similar problems.

Cheers
Comment 2 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-07 19:33:33 UTC
(In reply to Nuno Teixeira from comment #1)
(...)

Tomorrow I will do run tests.
Comment 3 Mikael Urankar freebsd_committer freebsd_triage 2024-05-08 08:27:41 UTC
(In reply to Nuno Teixeira from comment #1)
1) It'd nice if you manage to build it with base ossl. I didnt' spend too much time on it TBH
2) It's our ports framework that is problematic. It comments out the "git" line in the workspace (dunno why). You can see it by yourself with:
make extract
cp xxx/Cargo.toml xxx/Cargo.toml.1
make configure
diff -dup xxx/Cargo.toml.1 xxx/Cargo.toml
Comment 4 Mikael Urankar freebsd_committer freebsd_triage 2024-05-08 08:51:18 UTC
Bonus point if you remove the hardcoded /usr/local in patch-cargo-crates_fontdb*
Comment 5 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-08 08:52:30 UTC
(In reply to Mikael Urankar from comment #3)

Related to Cargo.toml hack that you provided, I did uploaded to upstream to check their opion on that.
But yes, for what you tolding me, our framework is interfering with configure.

Run test shows me:
-no errors or warning at start
- menus doesn't work at all
- it opens a file in command line: `lapce example.txt`

It's broken, but at least it builds! I don't know why I care so much because I only use nvi from base :)

-----
openssl-vendored hack:

I reaply patch to remove openssl vendored and results changed from:

vendored openssl:

=>> Checking shared library dependencies
 0x0000000000000001 NEEDED               Shared library: [libc++.so.1]
 0x0000000000000001 NEEDED               Shared library: [libc.so.7]
 0x0000000000000001 NEEDED               Shared library: [libcxxrt.so.1]
 0x0000000000000001 NEEDED               Shared library: [libgcc_s.so.1]
 0x0000000000000001 NEEDED               Shared library: [libgit2.so.1.7]
 0x0000000000000001 NEEDED               Shared library: [libm.so.5]
 0x0000000000000001 NEEDED               Shared library: [libssh2.so.1]
 0x0000000000000001 NEEDED               Shared library: [libthr.so.3]
 0x0000000000000001 NEEDED               Shared library: [libutil.so.9]

builded on 14.0 (openssl3 base):

=>> Checking shared library dependencies
 0x0000000000000001 NEEDED               Shared library: [libc++.so.1]
 0x0000000000000001 NEEDED               Shared library: [libc.so.7]
 0x0000000000000001 NEEDED               Shared library: [libcrypto.so.30]
 0x0000000000000001 NEEDED               Shared library: [libcxxrt.so.1]
 0x0000000000000001 NEEDED               Shared library: [libgcc_s.so.1]
 0x0000000000000001 NEEDED               Shared library: [libgit2.so.1.7]
 0x0000000000000001 NEEDED               Shared library: [libm.so.5]
 0x0000000000000001 NEEDED               Shared library: [libssh2.so.1]
 0x0000000000000001 NEEDED               Shared library: [libssl.so.30]
 0x0000000000000001 NEEDED               Shared library: [libthr.so.3]
 0x0000000000000001 NEEDED               Shared library: [libutil.so.9]

builded on 13.2 (openssl1 base)

=>> Checking shared library dependencies
 0x0000000000000001 NEEDED               Shared library: [libc++.so.1]
 0x0000000000000001 NEEDED               Shared library: [libc.so.7]
 0x0000000000000001 NEEDED               Shared library: [libcrypto.so.111]
 0x0000000000000001 NEEDED               Shared library: [libcxxrt.so.1]
 0x0000000000000001 NEEDED               Shared library: [libgcc_s.so.1]
 0x0000000000000001 NEEDED               Shared library: [libgit2.so.1.7]
 0x0000000000000001 NEEDED               Shared library: [libm.so.5]
 0x0000000000000001 NEEDED               Shared library: [libssh2.so.1]
 0x0000000000000001 NEEDED               Shared library: [libssl.so.111]
 0x0000000000000001 NEEDED               Shared library: [libthr.so.3]
 0x0000000000000001 NEEDED               Shared library: [libutil.so.9]

It confirms that it is working.
Comment 6 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-08 09:00:19 UTC
(In reply to Mikael Urankar from comment #4)

> Bonus point if you remove the hardcoded /usr/local in patch-cargo-crates_fontdb*

yes, I know. I could use a reinplace to fix that. Working on that and do more tests.

Also, upstream sugested to use vendor tarball that includes all build deps.
I will check how to use it.

Cheers
Comment 7 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-08 09:26:41 UTC
Created attachment 250526 [details]
v1: reformat patches, fix hardcoded prefix in fontsdb patch
Comment 8 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-08 09:27:43 UTC
(In reply to Nuno Teixeira from comment #7)
(...)

+ reaply openssl-vendored removal
Comment 9 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-08 10:29:39 UTC
Interesting vendor tarball: https://github.com/lapce/lapce/releases/download/v0.4.0/vendor.tar.gz

It have all crates that build needs. Thinking how to integrate them...
Comment 10 Mikael Urankar freebsd_committer freebsd_triage 2024-05-09 07:55:03 UTC
(In reply to Nuno Teixeira from comment #5)
I don't have the menu with lapce 0.3.1, so it's not a regression ;)
Comment 11 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-09 08:32:34 UTC
(In reply to Mikael Urankar from comment #10)

Ok.

I'm thinking following nightly builds so we can track changes more frequently.
One good thing about it is that upstream is using:

$ git describe --tags 985b07c
$ v0.4.0-16-g985b07cc

What means that from time to time I could commit updates respecting port version:

0.4.0 -> 0.4.0.16 -> 0.4.1 -> 0.4.*

Tomorrow I will test vendor tarball by extracting it to $wrksrc/cargo-crates and deleting Makefile.crates and see how it goes.

For what I've read vendor tarball was created to help pkg builders that do not support cargo-crates fetching like our does.

If it works it will be awesome!

Thanks
Comment 12 Mikael Urankar freebsd_committer freebsd_triage 2024-05-09 09:45:22 UTC
(In reply to Nuno Teixeira from comment #11)
I've built lapce without our ports tree and the menu is still missing.

We also lack https://github.com/lapce/tree-sitter-grammars.git
https://github.com/lapce/lapce/blob/master/lapce-app/src/app.rs#L3960
Comment 13 commit-hook freebsd_committer freebsd_triage 2024-05-09 11:43:10 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=247d5632499f0905ad3d3f6de67dbd83417dee08

commit 247d5632499f0905ad3d3f6de67dbd83417dee08
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2024-05-09 11:40:26 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2024-05-09 11:41:55 +0000

    editors/lapce: Update to latest commit 0.4.0-16

    ChangeLog:
    https://github.com/lapce/lapce/compare/v0.3.1...0.4.0-16-g985b07c

    PR:             278837

 editors/lapce/Makefile                             |   15 +-
 editors/lapce/Makefile.crates                      |  512 +-
 editors/lapce/distinfo                             | 1030 ++-
 editors/lapce/files/patch-Cargo.lock               |   16 +-
 editors/lapce/files/patch-Cargo.toml (new)         |   46 +
 ...osmic-text-0.7.2_src_font_fallback_mod.rs (new) |   11 +
 ...ch-cargo-crates_fontdb-0.16.0_src_lib.rs (gone) |   13 -
 ...tch-cargo-crates_fontdb-0.16.2_src_lib.rs (new) |   22 +
 ...tch-cargo-crates_slotmap-1.0.7_src_lib.rs (new) |   11 +
 editors/lapce/files/patch-cosmic (gone)            |   11 -
 editors/lapce/files/patch-drm-sys (gone)           | 6727 --------------------
 editors/lapce/files/patch-lapce-proxy_Cargo.toml   |   12 +-
 12 files changed, 870 insertions(+), 7556 deletions(-)
Comment 14 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-09 11:46:45 UTC
I decided to commit with hope that more people could test. I will do some publicity on matrix chat :)

> We also lack https://github.com/lapce/tree-sitter-grammars.git
> https://github.com/lapce/lapce/blob/master/lapce-app/src/app.rs#L3960
Yes I noticed when run `lapce -w`
Comment 15 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-09 11:52:09 UTC
(In reply to Nuno Teixeira from comment #14)
(...)

Let's get this PR open and see if anyone shows up.
Comment 16 Nuno Teixeira freebsd_committer freebsd_triage 2024-05-09 11:54:46 UTC
Related to vendor tarball, I've didn't get it to work yet.

https://github.com/lapce/lapce/issues/2247