Ticket #5992 (closed feature request: fixed)

Opened 15 months ago

Last modified 12 months ago

Silence gen_contents_index for the common case.

Reported by: td123 Owned by: td123
Priority: normal Milestone: 7.6.1
Component: Documentation Version: 7.4.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

The line: echo $HADDOCK_ARGS

From:  https://github.com/ghc/ghc/blob/master/libraries/gen_contents_index#L53

Was introduced in:  https://github.com/ghc/ghc/commit/2ad79aaa1b87164a0191e8f980f57a9fa0b80e0a

In archlinux (and other distros), gen_contents_index is run after installing a package using the distro's package manager to update the index file containing the list of libraries.

As a result of the commit, the output when installing a package can get very verbose.

Since the original intention of this change was to make it easier to debug crashes, I propose that there be a flag introduced into this script --verbose or --debug which would print out $HADDOCK_ARGS when specified so that the common case wouldn't include all the extra unneeded output.

I am willing to write a patch for this, if this idea is accepted.

Attachments

0001-Add-verbose-and-help-flags-to-gen_contents_index.patch Download (1.8 KB) - added by td123 12 months ago.
implements feature request, applies to ghc 7.4.2
0001-Add-verbose-and-help-flags-to-gen_contents_index.2.patch Download (1.9 KB) - added by td123 12 months ago.
implements feature request, applies to ghc HEAD

Change History

Changed 12 months ago by pcapriotti

  • owner set to td123
  • difficulty set to Unknown
  • milestone set to 7.6.1

Printing the haddock args only when a --verbose flag is specified seems a good idea. Please do submit a patch.

Changed 12 months ago by td123

implements feature request, applies to ghc 7.4.2

Changed 12 months ago by td123

implements feature request, applies to ghc HEAD

Changed 12 months ago by td123

Attached 2 patches, 1 for ghc 7.4.2 and 1 for ghc HEAD that implements this feature request.

I had to submit 2 patches since gen_contents_index differs in the 2 versions.

I looked into using getopts and getopt (gnu) both of which were not good. getopts only supports single character flags and getopt (gnu) wouldn't be supported on BSD and mac systems. So I implemented my own flag parser.

Also added a --help flag for user convenience since it seemed simple.

Changed 12 months ago by pcapriotti

  • status changed from new to closed
  • resolution set to fixed

Many thanks. Merged to HEAD as 2b3734853ae5ddb75f85bfcc4ab8842a9ba4b5e0, and stable as e1e68550026b83ba15158fa776f406844cccedd1.

Note: See TracTickets for help on using tickets.