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

ocamlc does not fully take into consideration -o parameter #5890

Closed
vicuna opened this issue Jan 14, 2013 · 9 comments
Closed

ocamlc does not fully take into consideration -o parameter #5890

vicuna opened this issue Jan 14, 2013 · 9 comments

Comments

@vicuna
Copy link

vicuna commented Jan 14, 2013

Original bug ID: 5890
Reporter: kosik
Assigned to: @shindere
Status: assigned (set by @damiendoligez on 2017-03-24T12:06:38Z)
Resolution: open
Priority: normal
Severity: feature
Version: 3.12.1
Category: compiler driver
Has duplicate: #7573
Related to: #6191 #6475
Monitored by: @hcarty

Bug description

When one tries to build an Ocaml library directly from multiple ml-files this way:

ocamlc -a -o library.cma foo.ml bar.ml baz.ml

things work fine. Essential *.cmi and *.cmo files are created in the same place as library.cma target.

However, when one tries to specify non-current output directory:

ocamlc -a -o /tmp/library.cma foo.ml bar.ml baz.ml

then *.cmo and *.cmi files are created in the current directory and only library.cma file is created in the designated /tmp directory.

While the manual page does not explicitly make any promises in this regard, the current behavior is surprising. It does not seem probably that user would want object files to be generated in one directory and resulting library in a different directory.

@vicuna
Copy link
Author

vicuna commented Jan 14, 2013

Comment author: kosik

ocamlopt has a similar (surprising) property

@vicuna
Copy link
Author

vicuna commented Jun 28, 2013

Comment author: @damiendoligez

I personally don't find this surprising at all, but this is related to a feature wish I seem to remember, for a "-odir" option to specify in what directory to put the generated files that are not specified with -o and thus have an implicit file name.

@vicuna
Copy link
Author

vicuna commented Mar 23, 2016

Comment author: @damiendoligez

This PR suggests putting auxiliary files in the same directory as the -o file.
That may fail if we have write access to the -o file but not its directory, so this would be a slightly dangerous change.

The -odir option seems safer and easier to use.

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 15, 2020
@shindere
Copy link
Contributor

shindere commented Jun 4, 2020 via email

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label Jul 21, 2021
@shindere
Copy link
Contributor

shindere commented Aug 9, 2021 via email

@github-actions github-actions bot removed the Stale label Aug 11, 2021
@shindere
Copy link
Contributor

shindere commented Sep 8, 2021 via email

@shindere
Copy link
Contributor

I am closing this issue because, as reported above, I think it is fixed in OCaml 4.13.0.

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

No branches or pull requests

2 participants