Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Cargo install failed #38

Closed
ValouBambou opened this issue Jun 30, 2023 · 8 comments
Closed

Cargo install failed #38

ValouBambou opened this issue Jun 30, 2023 · 8 comments

Comments

@ValouBambou
Copy link

Hi, I wanted to try the formatter but cargo install typst-fmt (cargo 1.70.0) return the following error which seems weird since the Cargo.toml file in the repo contains a bin section. So I'm a confused. Does anyone else encounter this issue ?

❯ cargo install typst-fmt
    Updating crates.io index
error: there is nothing to install in `typst-fmt v0.1.0`, because it has no binaries
`cargo install` is only for installing programs, and can't be used with libraries.
To use a library crate, add it as a dependency to a Cargo project with `cargo add`.
@astrale-sharp
Copy link
Owner

that's weird, I think it was in a working state two weeks ago, now it's not gonna work for a while, I want it to be a satisfying experience before it can be installed again!

@Andrew15-5
Copy link
Contributor

I was confused, because I remember that I was able to get the binary, but now I can't. I wanted to check on the new little improvements.

If your program is not in release stage (under v1.0.0), then I assume that it is not production ready. Hence, could be not a satisfying experience. But I think you should give the option to be able to get the binary. On GitHub, if you are creating a release, you can flag it as "pre-release" or something (I don't remember), to let everyone know that it can have some bugs or unpolished things.

@astrale-sharp
Copy link
Owner

I worked in it today, it's pretty rough (files won't open for some reason) but it's on the bin branch if you want to take a look! Also cargo install wouldn't work because this is not really published to crates.io (since typst isn't either and I depend on it)

@astrale-sharp
Copy link
Owner

I'll close this when I or someone else add a little install guide to the readme

@Andrew15-5
Copy link
Contributor

You mean like this:

git clone -b bin https://github.com/astrale-sharp/typst-fmt.git
cd typst-fmt
cargo build
mkdir -p ~/.local/bin
cp -f target/debug/typst-fmt ~/.local/bin/

With a note that ~/.local/bin must be in PATH variable (echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.profile).

@astrale-sharp
Copy link
Owner

Or more simply like this :

git clone https://github.com/astrale-sharp/typst-fmt.git
cd typst-fmt
cargo install --path .

;)

if you're interested in writing yours up go ahead, I'll merge no problems! (otherwise I'll do it tomorrow!)

@Andrew15-5
Copy link
Contributor

Yay, binary is back on master branch! But why it suddenly called typstfmt instead of typst-fmt?

@Andrew15-5
Copy link
Contributor

if you're interested in writing yours up go ahead, I'll merge no problems! (otherwise I'll do it tomorrow!)

@astrale-sharp, check #50.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants