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

Manpage references main.exe.conf #90

Open
ydirson opened this issue Mar 27, 2023 · 1 comment
Open

Manpage references main.exe.conf #90

ydirson opened this issue Mar 27, 2023 · 1 comment

Comments

@ydirson
Copy link

ydirson commented Mar 27, 2023

Apparently the build produces a main.exe binary which will later be renamed to xapi-storage-script, and that original build artifact is run as main.exe --help=groff to produce the manpage. However, at least the default config file name appears to be derived from argv[0], as the install manpage reads:

OPTIONS
       --config=VAL (absent=/etc/main.exe.conf)
           Location of configuration file
@edwintorok
Copy link
Contributor

edwintorok commented Mar 27, 2023

Hmm, 'dune' only allows to run executables through their private, not their public name.
One fix might be to rename the private name to match the public one, although that'd require renaming 'main.ml' (not just for xapi-storage-script, but in general).

Actually you can run via the public name if you use 'dune exec ' without ./ in front. Except not for 'xapi-storage-script' because that uses 'install' rules instead of defining a public name.

Can you try whether something like this would work (although might now install the file under 2 names, both bin/ and sbin/):

diff --git a/ocaml/xapi-storage-script/dune b/ocaml/xapi-storage-script/dune
index c319e0b45..7ebfb1287 100644
--- a/ocaml/xapi-storage-script/dune
+++ b/ocaml/xapi-storage-script/dune
@@ -1,5 +1,7 @@
 (executable
   (name main)
+  (public_name xapi-storage-script)
+  (package xapi-storage-script)
   (libraries
     async
     async_inotify
@@ -44,7 +46,7 @@
   (targets xapi-storage-script.8)
   (package xapi-storage-script)
   (deps
-    (:x main.exe)
+    (:x %{bin:xapi-storage-script})
   )
   (action (with-stdout-to %{targets} (run %{x} --help=groff)))

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

No branches or pull requests

2 participants