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

Improve CONTRIBUTING.md by adding some guidance into the codebase for people who want to contribute to the code #5858

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kit-ty-kate
Copy link
Member

@kit-ty-kate kit-ty-kate commented Feb 27, 2024

I'm unsure if there already was such documentation somewhere but in any case it could be a nice entry point for potential contributors

TODO:

  • Define what's in shell/ (install.sh, bootstrap, "other scripts")
  • Give an example with opam install (what is the rough module/function path that is going to be followed)

Copy link
Collaborator

@rjbou rjbou left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this PR!!


As long as you have the dependencies, compiling opam is as simple as:
```
./configure
Copy link
Collaborator

@rjbou rjbou Mar 1, 2024

Choose a reason for hiding this comment

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

Suggested change
./configure
./configure --enable-developer-mode

i don't know if it is still needed with the ability to have several caches now

### Layout

The source code of opam is located in `src`. In this directory you will find subdirectories.
Each subdirectories have different puposes:
Copy link
Collaborator

Choose a reason for hiding this comment

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


Each `*.test` files in `tests/reftests` start with either `N0REP0` (empty repository, note the zeros) or a valid hash coming from opam-repository that the test starts with.

After that every lines starting with `### ` will be parsed as either a command or a custom action as defined by `tests/reftests/run.ml`, everything else will be the output of the command or the input of the custom commands, with the exception of `# Return code <n> #` when the command returns a non-zero exit code.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Redirect to run.ml for more specific documentation on the syntax?

make reftest-<name of the test> DUNE_ARGS="--auto-promote"
```
if you want to regenerate a test based on the new output of opam.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we also add how to add a new test file? It is maybe too specific for a generic contributing section.


If you have opam installed already, you can call:
```
opam install --deps-only -t .
Copy link
Collaborator

Choose a reason for hiding this comment

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

The -t is here for opam-devel ?

```
if you want to regenerate a test based on the new output of opam.

### Layout
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we also add a section on the doc?

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

Successfully merging this pull request may close these issues.

None yet

2 participants