Feel-ix-343 / markdown-oxide

Robust PKM on the LSP
https://oxide.md
GNU General Public License v3.0
929 stars 15 forks source link

feat: support for cargo binstall #58

Closed KSaiAkshit closed 5 months ago

KSaiAkshit commented 5 months ago

This lets users install the binary directly instead of manually compiling it or grabbing the releases.

PS: You will have to update the version in the Cargo.toml file for new releases from now on!

Feel-ix-343 commented 5 months ago

This is awesome!

Note that on windows, moxide is packaged as a zip. Does pkg-fmt account for this? (I guess is tgz related to tar?)

Feel-ix-343 commented 5 months ago

Also we'd want to include this in the installation section of the readme. leave a like if you want me to add

KSaiAkshit commented 5 months ago

This is awesome!

Note that on windows, moxide is packaged as a zip. Does pkg-fmt account for this? (I guess is tgz related to tar?)

Ah, yes, removing the pkg-fmt should account for the Windows zip problem. And sure, we could add it to the installation section of the readme

KSaiAkshit commented 5 months ago

Does it work now? I don't have access to a Windows machine :)

Feel-ix-343 commented 5 months ago

I don't either 😀

Feel-ix-343 commented 5 months ago

The cargo binstall command is not working because markdown-oxide is not on crates.io yet. We could add it, or (I am currently) try to specify the git version in binstall

Feel-ix-343 commented 5 months ago

BTW I'm currently publishing to crates.io

I'm struggling a little because tower-lsp is from a git source!

KSaiAkshit commented 5 months ago

The cargo binstall command is not working because markdown-oxide is not on crates.io yet. We could add it, or (I am currently) try to specify the git version in binstall

Oh right! I was running it locally using the --manifest-path flag and totally forgot that this isn't on crates.io yet.

BTW I'm currently publishing to crates.io

Nice!

I'm struggling a little because tower-lsp is from a git source!

Yeah, that is a little tricky! You could have a look at these https://github.com/rust-lang/cargo/issues/6738 https://github.com/rust-lang/cargo/pull/7237 https://github.com/rust-lang/cargo/pull/7333

Feel-ix-343 commented 5 months ago

Is there a way to simply modify the cargo install command to install from git? I was trying to add the --git flag, but it was not working (IO errors?)

This way it can be added now, and crates.io publishing can be added later.

KSaiAkshit commented 5 months ago

Afaik, you should be able to do that. Could you try running cargo binstall --git 'https://github.com/KSaiAkshit/markdown-oxide' markdown-oxide. Once the PR is merged, we could swap out the URL for this repo. you might want to use --force if you already have the binary installed

Feel-ix-343 commented 5 months ago

I'm getting this

~ ❯ cargo binstall --git 'https://github.com/KSaiAkshit/markdown-oxide' markdown-oxide
 INFO resolve: Resolving package: 'markdown-oxide'
ERROR Fatal error:
  × For crate markdown-oxide: Failed to shallow clone git repository:
  │ Failed to fetch: An IO error occurred when talking to the server
  ├─▶ Failed to shallow clone git repository: Failed to fetch: An IO
  │   error occurred when talking to the server
  ├─▶ Failed to fetch: An IO error occurred when talking to the server
  ├─▶ An IO error occurred when talking to the server
  ╰─▶ error sending request for url (https://github.com/KSaiAkshit/
      markdown-oxide/info/refs?service=git-upload-pack)

I'm on nixos as well

KSaiAkshit commented 5 months ago

This is what i get:

❯ cargo binstall --git 'https://github.com/KSaiAkshit/markdown-oxide' markdown-oxide --force
 INFO resolve: Resolving package: 'markdown-oxide'
 INFO Cloning with worktree::receiving pack: Enumerating objects → 563.0 objects
 INFO ℹCloning with worktree::receiving pack::create index file::indexing → done 563.0 objects in 0.32s (1.7K objects/s)
 INFO ℹCloning with worktree::receiving pack::create index file::decompressing → done 1.3MB in 0.32s (4.1MB/s)
 INFO ℹCloning with worktree::receiving pack::create index file::Resolving → done 563.0 objects in 0.15s (3.7K objects/s)
 INFO ℹCloning with worktree::receiving pack::create index file::Decoding → done 3.9MB in 0.15s (26.1MB/s)
 INFO Cloning with worktree::receiving pack::create index file → 3 of 4 steps
 INFO ✓Cloning with worktree::receiving pack::create index file::writing index file → done 16.8KB in 0.00s (381.2MB/s)
 INFO ✓Cloning with worktree::receiving pack::create index file → done 563.0 objects in 0.47s (1.2K objects/s)
 INFO ℹCloning with worktree::receiving pack::read pack → done 467.1KB in 0.51s (909.2KB/s)
 INFO ℹCloning with worktree::receiving pack::checkout → done 86.0 files in 0.00s (84.8K files/s)
 INFO ℹCloning with worktree::receiving pack::writing → done 563.8KB in 0.00s (549.3MB/s)
 WARN The package markdown-oxide v0.0.21 (x86_64-unknown-linux-gnu) has been downloaded from github.com
 INFO This will install the following binaries:
 INFO   - markdown-oxide (bin-markdown-oxide-x86_64-unknown-linux-gnu-GhCrateMeta -> /home/akira/.local/share/cargo/bin/markdown-oxide)
Do you wish to continue? yes/[no]
? yes
 INFO Installing binaries...
 INFO Done in 9.762652675s

I am really not sure what could be going wrong here :/

Feel-ix-343 commented 5 months ago

Just checking: does cargo binstall --git 'https://github.com/feel-ix-343/markdown-oxide' markdown-oxide work? (not the forked URL)

KSaiAkshit commented 5 months ago

Nice!