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

feature: allow arch_sixtyfour in enabled_if #8023

Conversation

Alizter
Copy link
Collaborator

@Alizter Alizter commented Jun 21, 2023

We allow the arch_sixtyfour variable in enabled_if.

@Alizter Alizter force-pushed the ps/branch/feature__allow_arch_sixtyfour_in_enabled_if branch 2 times, most recently from aebfe5b to 50de558 Compare June 21, 2023 16:14
@Alizter
Copy link
Collaborator Author

Alizter commented Jun 21, 2023

Dune cannot version check an expression like (= %{arch_sixtyfour} %{arch_sixtyfour} and will complain about lists. Therefore in the test I had to reduce to a single variable in the blang so to show the check.

@Alizter Alizter requested a review from emillon June 21, 2023 16:16
@Alizter
Copy link
Collaborator Author

Alizter commented Jun 21, 2023

@emillon Please include for 3.9.

@Alizter Alizter force-pushed the ps/branch/feature__allow_arch_sixtyfour_in_enabled_if branch from 50de558 to a95c772 Compare June 22, 2023 09:47
@@ -18,6 +18,7 @@ let common_vars_list =
; "profile"
; "ocaml_version"
; "context_name"
; "arch_sixtyfour"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure how versioning is supposed to work here. For example, (rule) uses ~allowed_vars:Any so this means that it will accept arch_sixtyfour even with lang dune 1.4 (this affects context_name too). @rgrinberg do you know how this is supposed to work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe that is intentional to not restrict the user from writing a rule?

Copy link
Collaborator

Choose a reason for hiding this comment

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

that's not correct. it means a dune file can be valid or not depending on the version of the dune binary, which we try to avoid.


File "dune", line 3, characters 13-30:
3 | (enabled_if %{arch_sixtyfour}))
Error: %{arch_sixtyfour} is only available since version 3.9 of the dune
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't reproduce the failure in the error message. It's outputting the right one here (and CI agrees).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Weird this is what I get on this branch.

Copy link
Collaborator

@emillon emillon Jun 22, 2023

Choose a reason for hiding this comment

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

what does ocamlc -config|grep word_size output on your setup?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

64

@Alizter Alizter force-pushed the ps/branch/feature__allow_arch_sixtyfour_in_enabled_if branch 2 times, most recently from f46ca8a to 195048e Compare June 28, 2023 08:57
@Alizter
Copy link
Collaborator Author

Alizter commented Jun 28, 2023

I guess for now I will just open an issue for the difference in test output. That will require some parser cleanup that is unrelated to this. I've still got to update the documentation which I will do later.

@Alizter
Copy link
Collaborator Author

Alizter commented Jun 28, 2023

@emillon I couldn't find any documentation on other allowed fields in enabled_if. I guess I don't need to document anything further?

@Alizter Alizter requested a review from emillon June 28, 2023 13:59
@Alizter
Copy link
Collaborator Author

Alizter commented Jun 28, 2023

We need to bump the version check and modify the changelog.

@Alizter Alizter force-pushed the ps/branch/feature__allow_arch_sixtyfour_in_enabled_if branch 3 times, most recently from a44d765 to 5704f23 Compare July 7, 2023 08:36
@Alizter
Copy link
Collaborator Author

Alizter commented Jul 7, 2023

@emillon The changelog and version numbers have been adjusted accordingly.

@Alizter Alizter force-pushed the ps/branch/feature__allow_arch_sixtyfour_in_enabled_if branch from f782c54 to f415a88 Compare July 11, 2023 16:22
@ocaml-benchmarks
Copy link

#8023 (356f511) changes the metrics as follows in comparison to main (4256431) when running on fermat (bench/monorepo/bench.Dockerfile):

Benchmark: default

Test: dune monorepo benchmarks

  • build from scratch changed by 4.3%
  • null build changed by -3.1%
  • watch mode: changing file in 'base' library changed by 1.6%
  • watch mode: changing file in 'file_path' library changed by -2.5%
  • watch mode: fixing error in file in 'base' library changed by -3.1%
  • watch mode: fixing error in file in 'file_path' library changed by -0.8%
  • watch mode: introducing error in file in 'base' library changed by -12.7%
  • watch mode: introducing error in file in 'file_path' library changed by -4.6%

@ocaml-benchmarks
Copy link

#8023 (7f371c4) changes the metrics as follows in comparison to main (a0145b2) when running on fermat (bench/monorepo/bench.Dockerfile):

Benchmark: default

Test: dune monorepo benchmarks

  • build from scratch changed by 1.2%
  • null build changed by 1.2%
  • watch mode: changing file in 'base' library changed by -2.7%
  • watch mode: changing file in 'file_path' library changed by 2.7%
  • watch mode: fixing error in file in 'base' library changed by -1.0%
  • watch mode: fixing error in file in 'file_path' library changed by 2.5%
  • watch mode: introducing error in file in 'base' library changed by -1.5%
  • watch mode: introducing error in file in 'file_path' library changed by -6.0%

CHANGES.md Outdated Show resolved Hide resolved
@Alizter Alizter force-pushed the ps/branch/feature__allow_arch_sixtyfour_in_enabled_if branch from 7f371c4 to 6b700b1 Compare July 14, 2023 10:51
@Alizter
Copy link
Collaborator Author

Alizter commented Jul 16, 2023

@rgrinberg ping

@rgrinberg
Copy link
Member

@emillon is reviewing this one

@Alizter
Copy link
Collaborator Author

Alizter commented Jul 16, 2023

@rgrinberg Oh sorry, I was confused, I thought it was you.

@Alizter
Copy link
Collaborator Author

Alizter commented Jul 18, 2023

@emillon ping

@Alizter
Copy link
Collaborator Author

Alizter commented Jul 20, 2023

@emillon Ping on this, would be good to get in for 3.10.

@Alizter Alizter force-pushed the ps/branch/feature__allow_arch_sixtyfour_in_enabled_if branch from 979a6e3 to d6b2b57 Compare July 23, 2023 21:43
@Alizter Alizter force-pushed the ps/branch/feature__allow_arch_sixtyfour_in_enabled_if branch from d6b2b57 to 489e380 Compare August 2, 2023 13:41
CHANGES.md Outdated Show resolved Hide resolved
@Alizter Alizter force-pushed the ps/branch/feature__allow_arch_sixtyfour_in_enabled_if branch 3 times, most recently from 549e682 to 57c799c Compare August 4, 2023 15:22
Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter Alizter force-pushed the ps/branch/feature__allow_arch_sixtyfour_in_enabled_if branch from 57c799c to be2dd4c Compare August 4, 2023 15:28
@rgrinberg rgrinberg merged commit 05fa7ad into ocaml:main Aug 4, 2023
@rgrinberg rgrinberg added this to the 3.11.0 milestone Aug 4, 2023
emillon added a commit to emillon/opam-repository that referenced this pull request Sep 14, 2023
CHANGES:

- Modules that were declared in `(modules_without_implementation)`,
  `(private_modules)` or `(virtual_modules)` but not declared in `(modules)`
  will raise an error. (ocaml/dune#7674, @Alizter)

- `enabled_if` now supports `arch_sixtyfour` variable (ocaml/dune#8023, fixes ocaml/dune#7997,
  @Alizter)- Use `posix_spawn` instead of `fork` on MacOS. This gives us a
  performance boost and allows us to re-enable thread. (ocaml/dune#8090, @rgrinberg)

- Experimental: Added a `$ dune monitor` command that can connect to a running
  `dune build` in watch mode and display the errors and progress. (ocaml/dune#8152,
  @Alizter)

- No longer emit linkopts(javascript) in META files (ocaml/dune#8168, @hhugo)

- The `progress` RPC procedure now has an extra field for the `In_progress`
  constructor for the number of failed jobs. (ocaml/dune#8212, @Alizter)

- Add a `--preview` flag to `dune fmt` which causes it to print out the changes
  it would make without applying them (ocaml/dune#8289, @gridbugs)

- Introduce `(source_trees ..)` to the install stanza to allow installing
  entire source trees. (ocaml/dune#8349, @rgrinberg)

- Deprecate install destination paths beginning with ".." to prevent packages
  escaping their designated installation directories. (ocaml/dune#8350, @gridbugs)

- Stop signing source files with substitutions. Sign only binaries instead
  (ocaml/dune#8361, fixes ocaml/dune#8360, @anmonteiro)

- Add `--stop-on-first-error` option to `dune build` which will terminate the
  build when the first error is encountered. (ocaml/dune#8400, @pmwhite and @Alizter)-
  Dune now displays the number of errors when waiting for changes in watch
  mode. (ocaml/dune#8408, fixes ocaml/dune#6889, @Alizter)

- Add `with_prefix` keyword for changing the prefix of the destination of
  installed files matched by globs. (ocaml/dune#8416, @gridbugs)

- Added experimental `--display tui` option for Dune that opens an interactive
  Terminal User Interface (TUI) when Dune is running. Press '?' to open up a
  help screen when running for more information. (ocaml/dune#8429, @Alizter and
  @rgrinberg)

- Add a `warnings` field to `dune-project` files as a unified mechanism to
  enable or disable dune warnings (@rgrinberg, 8448)

- `dune exec`: support syntax like `%{bin:program}`. This can appear anywhere
  in the command line, so things like `dune exec time %{bin:program}` now work.
  (ocaml/dune#6035, ocaml/dune#8474, fixes ocaml/dune#2691, @emillon, @Leonidas-from-XIV)

- RPC message styles are now serialised meaning that RPC diagnostics keep their
  Ansi styling. (ocaml/dune#8516, fixes ocaml/dune#6921, @Alizter)- Ignore internal promote rules
  when `--ignore-promoted-rules` is set (ocaml/dune#8518, fix ocaml/dune#8417, @rgrinberg)

- Truncate output from actions that produce too much output (@tov, ocaml/dune#8351)

- Allow libraries to shadow OCaml builtin libraries. Previously, builtin
  libraries would always take precedence. (@rgrinberg, ocaml/dune#8558)

- Remove warning against `.dune` files generated by pre dune 2.0 (ocaml/dune#8611,
  @rgrinberg)

- `dune utop` no longer links `utop` in "custom" mode, which should make this
  command considerably faster. (ocaml/dune#8631, fixes ocaml/dune#6894, @nojb)

- Ensure that package names in `dune-project` are valid opam package
  names. (ocaml/dune#8331, @emillon)

- dune init: parse `--public` as a public name (ocaml/dune#8603, fixes ocaml/dune#7108, @emillon)

- Remove versions 0.1 and 0.2 of the experimental ctypes extension. (ocaml/dune#8293,
  @emillon)
emillon added a commit to emillon/opam-repository that referenced this pull request Sep 22, 2023
CHANGES:

- `enabled_if` now supports `arch_sixtyfour` variable (ocaml/dune#8023, fixes ocaml/dune#7997,
  @Alizter)

- Use `posix_spawn` instead of `fork` on MacOS. This gives us a performance
  boost and allows us to re-enable thread. (ocaml/dune#8090, @rgrinberg)

- Experimental: Added a `$ dune monitor` command that can connect to a running
  `dune build` in watch mode and display the errors and progress. (ocaml/dune#8152,
  @Alizter)

- The `progress` RPC procedure now has an extra field for the `In_progress`
  constructor for the number of failed jobs. (ocaml/dune#8212, @Alizter)

- Add a `--preview` flag to `dune fmt` which causes it to print out the changes
  it would make without applying them (ocaml/dune#8289, @gridbugs)

- Introduce `(source_trees ..)` to the install stanza to allow installing
  entire source trees. (ocaml/dune#8349, @rgrinberg)

- Add `--stop-on-first-error` option to `dune build` which will terminate the
  build when the first error is encountered. (ocaml/dune#8400, @pmwhite and @Alizter)

- Dune now displays the number of errors when waiting for changes in watch
  mode. (ocaml/dune#8408, fixes ocaml/dune#6889, @Alizter)

- Add `with_prefix` keyword for changing the prefix of the destination of
  installed files matched by globs. (ocaml/dune#8416, @gridbugs)

- Added experimental `--display tui` option for Dune that opens an interactive
  Terminal User Interface (TUI) when Dune is running. Press '?' to open up a
  help screen when running for more information. (ocaml/dune#8429, @Alizter and
  @rgrinberg)

- Add a `warnings` field to `dune-project` files as a unified mechanism to
  enable or disable dune warnings (@rgrinberg, 8448)

- `dune exec`: support syntax like `%{bin:program}`. This can appear anywhere
  in the command line, so things like `dune exec time %{bin:program}` now work.
  (ocaml/dune#6035, ocaml/dune#8474, fixes ocaml/dune#2691, @emillon, @Leonidas-from-XIV)

- Make copy sandbox support directory targets. (ocaml/dune#8705, fixes ocaml/dune#7724, @emillon)

- Add a new alias `@doc-json` to build odoc documentation in JSON format. This
  output can be consumed by external tools. (ocaml/dune#8178, @emillon)

- Modules that were declared in `(modules_without_implementation)`,
  `(private_modules)` or `(virtual_modules)` but not declared in `(modules)`
  will raise an error. (ocaml/dune#7674, @Alizter)

- No longer emit linkopts(javascript) in META files (ocaml/dune#8168, @hhugo)

- Deprecate install destination paths beginning with ".." to prevent packages
  escaping their designated installation directories. (ocaml/dune#8350, @gridbugs)

- RPC message styles are now serialised meaning that RPC diagnostics keep their
  Ansi styling. (ocaml/dune#8516, fixes ocaml/dune#6921, @Alizter)

- Truncate output from actions that produce too much output (@tov, ocaml/dune#8351)

- Allow libraries to shadow OCaml builtin libraries. Previously, builtin
  libraries would always take precedence. (@rgrinberg, ocaml/dune#8558)

- Remove warning against `.dune` files generated by pre dune 2.0 (ocaml/dune#8611,
  @rgrinberg)

- `dune utop` no longer links `utop` in "custom" mode, which should make this
  command considerably faster. (ocaml/dune#8631, fixes ocaml/dune#6894, @nojb)

- Ensure that package names in `dune-project` are valid opam package names.
  (ocaml/dune#8331, @emillon)

- init: check that module names are valid (ocaml/dune#8644, fixes ocaml/dune#8252, @emillon)

- dune init: parse `--public` as a public name (ocaml/dune#8603, fixes ocaml/dune#7108, @emillon)

- Stop signing source files with substitutions. Sign only binaries instead
  (ocaml/dune#8361, fixes ocaml/dune#8360, @anmonteiro)

- Remove versions 0.1 and 0.2 of the experimental ctypes extension. (ocaml/dune#8293,
  @emillon)
nberth pushed a commit to nberth/opam-repository that referenced this pull request Jun 18, 2024
CHANGES:

- `enabled_if` now supports `arch_sixtyfour` variable (ocaml/dune#8023, fixes ocaml/dune#7997,
  @Alizter)

- Use `posix_spawn` instead of `fork` on MacOS. This gives us a performance
  boost and allows us to re-enable thread. (ocaml/dune#8090, @rgrinberg)

- Experimental: Added a `$ dune monitor` command that can connect to a running
  `dune build` in watch mode and display the errors and progress. (ocaml/dune#8152,
  @Alizter)

- The `progress` RPC procedure now has an extra field for the `In_progress`
  constructor for the number of failed jobs. (ocaml/dune#8212, @Alizter)

- Add a `--preview` flag to `dune fmt` which causes it to print out the changes
  it would make without applying them (ocaml/dune#8289, @gridbugs)

- Introduce `(source_trees ..)` to the install stanza to allow installing
  entire source trees. (ocaml/dune#8349, @rgrinberg)

- Add `--stop-on-first-error` option to `dune build` which will terminate the
  build when the first error is encountered. (ocaml/dune#8400, @pmwhite and @Alizter)

- Dune now displays the number of errors when waiting for changes in watch
  mode. (ocaml/dune#8408, fixes ocaml/dune#6889, @Alizter)

- Add `with_prefix` keyword for changing the prefix of the destination of
  installed files matched by globs. (ocaml/dune#8416, @gridbugs)

- Added experimental `--display tui` option for Dune that opens an interactive
  Terminal User Interface (TUI) when Dune is running. Press '?' to open up a
  help screen when running for more information. (ocaml/dune#8429, @Alizter and
  @rgrinberg)

- Add a `warnings` field to `dune-project` files as a unified mechanism to
  enable or disable dune warnings (@rgrinberg, 8448)

- `dune exec`: support syntax like `%{bin:program}`. This can appear anywhere
  in the command line, so things like `dune exec time %{bin:program}` now work.
  (ocaml/dune#6035, ocaml/dune#8474, fixes ocaml/dune#2691, @emillon, @Leonidas-from-XIV)

- Make copy sandbox support directory targets. (ocaml/dune#8705, fixes ocaml/dune#7724, @emillon)

- Add a new alias `@doc-json` to build odoc documentation in JSON format. This
  output can be consumed by external tools. (ocaml/dune#8178, @emillon)

- Modules that were declared in `(modules_without_implementation)`,
  `(private_modules)` or `(virtual_modules)` but not declared in `(modules)`
  will raise an error. (ocaml/dune#7674, @Alizter)

- No longer emit linkopts(javascript) in META files (ocaml/dune#8168, @hhugo)

- Deprecate install destination paths beginning with ".." to prevent packages
  escaping their designated installation directories. (ocaml/dune#8350, @gridbugs)

- RPC message styles are now serialised meaning that RPC diagnostics keep their
  Ansi styling. (ocaml/dune#8516, fixes ocaml/dune#6921, @Alizter)

- Truncate output from actions that produce too much output (@tov, ocaml/dune#8351)

- Allow libraries to shadow OCaml builtin libraries. Previously, builtin
  libraries would always take precedence. (@rgrinberg, ocaml/dune#8558)

- Remove warning against `.dune` files generated by pre dune 2.0 (ocaml/dune#8611,
  @rgrinberg)

- `dune utop` no longer links `utop` in "custom" mode, which should make this
  command considerably faster. (ocaml/dune#8631, fixes ocaml/dune#6894, @nojb)

- Ensure that package names in `dune-project` are valid opam package names.
  (ocaml/dune#8331, @emillon)

- init: check that module names are valid (ocaml/dune#8644, fixes ocaml/dune#8252, @emillon)

- dune init: parse `--public` as a public name (ocaml/dune#8603, fixes ocaml/dune#7108, @emillon)

- Stop signing source files with substitutions. Sign only binaries instead
  (ocaml/dune#8361, fixes ocaml/dune#8360, @anmonteiro)

- Remove versions 0.1 and 0.2 of the experimental ctypes extension. (ocaml/dune#8293,
  @emillon)
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.

Support the "word_size" variable in "enabled_if".
3 participants