Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#12000 closed feature request (invalid)

static pointer in ghci

Reported by: Iceland_jack Owned by:
Priority: normal Milestone:
Component: Documentation Version: 8.1
Keywords: StaticPointers Cc: facundo.dominguez
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #9878 Differential Rev(s):
Wiki Page:

Description

$ ghci -fobject-code -ignore-dot-ghci -XStaticPointers
GHCi, version 8.1.20160428: http://www.haskell.org/ghc/  :? for help
Prelude> a = static id
Prelude> a

<interactive>:2:1: error: Variable not in scope: a
Prelude> 

Change History (6)

comment:1 Changed 3 years ago by Iceland_jack

And

Prelude> let a = static id

ByteCodeLink.lookupCE
During interactive linking, GHCi couldn't find the following symbol:
  interactive_Ghci2_sptEntryZC2_closure
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session.  Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please send a bug report to:
  glasgow-haskell-bugs@haskell.org

comment:2 Changed 3 years ago by thomie

Cc: facundo.dominguez added
Component: CompilerDocumentation
Keywords: StaticPointers added
Type: bugfeature request

From ticket:9878#comment:2:

The current StaticPointers implementation is not intended to be supported in GHCi.

@facundo.dominguez (off-topic): StaticPointers is not listed in the flag reference of the User's Guide. You'd have to edit utils/mkUserGuidePart/Options/Language.hs to change that.

comment:3 Changed 3 years ago by facundo.dominguez

I'm testing the master branch of GHC.

I can reproduce this without using the static form.

Prelude> c = 'a'
Prelude> c

<interactive>:9:1: error: Variable not in scope: c

The crash reported later, I can't see.

> let a = static id
Prelude> a

<interactive>:6:1: error:
    • No instance for (Data.Typeable.Internal.Typeable a0)
        arising from a use of ‘it’
    • In a stmt of an interactive GHCi command: print it

That said, the static pointers produced in GHCi can only be found later if they are created in compiled (and later loaded) modules. Entering a static form at the prompt won't make it.

comment:4 Changed 3 years ago by thomie

I opened #12091 for the "Variable not in scope" issue, since it is not -XStaticPointers related.

Is there anything left to do here?

comment:5 Changed 3 years ago by facundo.dominguez

Resolution: invalid
Status: newclosed

Probably not. If the crash persisted after upgrading GHC, it would deserve another ticket.

comment:6 Changed 3 years ago by bgamari

That being said, I would really like for GHCi to properly support StaticPointers since I use this extension rather often in my recent day-to-day work. I've opened #12356 to track this.

Note: See TracTickets for help on using tickets.