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

Attach actions from cinaps stanza to @cinaps and @runtest #2831

Merged
merged 1 commit into from
Nov 27, 2019

Conversation

NathanReb
Copy link
Collaborator

This attach the cinaps actions to the @cinaps alias and add a dependency from @runtest to @cinaps! Fixes #2801

(Path.extend_basename fn ~suffix:".cinaps-corrected")) )))
(Path.extend_basename fn ~suffix:".cinaps-corrected")) ))
in
Super_context.add_alias_action sctx ~dir ~loc:(Some loc) ~stamp:"cinaps"
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest to move Alias.cinaps to this module. The reason is cinaps is just an extension and I don't think it's worth hardcoding its existence in places where it's not completely necessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, I'll move it!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should it be considered a "standard" alias then?

It seems that currently it can't be made a standard alias from outside the Alias module.

Copy link
Member

Choose a reason for hiding this comment

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

standard is something that allows the alias not to error when it's empty? is that necessary? I don't think the manually defined cinaps alias has that either. Let's see if @diml has a preference.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah we discussed that with @emillon but I was wondering whether it should apply here since the cinaps alias can be defined without user explicitly creating it. It feels like it might require to be defined as a standard alias in that regard.

I don't have a strong opinion, either are fine by me!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I moved the alias to Cinaps and therefore made it a regular alias. I'm happy to move it back to Alias or to expose make_standard if we want to make it that way!

Copy link
Member

Choose a reason for hiding this comment

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

Either way works for me.

Copy link

Choose a reason for hiding this comment

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

Making cinaps standard would mean that user can call dune build @cinaps in a project-independent manner, i.e. without having to care whether cinaps is used or not. This is valuable for tests for instance, but a bit less for cinaps given that it is not very widespread.

When you think about it, it would make sense to include cinaps validation in the linting phase. We could do so by attaching it to the lint alias, which is already standard.

Finally, we could also have a general syntax for allowing a recursive alias to be empty. Such as dune build @?cinaps.

In conclusion, for now I wouldn't make cinaps standard. We can always revisit this decision in the future.

@NathanReb NathanReb force-pushed the cinaps-alias branch 3 times, most recently from 3b5cc71 to eef6521 Compare November 4, 2019 09:04
@NathanReb
Copy link
Collaborator Author

Is the test failure expected? I got it locally and thought something was maybe misconfigured on my side but it looks like an omitted promotion.

@rgrinberg
Copy link
Member

rgrinberg commented Nov 4, 2019 via email

src/dune/cinaps.ml Outdated Show resolved Hide resolved
@NathanReb NathanReb force-pushed the cinaps-alias branch 2 times, most recently from 24685e9 to 5f57ed9 Compare November 15, 2019 10:47
@NathanReb
Copy link
Collaborator Author

I also removed the Build.noop value that I originally added since it's not used in this PR anymore.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Looks good!

@NathanReb
Copy link
Collaborator Author

Just rebased, I'm guessing I can merge once CI is green.

@ghost
Copy link

ghost commented Nov 27, 2019

Sounds good!

@NathanReb NathanReb merged commit 9c4708f into ocaml:master Nov 27, 2019
rgrinberg added a commit to rgrinberg/opam-repository that referenced this pull request Dec 13, 2019
…lugin, dune-private-libs and dune-glob (2.1.0)

CHANGES:

- Attach cinaps stanza actions to both `@runtest` and `@cinaps` aliases
  (ocaml/dune#2831, @NathanReb)

- Add variables `%{lib-private...}` and `%{libexec-private...}` for finding
  build paths of files in public and private libraries within the same
  project. (ocaml/dune#2901, @snowleopard)

- Add `--mandir` option to `$ dune install`. This option allows to override the
  installation directory for man pages. (ocaml/dune#2915, fixes ocaml/dune#2670, @rgrinberg)

- Fix `dune --version`. The bootstrap didn't compute the version
  correctly. (ocaml/dune#2929, fixes ocaml/dune#2911, @diml)

- Do not open the log file in `dune clean`. (ocaml/dune#2965, fixes ocaml/dune#2964 and
  ocaml/dune#2921, @diml)

- Support passing two arguments to `=`, `<>`, ... operators in package
  dependencies so that we can have things such as `(<> :os win32)`
  (ocaml/dune#2965, @diml)
rgrinberg added a commit to rgrinberg/opam-repository that referenced this pull request Dec 21, 2019
…lugin, dune-private-libs and dune-glob (2.1.0)

CHANGES:

- Attach cinaps stanza actions to both `@runtest` and `@cinaps` aliases
  (ocaml/dune#2831, @NathanReb)

- Add variables `%{lib-private...}` and `%{libexec-private...}` for finding
  build paths of files in public and private libraries within the same
  project. (ocaml/dune#2901, @snowleopard)

- Add `--mandir` option to `$ dune install`. This option allows to override the
  installation directory for man pages. (ocaml/dune#2915, fixes ocaml/dune#2670, @rgrinberg)

- Fix `dune --version`. The bootstrap didn't compute the version
  correctly. (ocaml/dune#2929, fixes ocaml/dune#2911, @diml)

- Do not open the log file in `dune clean`. (ocaml/dune#2965, fixes ocaml/dune#2964 and
  ocaml/dune#2921, @diml)

- Support passing two arguments to `=`, `<>`, ... operators in package
  dependencies so that we can have things such as `(<> :os win32)`
  (ocaml/dune#2965, @diml)
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.

The cinaps stanza adding actions to @runtest isn't very flexible
2 participants