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

docs: add dependencies #221

Closed
2 tasks done
juanMarinero opened this issue Feb 26, 2025 · 5 comments · Fixed by #231
Closed
2 tasks done

docs: add dependencies #221

juanMarinero opened this issue Feb 26, 2025 · 5 comments · Fixed by #231

Comments

@juanMarinero
Copy link

juanMarinero commented Feb 26, 2025

Hello! Please:

  • Add dependencies section. See below Rustc 1.75.0 is not enough.
  • Add git-tag of latest release to the cargo install command of # Installation section of README.md. From cargo install --git https://github.com/yshavit/mdq to cargo install --git https://github.com/yshavit/mdq --tag v0.3.0. Or keep up to date dependencies sub-section of README.md with needs of newest commit, which is much more error-prone and tedious.

Thanks in advance!

For Ubuntu 24.04:

> rustc --version
rustc 1.75.0 (82e1608df 2023-12-21) (built from a source tarball)
> cargo --version
cargo 1.75.0
> cargo install --git https://github.com/yshavit/mdq
    Updating git repository `https://github.com/yshavit/mdq`
  Installing mdq v0.3.0 (https://github.com/yshavit/mdq#2670dcb9)
    Updating crates.io index
  Downloaded clap v4.5.31
  Downloaded toml_datetime v0.6.8
   ...
   Compiling proc-macro2 v1.0.93
   Compiling unicode-ident v1.0.17
   Compiling serde v1.0.218
   Compiling equivalent v1.0.2
   ...
   Compiling toml_edit v0.22.24
   Compiling toml v0.8.20
   Compiling mdq v0.3.0 (/home/USER/.cargo/git/checkouts/mdq-ca5fb7630affeafc/2670dcb)
error: unsupported output in build script of `mdq v0.3.0 (/home/USER/.cargo/git/checkouts/mdq-ca5fb7630affeafc/2670dcb)`: `cargo::rerun-if-changed=tests/md_cases/`
Found a `cargo::key=value` build directive which is reserved for future use.
Either change the directive to `cargo:key=value` syntax (note the single `:`) or upgrade your version of Rust.
See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script for more information about build script outputs.
error: failed to compile `mdq v0.3.0 (https://github.com/yshavit/mdq#2670dcb9)`, intermediate artifacts can be found at `/tmp/cargo-installVj8IEI`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Notice: or upgrade your version of Rust.

Alike with newest mdq tag-released commit:

> cargo install --git https://github.com/yshavit/mdq --tag v0.3.0
    Updating git repository `https://github.com/yshavit/mdq`
  Installing mdq v0.1.0 (https://github.com/yshavit/mdq?tag=v0.3.0#086542f9)
    Updating crates.io index
   Compiling proc-macro2 v1.0.93
   Compiling unicode-ident v1.0.17
   ....
   Compiling toml_edit v0.22.24
   Compiling toml v0.8.20
   Compiling mdq v0.1.0 (/home/USER/.cargo/git/checkouts/mdq-ca5fb7630affeafc/086542f)
error: unsupported output in build script of `mdq v0.1.0 (/home/USER/.cargo/git/checkouts/mdq-ca5fb7630affeafc/086542f)`: `cargo::rerun-if-changed=tests/md_cases/`
Found a `cargo::key=value` build directive which is reserved for future use.
Either change the directive to `cargo:key=value` syntax (note the single `:`) or upgrade your version of Rust.
See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script for more information about build script outputs.
error: failed to compile `mdq v0.1.0 (https://github.com/yshavit/mdq?tag=v0.3.0#086542f9)`, intermediate artifacts can be found at `/tmp/cargo-installKwsldR`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

I update Rust (https://rust-lang.github.io/rustup/basics.html):

> rustup update

> rustc --version
rustc 1.85.0 (4d91de4e4 2025-02-17)
> cargo --version
cargo 1.85.0 (d73d2caf9 2024-12-31)

Install:

> cargo install --git https://github.com/yshavit/mdq --tag v0.3.0
    Updating git repository `https://github.com/yshavit/mdq`
  Installing mdq v0.1.0 (https://github.com/yshavit/mdq?tag=v0.3.0#086542f9)
    Updating crates.io index
     Locking 56 packages to latest compatible versions
  Downloaded anstream v0.6.18
  Downloaded anstyle-parse v0.2.6
  ...
  Compiling proc-macro2 v1.0.93
   Compiling unicode-ident v1.0.17
   Compiling serde v1.0.218
   ...
   Compiling toml_datetime v0.6.8
   Compiling toml_edit v0.22.24
   Compiling toml v0.8.20
   Compiling mdq v0.1.0 (/home/USER/.cargo/git/checkouts/mdq-7353869de77708e6/086542f)
    Finished `release` profile [optimized] target(s) in 15.56s
  Installing /home/USER/.cargo/bin/mdq
   Installed package `mdq v0.1.0 (https://github.com/yshavit/mdq?tag=v0.3.0#086542f9)` (executable `mdq`)

It seems to work:

> mdq --version
mdq 0.1.0

> curl -O https://raw.githubusercontent.com/yshavit/mdq/main/README.md && cat README.md | mdq '# Installation'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6800  100  6800    0     0  28037      0 --:--:-- --:--:-- --:--:-- 28099
# Installation

Any of these will work:
...
@yshavit yshavit mentioned this issue Feb 28, 2025
yshavit added a commit that referenced this issue Feb 28, 2025
- find required version using cargo-msrv
- find the version in the readme using mdq 😎
- compare them

In support of #221. This sets up a new workflow, so I need to merge it
to main before it can run for final validation; but if it works, there
could be no other change required for 221.
@yshavit
Copy link
Owner

yshavit commented Feb 28, 2025

Fixed in #226 -- how does that look to you? Basically I:

yshavit added a commit that referenced this issue Feb 28, 2025
- fix the workflow name
- fix the job name
- rm the `needs` dependency
- put in the correct version to the readme (I had previously put an
intentionally incorrect one, to prove this script works; and then I
forgot to remove it)

In service of (and may resolve) #221
@juanMarinero
Copy link
Author

juanMarinero commented Mar 1, 2025

Thanks @yshavit!

I will be honest. I didn't notice the "Development" section. I guess I though it was for repo-contributors only. Thus, I would:

  • Call it "Dependencies" (instead of "Development") and set it as a subsection of "Installation" section (README.md).
  • Start the "Installation" section with dependencies steps. Example: steps 1 and 2 of colorls
  • Otherwise a link alike:
# Installation

[Dependencies](#Development)

Any of these will work:
[...]

I feel like you want a README short and clear. You achieve it already. Good job! Thus maybe my 3rd suggestion is the clearest.

@yshavit
Copy link
Owner

yshavit commented Mar 1, 2025

Oh, right, I forgot the installation instructions included the cargo instructions. I'll update that section as well.

@yshavit
Copy link
Owner

yshavit commented Mar 2, 2025

@juanMarinero How does this look to you? https://github.com/yshavit/mdq/blob/readme-cargo/README.md#installation (note: I moved the cargo install to the last option)

(PR #231)

@juanMarinero
Copy link
Author

It looks short and clear. Thanks for coding it and asking feedback!

yshavit added a commit that referenced this issue Mar 2, 2025
- move the `cargo install` to the last option
- add the requirement
- change the checker to use just plain grep, and include the file name
and line number, so I can use them in the workflow commands

resolves #221
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 a pull request may close this issue.

2 participants