Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#10636 closed task (fixed)

Clear up difference between `WayDyn` and `Opt_Static`

Reported by: thomie Owned by: thomie
Priority: normal Milestone: 8.0.1
Component: Compiler Version: 7.10.1
Keywords: Cc: simonmar
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

There are currently 2 different ways to test for a static or dynamic build:

  1. Test if WayDyn is in ways
  2. Test if Opt_Static is set

Unless there's a use-case for setting WayDyn/Opt_Static inconsistently (if so, please add a Note somewhere), it should be possible to replace all queries of Opt_Static with an equivalent query of WayDyn. That would have prevented bug #8294.

See the comments in Phab:D1017.

Change History (6)

comment:1 Changed 4 years ago by thomie

Owner: set to thomie

Also (partially) causes #11154.

This needs fixing.

Last edited 4 years ago by thomie (previous) (diff)

comment:2 Changed 4 years ago by bgamari

Cc: simonmar added

Simon, perhaps you could shed some light why these two exist? I would imagine it is a historical accident but it would be good to know this for certain.

comment:3 Changed 4 years ago by Ben Gamari <ben@…>

In 6d9c18cb/ghc:

DynFlags: remove Opt_Static

There are currently 2 different ways to test for a static or dynamic
build:

    * Test if WayDyn is in ways
    * Test if Opt_Static is set

The problem is that these can easily go out of sync, especially when
using the
GHC API.

This commit replaces all queries of Opt_Static with an equivalent query
of
WayDyn. This would have prevented bug #8294 and fixes #11154.

Reviewers: hvr, austin, bgamari

Reviewed By: austin, bgamari

Differential Revision: https://phabricator.haskell.org/D1607

GHC Trac Issues: #10636

comment:4 Changed 4 years ago by bgamari

Resolution: fixed
Status: newclosed

comment:5 Changed 4 years ago by simonmar

Simon, perhaps you could shed some light why these two exist? I would imagine it is a historical accident but it would be good to know this for certain.

I'm pretty sure it's a historical accident

comment:6 Changed 4 years ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.