darcs

Issue 2635 executable flag and errors with darcs.1

Title executable flag and errors with darcs.1
Priority Status resolved
Milestone 2.15.0 Resolved in
Superseder Nosy List ganesh
Assigned To
Topics

Created on 2019-09-19.11:20:21 by ganesh, last changed 2020-06-20.09:38:38 by bfrk.

Messages
msg21455 (view) Author: ganesh Date: 2019-09-19.11:20:20
Building/copying darcs.1 goes wrong sometimes, leading to a build error like

`dist/build/darcs/darcs.1: openFile: does not exist (No such file or
directory)`

One cause is that the 'executable' flag in darcs.cabal can be set to
False automatically when the user didn't intend that.

http://bugs.darcs.net/msg20650
https://github.com/NixOS/nixpkgs/issues/53433#issuecomment-458026410
msg21466 (view) Author: bfrk Date: 2019-09-19.16:04:22
To reproduce:

> rm -rf
./dist-newstyle/build/x86_64-linux/ghc-8.6.5/darcs-2.15.2/build/darcs
> # make a small change to src/Darcs/UI/Commands/Help.hs
> cabal new-build -f-executable
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - darcs-2.15.2 (lib:darcs, test:darcs-test) (file
src/Darcs/UI/Commands/Help.hs changed)
Preprocessing library for darcs-2.15.2..
Building library for darcs-2.15.2..
[235 of 235] Compiling Darcs.UI.Commands.Help (
src/Darcs/UI/Commands/Help.hs,
/home/franksen/src/darcs/clean/dist-newstyle/build/x86_64-linux/ghc-8.6.5/darcs-2.15.2/build/Darcs/UI/Commands/Help.o
)
Preprocessing test suite 'darcs-test' for darcs-2.15.2..
Building test suite 'darcs-test' for darcs-2.15.2..
/home/franksen/src/darcs/clean/dist-newstyle/build/x86_64-linux/ghc-8.6.5/darcs-2.15.2/build/darcs/darcs.1:
openFile: does not exist (No such file or directory)

Setup.hs contains

buildManpage lbi = do
  let darcs = buildDir lbi </> "darcs/darcs"
      manpage = buildDir lbi </> "darcs/darcs.1"
  manpageHandle <- openFile manpage WriteMode
  void $ runProcess darcs ["help","manpage"]
             Nothing Nothing Nothing (Just manpageHandle) Nothing

So we build it as darcs/darcs.1 but with -f-executable the directory
dist-newstyle/build/x86_64-linux/ghc-8.6.5/darcs-2.15.2/build/darcs
doesn't exist.

The clean solution is to build the man page only if we build the
executable. We must find out how to do that.
msg21469 (view) Author: ganesh Date: 2019-09-19.16:57:22
> The clean solution is to build the man page only if we build the
> executable. We must find out how to do that.

That's a good point. I actually raised this with the intention of
resolving it with a patch that just makes 'executable' a manual
flag, but you're right it's not a complete solution. But I think
it makes sense to do that for now, particularly for the 2.14 branch
to help with the problems people have already encountered.

I would still rather get rid of the manpage building from our cabal
configuration and do it elsewhere. But failing that, or in the 
meantime, tying it to building the executable would make sense.
msg21471 (view) Author: ganesh Date: 2019-09-19.17:09:33
I've opened issue2636 to actually deal with the executable flag problem
and we can keep this one open for future action.
msg22048 (view) Author: bfrk Date: 2020-06-20.09:38:35
I can't be bother to search for teh patch that fixes this but i know 
it is fixed.
History
Date User Action Args
2019-09-19 11:20:21ganeshcreate
2019-09-19 11:20:48ganeshsetmilestone: 2.14.2 -> 2.14.3
2019-09-19 16:04:24bfrksetmessages: + msg21466
2019-09-19 16:57:24ganeshsetmessages: + msg21469
2019-09-19 17:09:35ganeshsetmessages: + msg21471
milestone: 2.14.3 -> 2.15.0
2020-06-20 09:38:38bfrksetstatus: unknown -> resolved
messages: + msg22048