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

use makefile to install, test and serve materials #2469

Conversation

AbdulfatahMohammedSheikh

The process of installing the required crates in manual. So instead I added a make file to simplify the process

Copy link

google-cla bot commented Nov 24, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@AbdulfatahMohammedSheikh AbdulfatahMohammedSheikh changed the title Origin/use makefile use makefile to install, test and serve materials Nov 24, 2024
Copy link
Collaborator

@djmitche djmitche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a big fan of make in general, but this is simple enough. @mgeisler, what do you think?

@djmitche djmitche requested a review from mgeisler November 25, 2024 19:05
@mgeisler
Copy link
Collaborator

Thanks for putting this up, it's something I hadn't considered before...

I'm also not a super fan of make these days: I am afraid we will get questions from people on Windows about how to install it and how to run it?

Introducing a (soft) dependency on new non-Rust software sounds like a step back, so I don't think we should do this.

But, this gives me an idea... would it be possible for us to create a project in this repository which depends on everything we need? Let's say it's named install-comprehensive-rust-tools, then we could ask people to do:

cargo install --locked --path install-comprehensive-rust-tools

I'm not sure this can work since I don't think binaries from dependencies will be installed.

@AbdulfatahMohammedSheikh
Copy link
Author

Thanks for putting this up, it's something I hadn't considered before...

I'm also not a super fan of make these days: I am afraid we will get questions from people on Windows about how to install it and how to run it?

Introducing a (soft) dependency on new non-Rust software sounds like a step back, so I don't think we should do this.

But, this gives me an idea... would it be possible for us to create a project in this repository which depends on everything we need? Let's say it's named install-comprehensive-rust-tools, then we could ask people to do:

cargo install --locked --path install-comprehensive-rust-tools

I'm not sure this can work since I don't think binaries from dependencies will be installed.

Interesting, it is cool idea. As for the Makefile i don't like it either but what i don't like more than a makefile is long list of dependencies to install.

@djmitche
Copy link
Collaborator

I've used cargo xtask in some other situations as a way to automate things in a repo. With some work, that could mean that just running cargo xtask install-deps would perform the same function as the Makefile.

@mgeisler
Copy link
Collaborator

I've used cargo xtask in some other situations as a way to automate things in a repo. With some work, that could mean that just running cargo xtask install-deps would perform the same function as the Makefile.

Yes, I would be happier with the cargo xtask trick which I've seen a few places. However, now that I've actually read how it works, I must say that I had hoped it would bring along some infrastructure for running simple commands 😄 I believe that is left as an exercise for the reader, right?

@mgeisler
Copy link
Collaborator

Interesting, it is cool idea. As for the Makefile i don't like it either but what i don't like more than a makefile is long list of dependencies to install.

Yeah, I agree with you! It gets worse: the commands used in CI are not synchronized with that we show in the README. So real bugs can creep in where CI does one thing, but people do something else. It would be nice to align this more carefully with a nice cross-platform setup.

@mgeisler
Copy link
Collaborator

I think we should close this and then open an issue for this instead. We should do something very simple to make Dustin's cargo xtask install-deps work. It could be as simple as a

fn main() -> Result<(), Box<dyn std::error::Error>> {
  Command::new(env!("CARGO")).arg("install").arg("mdbook").status()?;
  Command::new(env!("CARGO")).arg("install").arg("mdbook-i18n-helpers").status()?;
}

Put that in a new workspace member, hook up the Cargo alias and we should be in business 😄 To show that it works, make the GitHub CI code that install the dependencies use the new task.

@mgeisler
Copy link
Collaborator

I copied the above comment to #2509, let's continue the discussion there!

@mgeisler mgeisler closed this Dec 11, 2024
@egithinji egithinji mentioned this pull request Mar 3, 2025
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.

3 participants