Opened 6 years ago

Closed 5 years ago

#2051 closed feature request (fixed)

-hide-package doesn't allow hiding uninstalled package

Reported by: MagnusTherning Owned by:
Priority: normal Milestone: 6.12.1
Component: Compiler Version: 6.8.2
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

The following behaviour seems a bit too strict:

% ghc-pkg list dataenc
/usr/lib/ghc-6.8.2/package.conf:
% ghc --make -hide-package dataenc -isrc UT.hs
ghc-6.8.2 : unknown package: dataenc

Attachments (1)

ghc-hide-package-not-error-1.patch (638 bytes) - added by ajd 6 years ago.
Patch to GHC so that -hide-package does not raise an error if the package in question does not exist

Download all attachments as: .zip

Change History (6)

comment:1 follow-up: Changed 6 years ago by ajd

I wrote a patch to "fix" this but I'm not sure it ought to be the correct behavior. According to the comments around the function in question, -ignore-package already has this behavior because it's supposed to be used as a just-in-case thing, they way you are trying to use -hide-package. Anyway, I'm attaching the patch and I'll leave it up to the powers that be to decide what to do about it.

Changed 6 years ago by ajd

Patch to GHC so that -hide-package does not raise an error if the package in question does not exist

comment:2 in reply to: ↑ 1 Changed 6 years ago by MagnusTherning

Replying to ajd:

I wrote a patch to "fix" this but I'm not sure it ought to be the correct behavior. According to the comments around the function in question, -ignore-package already has this behavior because it's supposed to be used as a just-in-case thing, they way you are trying to use -hide-package. Anyway, I'm attaching the patch and I'll leave it up to the powers that be to decide what to do about it.

Well, I find that I have to hide packages regularly since it allows me to have a module installed while I'm hacking on the next version of it. Without it my unit/quickcheck tests link to the installed version one by default.

One option would be to keep the current behaviour as default, but allow overriding it e.g. by using '--force' (similar to how 'rm' has '-f').

comment:3 Changed 6 years ago by igloo

  • Difficulty set to Unknown
  • Milestone set to 6.10 branch

This just needs us to decide what the best behaviour is. I think we should at least warn if the package isn't installed, to catch people making typos.

comment:4 Changed 5 years ago by igloo

  • Milestone changed from 6.10 branch to 6.12.1

comment:5 Changed 5 years ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed

It looks like -ignore-package dataenc already does what you want, so I'm closing this ticket.

Note: See TracTickets for help on using tickets.