Bug 276116 - Mk/Uses/cargo.mk: Build fails on the github.com/nvarner/typst-lsp project: failed to parse manifest
Summary: Mk/Uses/cargo.mk: Build fails on the github.com/nvarner/typst-lsp project: fa...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: FreeBSD Rust Team
URL:
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2024-01-04 17:31 UTC by Yuri Victorovich
Modified: 2024-01-05 13:00 UTC (History)
1 user (show)

See Also:


Attachments
Makefile (9.90 KB, text/plain)
2024-01-04 17:31 UTC, Yuri Victorovich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2024-01-04 17:31:09 UTC
Created attachment 247447 [details]
Makefile

'cargo build' builds https://github.com/nvarner/typst-lsp successfully, but it fails in the ports framework using rust-1.74.1:

> ===>  Moving crates to /usr/ports/lang/typst-lsp/work/typst-lsp-0.12.1/cargo-crates
> ===>  Patching for typst-lsp-0.12.1
> ===>   typst-lsp-0.12.1 depends on package: rust>=1.74.0 - found
> ===>   typst-lsp-0.12.1 depends on package: pkgconf>=1.3.0_1 - found
> ===>   typst-lsp-0.12.1 depends on file: /usr/local/bin/ccache - found
> ===>  Configuring for typst-lsp-0.12.1
> ===>   Additional optimization to port applied
> ===>   Cargo config:
> [source.cargo]
> directory = '/usr/ports/lang/typst-lsp/work/typst-lsp-0.12.1/cargo-crates'
> [source.crates-io]
> replace-with = 'cargo'
> [patch.'https://github.com/typst/typst.git']
> typst-syntax = { path = '/usr/ports/lang/typst-lsp/work/typst-0.10.0/crates/typst-syntax' }
> typst = { path = '/usr/ports/lang/typst-lsp/work/typst-0.10.0/crates/typst' }
> typst-ide = { path = '/usr/ports/lang/typst-lsp/work/typst-0.10.0/crates/typst-ide' }
> typst-macros = { path = '/usr/ports/lang/typst-lsp/work/typst-0.10.0/crates/typst-macros' }
> typst-pdf = { path = '/usr/ports/lang/typst-lsp/work/typst-0.10.0/crates/typst-pdf' }
> typst-syntax = { path = '/usr/ports/lang/typst-lsp/work/typst-0.10.0/crates/typst-syntax' }
> [patch.'https://github.com/astrale-sharp/typstfmt']
> typstfmt_lib = { path = '/usr/ports/lang/typst-lsp/work/typstfmt-0.2.7/lib' }
> ===>   Updating Cargo.lock
> error: failed to parse manifest at `/usr/ports/lang/typst-lsp/work/typst-lsp-0.12.1/Cargo.toml`
Comment 1 Tobias Kortkamp freebsd_committer freebsd_triage 2024-01-05 13:00:22 UTC
For the record the full error message is:

===>   Updating Cargo.lock
error: failed to parse manifest at `/wrkdirprefix/usr/ports/lang/typst-lsp/work/typst-lsp-0.12.1/Cargo.toml`

Caused by:
  could not load Cargo configuration

Caused by:
  could not parse TOML configuration in `/wrkdirprefix/usr/ports/lang/typst-lsp/work/.cargo/config.toml`

Caused by:
  TOML parse error at line 11, column 1
     |
  11 | typst-syntax = { path = '/wrkdirprefix/usr/ports/lang/typst-lsp/work/typst-0.10.0/crates/typst-syntax' }
     | ^
  duplicate key `typst-syntax` in table `patch.https://github.com/typst/typst.git`


and we have

[patch.'https://github.com/typst/typst.git']
typst-syntax = { path = '/usr/ports/lang/typst-lsp/work/typst-0.10.0/crates/typst-syntax' }
typst-syntax = { path = '/usr/ports/lang/typst-lsp/work/typst-0.10.0/crates/typst-syntax' } 

because typst-syntax appears with 2 different versions in CARGO_CRATES:

	typst-syntax@git+https://github.com/typst/typst.git?tag=v0.7.0\#da8367e189b02918a8fe1a98fd3059fd11a82cd9 \
	typst,typst-ide,typst-macros,typst-pdf,typst-syntax@git+https://github.com/typst/typst.git?tag=v0.10.0\#70ca0d257bb4ba927f63260e20443f244e0bb58c

This is probably not that easy to fix.