Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for cargo binstall #58

Merged
merged 3 commits into from
Apr 28, 2024
Merged

Conversation

KSaiAkshit
Copy link
Contributor

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!

this lets users install the binary directly instead of compiling it
themselves or grabbing the releases manually
@Feel-ix-343
Copy link
Owner

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
Copy link
Owner

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

@KSaiAkshit
Copy link
Contributor Author

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

update: add to installtion section of the readme
@KSaiAkshit
Copy link
Contributor Author

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

@Feel-ix-343
Copy link
Owner

I don't either 😀

@Feel-ix-343
Copy link
Owner

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
Copy link
Owner

BTW I'm currently publishing to crates.io

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

@KSaiAkshit
Copy link
Contributor Author

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
rust-lang/cargo#6738
rust-lang/cargo#7237
rust-lang/cargo#7333

@Feel-ix-343
Copy link
Owner

Feel-ix-343 commented Apr 26, 2024

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
Copy link
Contributor Author

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
Copy link
Owner

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
Copy link
Contributor Author

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
Copy link
Owner

Feel-ix-343 commented Apr 28, 2024

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

@Feel-ix-343 Feel-ix-343 merged commit 12d32af into Feel-ix-343:main Apr 28, 2024
1 check passed
@KSaiAkshit
Copy link
Contributor Author

Nice!

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

Successfully merging this pull request may close these issues.

2 participants