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

Introducing DEVELOPMENT.md #5209

Merged
merged 14 commits into from
Oct 2, 2023
Merged

Conversation

zhitkoff
Copy link
Contributor

@zhitkoff zhitkoff commented Aug 26, 2023

Adding DEVELOPMENT.md with more detailed instruction on setting local development environment

@tertsdiepraam
Copy link
Member

I think you might have accidentally included some commits from another branch. Could you remove those?

Copy link
Member

@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

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

Cool! I think as general feedback I want this to be a bit more concise where possible or at least structure it in a way where people can get started quickly.

Maybe we could also use tricks like the HTML <details> element to hide platform-specific instructions?

I'll also remove the link to #5195 because this won't be enough to close that issue.

DEVELOPMENT.md Outdated
Comment on lines 43 to 47
### GNU utils and prerequisites
If you are developing on Linux, most likely you already have all/most GNU utilities and prerequisites installed.
To make sure, please check GNU coreutils [README-prereq](https://github.com/coreutils/coreutils/blob/master/README-prereq)

**Tip:On MacOS** you will need to install [Homebrew](https://docs.brew.sh/Installation) and use it to install the following formulas:
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be moved down because it's only important when running the GNU test suite (unless there are also some things you need for regular development).

Copy link
Contributor Author

@zhitkoff zhitkoff Aug 28, 2023

Choose a reason for hiding this comment

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

There are a few things that are needed outside of GNU tests, namely pre-commit (even though it is currently broken on MacOS). Also Homebrew seems to be inevitable for development environment on MacOS anyway, and especially so for this project

Copy link
Member

@tertsdiepraam tertsdiepraam Aug 28, 2023

Choose a reason for hiding this comment

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

But tools like pre-commit also have their own section with installation instructions already. For some others I don't understand what they are used for (like wget & texinfo are those used by GNU?). So maybe we could also add some comments about which packages are used for what.

I do like providing an easy list like this, but maybe that could go at the end and you can link to it here? I think it's quite important that the start of the document is relevant for everyone. What do you think of a structure like this?

## Before you start
## Tools
[All tools and cross-platform stuff here]
## Tips for installing on Mac
## Tips for installing on Windows

I appreciate you dedication to helping newcomers btw. It's also good to have someone with a mac perspective around. I had no idea about all the extra stuff that was needed 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense. and yes, most of the Homebrew formulas are needed by GNU build/tests - i just ran it over and over, fixing failures one by one and that is the final list.
Will update with structure you suggested

DEVELOPMENT.md Outdated
Comment on lines 34 to 41
**Tip:On MacOS** you will need to install C compiler & linker:
`xcode-select --install`

**Tip:On Windows** On Windows you'll need the MSVC build tools for Visual Studio 2013 or later.
To acquire the build tools, you’ll need to install Visual Studio 2022. When asked which workloads to install, include:
- Desktop Development with C++
- The Windows 10 or 11 SDK
- The English language pack component, along with any other language pack of your choosing
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to mention all of this? If it's a very common pitfall for newcomers I'm all for including it, but it feels maybe a bit too detailed? All bits of information here also need to be kept up to date (i.e. when people should install Visual Studio 2023 instead of 2022). So, just saying "install rust via rustup" should probably be fine. We could also link to more extensive installation guides instead.

This is how simple it could be: https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md#setup (though we could add a bit more info if we really want to).

Copy link
Contributor Author

@zhitkoff zhitkoff Aug 27, 2023

Choose a reason for hiding this comment

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

True, could be simplified. On the Nu shell example though - they offload all details to linked https://www.nushell.sh/book/installation.html for installing Rust toolchain and all dependencies/prerequisites - that makes their CONTRIBUTING.md clean and simple. Woulkd the equivalent in our case be moving all those details out of CONTRIBUTING.md to DEVELOPMENT.md ?

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, yeah I guess you're right. We can keep it and just trim it a little bit.

DEVELOPMENT.md Outdated

## Code coverage

<!-- spell-checker:ignore (flags) Ccodegen Coverflow Cpanic Zinstrument Zpanic -->
Copy link
Member

Choose a reason for hiding this comment

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

Let's move this to the top.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to the top of the Testing section or somewhere else?

DEVELOPMENT.md Outdated

## Before you start

For this guide we assume that you already have GitHub account and have `git` and your favorite code editor or IDE installed and configured to work with GitHub.
Copy link
Member

Choose a reason for hiding this comment

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

configured to work with GitHub.

Nit, but the IDE doesn't need GitHub integration.

DEVELOPMENT.md Outdated
For this guide we assume that you already have GitHub account and have `git` and your favorite code editor or IDE installed and configured to work with GitHub.
Before you start working on coreutils, please follow these steps:

1. Fork [coreutils repository](https://github.com/uutils/coreutils) to your GitHub account [ref:](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
1. Fork [coreutils repository](https://github.com/uutils/coreutils) to your GitHub account [ref:](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
1. Fork the [coreutils repository](https://github.com/uutils/coreutils) to your GitHub account [ref:](https://docs.github.com/en/get-started/quickstart/fork-a-repo)

I'd also like to have some more text as the link than "ref". Maybe See [this GitHub guide](...) for more information.

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail-2/inotify-dir-recreate

@zhitkoff
Copy link
Contributor Author

zhitkoff commented Sep 1, 2023

made changes to DEVELOPMENT.md and simplified CONTRIBUTING.md (offload and link all dev details to DEVELOPMENT.md). There are some TODOs left - looking for feedback

DEVELOPMENT.md Outdated
@@ -0,0 +1,331 @@
<!-- spell-checker:ignore reimplementing toybox RUNTEST CARGOFLAGS nextest prereq autopoint gettext texinfo automake findutils shellenv libexec gnubin -->
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Suggested change
<!-- spell-checker:ignore reimplementing toybox RUNTEST CARGOFLAGS nextest prereq autopoint gettext texinfo automake findutils shellenv libexec gnubin -->
<!-- spell-checker:ignore reimplementing toybox RUNTEST CARGOFLAGS nextest prereq autopoint gettext texinfo automake findutils shellenv libexec gnubin toolchains -->

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! If you do not mind me asking - what are you using for spell checker? The VSCode spellchecker extension did not catch this, even though it is enabled for markdown files by default

zhitkoff and others added 2 commits September 2, 2023 14:44
Co-authored-by: Sylvestre Ledru <sledru@mozilla.com>
@sylvestre
Copy link
Sponsor Contributor

please let me know when it is ready to be reviewed :)

@zhitkoff zhitkoff marked this pull request as ready for review September 7, 2023 15:09
@zhitkoff
Copy link
Contributor Author

zhitkoff commented Sep 7, 2023

please let me know when it is ready to be reviewed :)

yep, should be ready

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

GNU testsuite comparison:

GNU test failed: tests/rm/rm2. tests/rm/rm2 is passing on 'main'. Maybe you have to rebase?

@sylvestre
Copy link
Sponsor Contributor

you know that merging isn't necessary ? ;)
(esp for doc)

CONTRIBUTING.md Outdated
<!-- spell-checker:ignore (flags) Ccodegen Coverflow Cpanic Zinstrument Zpanic -->

Code coverage report can be generated using [grcov](https://github.com/mozilla/grcov).
## TODO : Any guidelines for branching, PRs, etc?
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

please remove it, we don't do it yet

Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

ping ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

apologies - have been traveling. will do

CONTRIBUTING.md Outdated

If you are using stable version of Rust that doesn't enable code coverage instrumentation by default
then add `-Z-Zinstrument-coverage` flag to `RUSTFLAGS` env variable specified above.
***TODO*** The technical details on how to generate report locally are offloaded to DEVELOPMENT.md
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

please fix this one too

@zhitkoff
Copy link
Contributor Author

you know that merging isn't necessary ? ;)
(esp for doc)

thanks, will keep that in mind in the future.

Copy link
Member

@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

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

This is looking very good! The content is great, I just have few comments on the formatting.

DEVELOPMENT.md Outdated Show resolved Hide resolved
DEVELOPMENT.md Outdated

If you're using rustup to install and manage your Rust toolchains, `clippy` and `rustfmt` are usually already installed. If you are using one of the alternative methods, please make sure to install them manually. See following sub-sections for their usage: [clippy](#clippy) [rustfmt](#rustfmt)

***Tip*** You might also need to add 'llvm-tools':
Copy link
Member

@tertsdiepraam tertsdiepraam Sep 24, 2023

Choose a reason for hiding this comment

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

Suggested change
***Tip*** You might also need to add 'llvm-tools':
***Tip***: You might also need to add 'llvm-tools':

It might also be nice to mention what those tools are for. Is it code cov?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, will update

DEVELOPMENT.md Outdated
Before you start working on coreutils, please follow these steps:

1. Fork the [coreutils repository](https://github.com/uutils/coreutils) to your GitHub account.
***Tip:*** See [this GitHub guide](https://docs.github.com/en/get-started/quickstart/fork-a-repo) for more information on this step
Copy link
Member

Choose a reason for hiding this comment

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

Very nitpicky, but there's a few periods missing at the end of sentences throughout this doc.

DEVELOPMENT.md Show resolved Hide resolved
sylvestre and others added 2 commits September 25, 2023 13:33
Co-authored-by: Terts Diepraam <terts.diepraam@gmail.com>
DEVELOPMENT.md Outdated
On MacOS you will need to install [Homebrew](https://docs.brew.sh/Installation) and use it to install the following Homebrew formulas:

```shell
brew install coreutils
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

it cannot be done on a single line ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it sure can, but how about this version instead?

brew install \
  coreutils \
  autoconf \
  gettext \
  wget \
  texinfo \
  xz \
  automake \
  gnu-sed \
  m4 \
  bison \
  pre-commit \
  findutils

Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

ship it :)

Copy link
Member

@tertsdiepraam tertsdiepraam 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 happy with this! I'll let Sylvestre make the final merge, but it's got my approval. Thanks!

@sylvestre sylvestre merged commit 9f6a720 into uutils:main Oct 2, 2023
45 checks passed
@zhitkoff zhitkoff deleted the zhitkoff/issue5195 branch November 18, 2023 16:37
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