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

[new release] dune (1.0.0) #12323

Merged
merged 3 commits into from Jul 11, 2018
Merged

[new release] dune (1.0.0) #12323

merged 3 commits into from Jul 11, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jul 10, 2018

Fast, portable and opinionated build system

CHANGES:

CHANGES:

- Do not load the user configuration file when running inside dune
  (ocaml/dune#700 @diml)

- Do not infer ${null} to be a target (ocaml/dune#693 fixes ocaml/dune#694 @rgrinberg)

- Introduce jbuilder.configurator library. This is a revived version of
  janestreet's configurator library with better cross compilation support, a
  versioned API, and no external dependencies. (ocaml/dune#673, ocaml/dune#678 ocaml/dune#692, ocaml/dune#695
  @rgrinberg)

- Register the transitive dependencies of compilation units as the
  compiler might read `.cm*` files recursively (ocaml/dune#666, fixes ocaml/dune#660,
  @emillon)

- Fix a bug causing `jbuilder external-lib-deps` to crash (ocaml/dune#723,
  @diml)

- `-j` now defaults to the number of processing units available rather
  4 (ocaml/dune#726, @diml)

- Fix attaching index.mld to documentation (ocaml/dune#731, fixes ocaml/dune#717 @rgrinberg)

- Scan the file system lazily (ocaml/dune#732, fixes ocaml/dune#718 and ocaml/dune#228, @diml)

- Add support for setting the default ocaml flags and for build
  profiles (ocaml/dune#419, @diml)

- Display a better error messages when writing `(inline_tests)` in an
  executable stanza (ocaml/dune#748, @diml)

- Restore promoted files when they are deleted or changed in the
  source tree (ocaml/dune#760, fix ocaml/dune#759, @diml)

- Fix a crash when using an invalid alias name (ocaml/dune#762, fixes ocaml/dune#761,
  @diml)

- Fix a crash when using c files from another directory (ocaml/dune#758, fixes
  ocaml/dune#734, @diml)

- Add an `ignored_subdirs` stanza to replace `jbuild-ignore` files
  (ocaml/dune#767, @diml)

- Fix a bug where Dune ignored previous occurrences of duplicated
  fields (ocaml/dune#779, @diml)

- Allow setting custom build directories using the `--build-dir` flag or
  `DUNE_BUILD_DIR` environment variable (ocaml/dune#846, fix ocaml/dune#291, @diml @rgrinberg)

- In dune files, remove support for block (`#| ... |#)`) and sexp
  (`#;`) comments. These were very rarely used and complicate the
  language (ocaml/dune#837, @diml)

- In dune files, add support for block strings, allowing to nicely
  format blocks of texts (ocaml/dune#837, @diml)

- Remove hard-coded knowledge of ppx_driver and
  ocaml-migrate-parsetree when using a `dune` file (ocaml/dune#576, @diml)

- Make the output of Dune slightly more deterministic when run from
  inside Dune (ocaml/dune#855, @diml)

- Simplify quoting behavior of variables. All values are now multi-valued and
  whether a multi valued variable is allowed is determined by the quoting and
  substitution context it appears in. (ocaml/dune#849, fix ocaml/dune#701, @rgrinberg)

- Fix documentation generation for private libraries. (ocaml/dune#864, fix ocaml/dune#856,
  @rgrinberg)

- Use `Marshal` to store digest and incremental databases. This improves the
  speed of 0 rebuilds. (ocaml/dune#817, @diml)

* Allow setting environment variables in `findlib.conf` for cross compilation
  contexts. (ocaml/dune#733, @rgrinberg)

- Add a `link_deps` field to executables, to specify link-time dependencies
  like version scripts. (ocaml/dune#879, fix ocaml/dune#852, @emillon)

- Rename `files_recursively_in` to `source_tree` to make it clearer it
  doesn't include generated files (ocaml/dune#899, fix ocaml/dune#843, @diml)

- Present the `menhir` stanza as an extension with its own version
  (ocaml/dune#901, @diml)

- Improve the syntax of flags in `(pps ...)`. Now instead of `(pps
  (ppx1 -arg1 ppx2 (-foo x)))` one should write `(pps ppx1 -arg ppx2
  -- -foo x)` which looks nicer (ocaml/dune#910, @diml)

- Make `(diff a b)` ignore trailing cr on Windows and add `(cmp a b)` for
  comparing binary files (ocaml/dune#904, fix ocaml/dune#844, @diml)

- Make `dev` the default build profile (ocaml/dune#920, @diml)

- Version `dune-workspace` and `~/.config/dune/config` files (ocaml/dune#932, @diml)

- Add the ability to build an alias non-recursively from the command
  line by writing `@@alias` (ocaml/dune#926, @diml)

- Add a special `default` alias that defaults to `(alias_rec install)`
  when not defined by the user and make `@@default` be the default
  target (ocaml/dune#926, @diml)

- Forbid `#require` in `dune` files in OCaml syntax (ocaml/dune#938, @diml)

- Add `%{profile}` variable. (ocaml/dune#938, @rgrinberg)

- Do not require opam-installer anymore (ocaml/dune#941, @diml)

- Add the `lib_root` and `libexec_root` install sections (ocaml/dune#947, @diml)

- Rename `path:file` to `dep:file` (ocaml/dune#944, @emillon)

- Remove `path-no-dep:file` (ocaml/dune#948, @emillon)

- Adapt the behavior of `dune subst` for dune projects (ocaml/dune#960, @diml)

- Add the `lib_root` and `libexec_root` sections to install stanzas
  (ocaml/dune#947, @diml)

- Add a `Configurator.V1.Flags` module that improves the flag reading/writing
  API (ocaml/dune#840, @avsm)

- Add a `tests` stanza that simlpified defining regular and expect tests
  (ocaml/dune#822, @rgrinberg)

- Change the `subst` subcommand to lookup the project name from the
  `dune-project` whenever it's available. (ocaml/dune#960, @diml)

- The `subst` subcommand no longer looks up the root workspace. Previously this
  detection would break the command whenever `-p` wasn't passed. (ocaml/dune#960, @diml)

- Add a `# DUNE_GEN` in META template files. This is done for consistency with
  `# JBUILDER_GEN`. (ocaml/dune#958, @rgrinberg)

- Rename the following variables in dune files:
  `SCOPE_ROOT` to `project_root`
  `@` to `targets`
  `<` to `first-dep`
  `^` to `deps`
  (ocaml/dune#957, @rgrinberg)

- Rename `ROOT` to `workspace_root` in dune files (ocaml/dune#993, @diml)

- Lowercase all built-in %{variables} in dune files (ocaml/dune#956, @rgrinberg)

- New syntax for naming dependencies: `(deps (:x a b) (:y (glob_files *.c*)))`.
  This replaces the use for `${<}` in dune files. (ocaml/dune#950, @diml, @rgrinberg)

- Fix detection of dynamic cycles, which in particular may appear when
  using `(package ..)` dependencies (ocaml/dune#988, @diml)
@kit-ty-kate
Copy link
Member

There are some failures already. The main cause seems to be this (I haven't checked everything though):

#=== ERROR while compiling sexplib.v0.10.0 ====================================#
# context              2.0.0~rc3 | linux/x86_64 | ocaml-base-compiler.4.06.1 | git+file:///home/opam/opam-repository
# path                 ~/.opam/4.06/.opam-switch/build/sexplib.v0.10.0
# command              ~/.opam/4.06/bin/jbuilder build -p sexplib -j 71
# exit-code            1
# env-file             ~/.opam/log/sexplib-18-8262d6.env
# output-file          ~/.opam/log/sexplib-18-8262d6.out
### output ###
#           sh src/pre_sexp.pp.ml (exit 126)
# (cd _build/default && /bin/sh -c '${PA_CPP} src/pre_sexp.ml') > _build/default/src/pre_sexp.pp.ml
# /bin/sh: 1: src/pre_sexp.ml: Permission denied

@ghost
Copy link
Author

ghost commented Jul 10, 2018

Indeed, I fixed it in master. Is there a way to grep through the logs? To see if there are other failures before I update the release

@kit-ty-kate
Copy link
Member

There are still some errors:

#=== ERROR while compiling kafka.0.3 ==========================================#
# context              2.0.0~rc3 | linux/x86_64 | ocaml-base-compiler.4.06.1 | git+file:///home/opam/opam-repository
# path                 ~/.opam/4.06/.opam-switch/build/kafka.0.3
# command              ~/.opam/4.06/bin/jbuilder build -p kafka . -j 71 @install
# exit-code            1
# env-file             ~/.opam/log/kafka-18-ed9ebe.env
# output-file          ~/.opam/log/kafka-18-ed9ebe.out
### output ###
# Don't know how to build .
#=== ERROR while compiling opam-core.2.0.0~rc =================================#
# context              2.0.0~rc3 | linux/x86_64 | ocaml-base-compiler.4.06.1 | git+file:///home/opam/opam-repository
# path                 ~/.opam/4.06/.opam-switch/build/opam-core.2.0.0~rc
# command              /usr/bin/make opam-core.install
# exit-code            2
# env-file             ~/.opam/log/opam-core-18-e73fd7.env
# output-file          ~/.opam/log/opam-core-18-e73fd7.out
### output ###
# jbuilder build  -p opam-core opam-core.install
#        ocaml (internal)
# fatal: Not a git repository (or any of the parent directories): .git
#        ocaml src/ocaml-flags-standard.sexp (exit 2)
# (cd _build/default/src && /home/opam/.opam/4.06/bin/ocaml ../shell/subst_var.ml CONF_OCAMLFLAGS '' ${!^}) > _build/default/src/ocaml-flags-standard.sexp
# Exception: Sys_error "${!^}: No such file or directory".
#        ocaml src/core/opamCoreConfig.ml (exit 2)
# (cd _build/default/src/core && /home/opam/.opam/4.06/bin/ocaml ../../shell/subst_var.ml DEVELOPER false ${!^}) > _build/default/src/core/opamCoreConfig.ml
# Exception: Sys_error "${!^}: No such file or directory".
#        ocaml src/core/opamVersion.ml (exit 2)
# (cd _build/default/src/core && /home/opam/.opam/4.06/bin/ocaml ../../shell/subst_var.ml PACKAGE_VERSION <error> ${!^}) > _build/default/src/core/opamVersion.ml
# Exception: Sys_error "${!^}: No such file or directory".
# Makefile:93: recipe for target 'opam-core.install' failed
# make: *** [opam-core.install] Error 1
#=== ERROR while compiling reed-solomon-erasure.1.0.1 =========================#
# context              2.0.0~rc3 | linux/x86_64 | ocaml-base-compiler.4.06.1 | git+file:///home/opam/opam-repository
# path                 ~/.opam/4.06/.opam-switch/build/reed-solomon-erasure.1.0.1
# command              ~/.opam/4.06/bin/jbuilder build
# exit-code            1
# env-file             ~/.opam/log/reed-solomon-erasure-18-ff8c14.env
# output-file          ~/.opam/log/reed-solomon-erasure-18-ff8c14.out
### output ###
# File "dune-project", line 1, characters 11-14:
# Error: Version 0.1 of dune is not supported.
# Supported versions:
# - 0.0
# - 1.0
#=== ERROR while compiling yaml.0.1.0 =========================================#
# context              2.0.0~rc3 | linux/x86_64 | ocaml-base-compiler.4.06.1 | git+file:///home/opam/opam-repository
# path                 ~/.opam/4.06/.opam-switch/build/yaml.0.1.0
# command              ~/.opam/4.06/bin/jbuilder build -p yaml -j 71
# exit-code            1
# env-file             ~/.opam/log/yaml-18-50b255.env
# output-file          ~/.opam/log/yaml-18-50b255.out
### output ###
#           cc vendor/parser.o
# parser.c: In function 'yaml_parser_parse_block_sequence_entry':
# parser.c:762:21: warning: variable 'dummy_mark' set but not used [-Wunused-but-set-variable]
#          yaml_mark_t dummy_mark;     /* Used to eliminate a compiler warning. */
#                      ^~~~~~~~~~
# parser.c: In function 'yaml_parser_parse_block_mapping_key':
# parser.c:872:21: warning: variable 'dummy_mark' set but not used [-Wunused-but-set-variable]
#          yaml_mark_t dummy_mark;     /* Used to eliminate a compiler warning. */
#                      ^~~~~~~~~~
# parser.c: In function 'yaml_parser_parse_flow_sequence_entry':
# parser.c:955:17: warning: variable 'dummy_mark' set but not used [-Wunused-but-set-variable]
#      yaml_mark_t dummy_mark;     /* Used to eliminate a compiler warning. */
#                  ^~~~~~~~~~
# parser.c: In function 'yaml_parser_parse_flow_mapping_key':
# parser.c:1107:17: warning: variable 'dummy_mark' set but not used [-Wunused-but-set-variable]
#      yaml_mark_t dummy_mark;     /* Used to eliminate a compiler warning. */
#                  ^~~~~~~~~~
#           cc vendor/api.o
# api.c: In function 'yaml_document_delete':
# api.c:1121:7: warning: variable 'context' set but not used [-Wunused-but-set-variable]
#      } context;
#        ^~~~~~~
#           cc vendor/emitter.o
# emitter.c: In function 'yaml_emitter_write_plain_scalar':
# emitter.c:28:6: warning: value computed is not used [-Wunused-value]
#       && ((emitter->line_break == YAML_CR_BREAK ?                                \
#       ^
# emitter.c:56:11: note: in expansion of macro 'PUT_BREAK'
#           (PUT_BREAK(emitter),                                                   \
#            ^~~~~~~~~
# emitter.c:1931:18: note: in expansion of macro 'WRITE_BREAK'
#              if (!WRITE_BREAK(emitter, string)) return 0;
#                   ^~~~~~~~~~~
# emitter.c: In function 'yaml_emitter_write_single_quoted_scalar':
# emitter.c:28:6: warning: value computed is not used [-Wunused-value]
#       && ((emitter->line_break == YAML_CR_BREAK ?                                \
#       ^
# emitter.c:56:11: note: in expansion of macro 'PUT_BREAK'
#           (PUT_BREAK(emitter),                                                   \
#            ^~~~~~~~~
# emitter.c:1988:18: note: in expansion of macro 'WRITE_BREAK'
#              if (!WRITE_BREAK(emitter, string)) return 0;
#                   ^~~~~~~~~~~
# emitter.c: In function 'yaml_emitter_write_literal_scalar':
# emitter.c:28:6: warning: value computed is not used [-Wunused-value]
#       && ((emitter->line_break == YAML_CR_BREAK ?                                \
#       ^
# emitter.c:56:11: note: in expansion of macro 'PUT_BREAK'
#           (PUT_BREAK(emitter),                                                   \
#            ^~~~~~~~~
# emitter.c:2251:18: note: in expansion of macro 'WRITE_BREAK'
#              if (!WRITE_BREAK(emitter, string)) return 0;
#                   ^~~~~~~~~~~
# emitter.c: In function 'yaml_emitter_write_folded_scalar':
# emitter.c:28:6: warning: value computed is not used [-Wunused-value]
#       && ((emitter->line_break == YAML_CR_BREAK ?                                \
#       ^
# emitter.c:56:11: note: in expansion of macro 'PUT_BREAK'
#           (PUT_BREAK(emitter),                                                   \
#            ^~~~~~~~~
# emitter.c:2300:18: note: in expansion of macro 'WRITE_BREAK'
#              if (!WRITE_BREAK(emitter, string)) return 0;
#                   ^~~~~~~~~~~
#           cc vendor/scanner.o
# scanner.c: In function 'yaml_parser_decrease_flow_level':
# scanner.c:1189:23: warning: variable 'dummy_key' set but not used [-Wunused-but-set-variable]
#      yaml_simple_key_t dummy_key;    /* Used to eliminate a compiler warning. */
#                        ^~~~~~~~~
#           cc vendor/dllyaml_c_stubs.so (exit 1)
# (cd _build/default/vendor && /usr/bin/cc -shared -o dllyaml_c_stubs.so ${!^})
# cc: error: ${!^}: No such file or directory
# cc: fatal error: no input files
# compilation terminated.
#           ar vendor/libyaml_c_stubs.a (exit 1)
# (cd _build/default/vendor && /usr/bin/ar rcs libyaml_c_stubs.a ${!^})
# /usr/bin/ar: ${!^}: No such file or directory

@rgrinberg
Copy link
Member

The kafka thing is old. It was an error with the current jbuilder. I fixed the build instructions in kafka's master branch but it still needs a release. @didier-wenzek another ping :)

The maintainer of reed-solomon-erasure needs to update his package. He is relying on a detail of dune that never made it to any release. The 0.1 version of the dune language never made it to any releases.

@diml I thought we couldn't find any sightings of bang patterns? In any case, I'll bring em back. It's a tiny fix to maintain the compat in jbuild files.

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
@ghost
Copy link
Author

ghost commented Jul 11, 2018

@rgrinberg I don't think that's worth it, only two projects are affected and they both already have newer releases that are not affected. I added a conflit with dune to reed-solomon-erasure, the opam-*.*~rc packages and yaml.0.1.0.

@didier-wenzek
Copy link
Contributor

didier-wenzek commented Jul 11, 2018 via email

@kit-ty-kate
Copy link
Member

I can spot only one error remaining:

#=== ERROR while compiling ocamlformat.0.4 ====================================#
# context              2.0.0~rc3 | linux/x86_64 | ocaml-base-compiler.4.06.1 | git+file:///home/opam/opam-repository
# path                 ~/.opam/4.06/.opam-switch/build/ocamlformat.0.4
# command              ~/.opam/4.06/bin/jbuilder build -p ocamlformat -j 71
# exit-code            1
# env-file             ~/.opam/log/ocamlformat-18-5005e5.env
# output-file          ~/.opam/log/ocamlformat-18-5005e5.out
### output ###
# File "_build/.jbuilds/default/src/jbuild", line 7, characters 4-34:
# Error: path outside the workspace: ../../../.git/index from default/src

(same for ocamlformat.0.3)
If it's not related to dune and if it only requires a constraint to be fixed, it would be better to do that in a separate PR to avoid taking some more resources/time

@rgrinberg
Copy link
Member

So the error message is a bit sucky because you cannot tell if the paths are local to the build dir or your source dir but the error is essentially write. If you're inside a context's build dir, you cannot it with ../. So the build of ocamlformat would be broken if you set --build-dir. I recommend adding a conflict and moving on...

@kit-ty-kate
Copy link
Member

Fair enough. Let's do that!
Thanks a lot!

@didier-wenzek
Copy link
Contributor

@rgrinberg: I release your fixes to the dune config in the 0.4 release of the kafka bindings (in February). Should I patch & release the previous one? I'm not sure it worth the value. But I can do it if this hampers the release of dune.

@rgrinberg
Copy link
Member

rgrinberg commented Jul 11, 2018 via email

post-messages: [
"Jbuilder has been renamed and the jbuilder package is now a transition"
"package. Use the dune package instead."
]
Copy link
Member

Choose a reason for hiding this comment

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

Please don't do this, use a multi-line string instead. Or better, let opam reformat it, it knows about the terminal width. This actually prints 2 messages, and is e.g. inconsistent with the use of conditional filters.

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