Ticket #1837 (closed bug: fixed)

Opened 6 years ago

Last modified 4 years ago

ghc-pkg should not accept unversioned depends

Reported by: duncan Owned by: igloo
Priority: normal Milestone: 6.8.2
Component: Build System Version: 6.8.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Historically ghc-pkg accepted a format where the "depends:" field did not require version numbers. Then ghc would just resolve it to some installed version. However now that ghc bakes in the version number to libraries when it compiles them it really crucial that a package gets linked with exactly the versions of packages it was built against. Allowing ghc-pkg to accept unversioned depends and resolving them to some random installed version is just asking for trouble.

It's not too serious since Cabal always uses versioned depends, however I just noticed that older autoconf/automake build systems do not.

So, in summary allowing undersioned depends is just asking for trouble and ghc-pkg should reject them.

Change History

Changed 6 years ago by simonmar

  • owner set to simonmar
  • milestone set to 6.8.2

In the past this was to make our lives easier in the GHC build system, but now that we use Cabal for building libraries it isn't necessary. Let's remove it in 6.10, and give a deprecated warning in 6.8.2.

Changed 6 years ago by simonmar

  • owner changed from simonmar to igloo
  • type changed from bug to merge

To merge into 6.8:

Wed Nov 14 15:30:10 GMT 2007  Simon Marlow <simonmar@microsoft.com>
  * FIX #1837: emit deprecated message for unversioned dependencies

I've also removed unversioned dependencies completely in the HEAD.

Changed 6 years ago by igloo

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

Merged

Changed 5 years ago by simonmar

  • architecture changed from Multiple to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Multiple to Unknown/Multiple

Changed 5 years ago by duncan

  • status changed from closed to reopened
  • type changed from merge to bug
  • resolution fixed deleted

It seems there is a regression here. See #2705. Apparently unversionend dependencies are silently allowed.

It might be that's because "foo" gets parsed as a package id as PackageId "foo" (Version [] []), ie an empty version.

Changed 5 years ago by igloo

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

Looks like when the warning was removed, the test was too. I've reinstated it.

Changed 4 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.