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

Error: "Missing mandir" (dune install) #7814

Closed
bentxt opened this issue May 27, 2023 · 6 comments · Fixed by #7844
Closed

Error: "Missing mandir" (dune install) #7814

bentxt opened this issue May 27, 2023 · 6 comments · Fixed by #7844

Comments

@bentxt
Copy link

bentxt commented May 27, 2023

Expected Behavior

run

 dune install

in a project folder in order to install the project and its built artefact in the default locations

Actual Behavior

> dune install
Error: The mandir installation directory is unknown.
Hint: It could be specified with --mandir

Specifications

> dune --version
3.7.0
> opam --version
2.1.4
> ocaml --version
The OCaml toplevel, version 4.14.1

Additional information

My default mandir directory exists, so no need for specifying a folder I think

ls /usr/local/share/man
de/   ja/   man1/ man3/ man5/ man7/ man8/

Here some additional info on mandir:

https://www.gnu.org/prep/standards/html_node/Directory-Variables.html

‘mandir’
The top-level directory for installing the man pages (if any) for this package. It will normally be /usr/local/share/man, but you >should write it as $(datarootdir)/man. (If you are using Autoconf, write it as ‘@mandir@’.)

@bentxt bentxt changed the title Missing mandir Error: "Missing mandir" (dune install) May 27, 2023
@bentxt
Copy link
Author

bentxt commented May 27, 2023

Specifying --mandir was no enough. I had to specify all the locations like this

sudo dune install --mandir=/usr/local/share/man --docdir=/usr/local/share/doc/p5scm --etcdir=/usr/local/etc/ --datadir=/usr/local/share/p5scm --sbindir=/usr/local/sbin --bindir=/usr/local/bin/ --libexecdir=/usr/local/libexec/ --libdir=/usr/local/lib/

Additional problem
--libexecdir=/usr/local/libexec/ is now at a non-standard location since /usr/libexec is non-sudoable on macos

@NielsMommen
Copy link

Did you configure dune with custom locations before building it? I know it might happen in that case.

You can also try to pass --prefix=usr/local instead of passing all paths individually. Paths that occur after this option override the prefix path. E.g. --prefix=usr/local --libexecdir=/my/custom/path/to/override/usr/local/libexec

@bentxt
Copy link
Author

bentxt commented May 30, 2023

You can also try to pass --prefix=usr/local

This works thanks

@bentxt bentxt closed this as completed May 30, 2023
@Alizter Alizter reopened this May 30, 2023
@Alizter
Copy link
Collaborator

Alizter commented May 30, 2023

i think the error message can be improved in this situation so reope ing the issue. Ideally we should suggest the prefix option before mandor.

Alizter added a commit to Alizter/dune that referenced this issue May 31, 2023
When a user has not set --prefix they will get a confusing error message
about mandir. The suggestion here is to also set --mandir leading them
down a rabbit hole of specifying a complete install layout. What they
probably want to be doing is speciying --prefix so we change the error
message here to suggest that instead.

fix ocaml#7814

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

bentxt commented May 31, 2023

Just a note: It seems like the problems I had with dune asking for all this directories was due to lacking Opam initialization.

Now that the Opam init script is invoked during shell initialization, those problems are solved for me.

I wrote also small tip about it in the ocaml forum: https://discuss.ocaml.org/t/tipp-if-opam-gives-you-grief-check-your-init-ba-fi-c-sh-file/12265

@Alizter
Copy link
Collaborator

Alizter commented May 31, 2023

Yes, that probably explains why we don't see this issue so often in the wild. However I have seen and been confused by this message before and I do not use opam so at least we can improve this.

Alizter added a commit to Alizter/dune that referenced this issue Jun 8, 2023
When a user has not set --prefix they will get a confusing error message
about mandir. The suggestion here is to also set --mandir leading them
down a rabbit hole of specifying a complete install layout. What they
probably want to be doing is speciying --prefix so we change the error
message here to suggest that instead.

fix ocaml#7814

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Alizter added a commit to Alizter/dune that referenced this issue Jun 10, 2023
When a user has not set --prefix they will get a confusing error message
about mandir. The suggestion here is to also set --mandir leading them
down a rabbit hole of specifying a complete install layout. What they
probably want to be doing is speciying --prefix so we change the error
message here to suggest that instead.

fix ocaml#7814

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Alizter added a commit to Alizter/dune that referenced this issue Jun 13, 2023
When a user has not set --prefix they will get a confusing error message
about mandir. The suggestion here is to also set --mandir leading them
down a rabbit hole of specifying a complete install layout. What they
probably want to be doing is speciying --prefix so we change the error
message here to suggest that instead.

fix ocaml#7814

Signed-off-by: Ali Caglayan <alizter@gmail.com>
rgrinberg pushed a commit that referenced this issue Jun 19, 2023
When a user has not set --prefix they will get a confusing error message
about mandir. The suggestion here is to also set --mandir leading them
down a rabbit hole of specifying a complete install layout. What they
probably want to be doing is speciying --prefix so we change the error
message here to suggest that instead.

fix #7814

Signed-off-by: Ali Caglayan <alizter@gmail.com>
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 a pull request may close this issue.

3 participants