darcs

Patch 2391 make execution of release/gen-version-info.hs more robust

Title make execution of release/gen-version-info.hs more robust
Superseder Nosy List bfrk
Related Issues
Status accepted Assigned To
Milestone

Created on 2024-05-19.13:12:15 by bfrk, last changed 2024-05-26.07:30:06 by bfrk.

Files
File name Status Uploaded Type Edit Remove
make-execution-of-release_gen_version_info_hs-more-robust.dpatch bfrk, 2024-05-19.13:12:15 application/x-darcs-patch
patch-preview.txt bfrk, 2024-05-19.13:12:15 text/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg23844 (view) Author: bfrk Date: 2024-05-19.13:12:15
Not yet for screened, but please take a look and tell me what you think.

1 patch for repository https://darcs.net/screened:

patch c755a7925a3509ccc2b92ab51ce3e4870a2a572d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun May 19 13:47:10 CEST 2024
  * make execution of release/gen-version-info.hs more robust

  Using cabal run instead of runghc inside of Setup.hs ensures that we use the
  same ghc version that cabal uses, avoiding dependency errors.
Attachments
msg23846 (view) Author: ganesh Date: 2024-05-19.13:48:53
What would happen if the user had passed `--with-compiler` to their
"outer" cabal invocation? I don't think we'd inherit it, would we?
msg23848 (view) Author: bfrk Date: 2024-05-19.14:12:37
Ha, that's precisely what prompted me to try this. I ran into this problem:

ben@home[1]:.../darcs/screened>cabal build -w ghc-9.6
Build profile: -w ghc-9.6.2 -O1
In order, the following will be built (use -v for more details):
 - darcs-2.19.1 (lib:darcs, exe:darcs, test:darcs-test) (first run)

/home/ben/src/darcs/screened/release/gen-version-info.hs:7:1: error:
    Could not load module ‘System.Process’
    It is a member of the hidden package ‘process-1.6.5.0’.
    Perhaps you need to add ‘process’ to the build-depends in your .cabal file.
    It is a member of the hidden package ‘process-1.6.20.0’.
    Perhaps you need to add ‘process’ to the build-depends in your .cabal file.
    It is a member of the hidden package ‘process-1.6.20.0’.
    Perhaps you need to add ‘process’ to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.
  |
7 | import System.Process ( readProcess )
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
callProcess: cabal "run" "./release/gen-version-info.hs" (exit 1): failed
Error: cabal: Failed to build darcs-2.19.1.

But with this patch applied it worked.
msg23849 (view) Author: bfrk Date: 2024-05-19.14:16:07
This may have been after I manually deleted some of the ~/.cabal/store 
subdirectories, so perhaps not easily reproducable.
msg23850 (view) Author: ganesh Date: 2024-05-19.14:18:05
Interesting. Maybe it's passing on state via environment variables?

Anyway, no objections if it makes things better. Hopefully longer-term
we can replace it with hooks.
msg23905 (view) Author: bfrk Date: 2024-05-26.07:25:24
Self-accepting this one so it can go into 2.18.3. It has repeatedly 
proved useful (at least to me) and works with both stack and cabal.
History
Date User Action Args
2024-05-19 13:12:15bfrkcreate
2024-05-19 13:48:53ganeshsetmessages: + msg23846
2024-05-19 14:12:37bfrksetmessages: + msg23848
2024-05-19 14:16:07bfrksetmessages: + msg23849
2024-05-19 14:18:06ganeshsetmessages: + msg23850
2024-05-26 07:25:25bfrksetstatus: needs-screening -> accepted-pending-tests
messages: + msg23905
2024-05-26 07:30:06bfrksetstatus: accepted-pending-tests -> accepted