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

dune describe pp creates an empty profile.dump file at the root of the project #7430

Closed
Khady opened this issue Mar 28, 2023 · 7 comments
Closed
Labels
Milestone

Comments

@Khady
Copy link
Contributor

Khady commented Mar 28, 2023

Expected Behavior

dune describe pp some/file.ml should print the preprocess file.

Actual Behavior

It does print the preprocessed file but also creates a profile.dump file at the root of the project. This file is empty. I couldn't find a mention of this file in _build/log,

Reproduction

git clone https://github.com/hhugo/merge-fmt
dune describe pp test/merge.ml

Specifications

  • Version of dune (output of dune --version): 3.6.1 (but also happening on an experimental version of dune)
  • Version of ocaml (output of ocamlc --version): 4.14.0
  • Operating system (distribution and version): debian 11

Additional information

@rgrinberg
Copy link
Member

rgrinberg commented Mar 28, 2023

@nojb any idea what causes this file to appear?

@rgrinberg rgrinberg added the bug label Mar 28, 2023
@nojb
Copy link
Collaborator

nojb commented Mar 29, 2023

@nojb any idea what causes this file to appear?

I looked around a bit, but no idea, sorry.

@emillon
Copy link
Collaborator

emillon commented Mar 29, 2023

I had a look, this file is being created by the compiler here (we're invoking the compiler with -dsource -dump-into-file).

@emillon
Copy link
Collaborator

emillon commented Mar 29, 2023

(I'm not very familiar with the compiler driver, but I suppose that since no compilation happens, we end up in that case because no Exit_with_status 0 was raised, and the file is empty because profile_columns is empty)

@emillon
Copy link
Collaborator

emillon commented Mar 29, 2023

possible fixes: we could run that command in _build (seems fair), we could use dump-into _build, we could fix the compiler so that this function is a noop is profile_columns is empty.

@rgrinberg
Copy link
Member

we could run that command in _build (seems fair),

That would be a good idea. We should also delete it manually after running the action.

we could fix the compiler so that this function is a noop is profile_columns is empty.

Worth doing as well.

Alizter added a commit to Alizter/dune that referenced this issue Jul 18, 2023
Test case for ocaml#7430. We demonstrate that the `dune describe pp` command
leaves behind the dump file.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Alizter added a commit to Alizter/dune that referenced this issue Jul 18, 2023
Test case for ocaml#7430. We demonstrate that the `dune describe pp` command
leaves behind the dump file.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Alizter added a commit to Alizter/dune that referenced this issue Jul 18, 2023
Test case for ocaml#7430. We demonstrate that the `dune describe pp` command
leaves behind the dump file.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Alizter added a commit to Alizter/dune that referenced this issue Jul 18, 2023
Test case for ocaml#7430. We demonstrate that the `dune describe pp` command
leaves behind the dump file.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
emillon pushed a commit that referenced this issue Jul 18, 2023
Test case for #7430. We demonstrate that the `dune describe pp` command
leaves behind the dump file.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Alizter added a commit to Alizter/dune that referenced this issue Aug 4, 2023
We also fix this by running ocamlc in the _build directory and cleaning
up the dump file afterwards.

- fix ocaml#7430
- [x] changelog

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Alizter added a commit to Alizter/dune that referenced this issue Aug 4, 2023
We also fix this by running ocamlc in the _build directory and cleaning
up the dump file afterwards.

- fix ocaml#7430
- [x] changelog

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Alizter added a commit to Alizter/dune that referenced this issue Aug 4, 2023
We also fix this by running ocamlc in the _build directory and cleaning
up the dump file afterwards.

- fix ocaml#7430
- [x] changelog

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Alizter added a commit to Alizter/dune that referenced this issue Aug 10, 2023
We also fix this by running ocamlc in the _build directory and cleaning
up the dump file afterwards.

- fix ocaml#7430
- [x] changelog

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Alizter added a commit to Alizter/dune that referenced this issue Aug 30, 2023
We also fix this by running ocamlc in the _build directory and cleaning
up the dump file afterwards.

- fix ocaml#7430
- [x] changelog

Signed-off-by: Ali Caglayan <alizter@gmail.com>
@anmonteiro
Copy link
Collaborator

This was fixed in #10322 since we no longer pass -dump-into-file to ocamlc.

@rgrinberg rgrinberg added this to the 3.16.0 milestone Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants