Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,345
    • Issues 5,345
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 568
    • Merge requests 568
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #18955
Closed
Open
Issue created Nov 16, 2020 by Roland Senn@RolandSennDeveloper

GHCi ignores :set -fbyte-code command

Summary

When GHCi is started with -fobject-code, it ignores a :set -fbyte-code command.

Steps to reproduce

Take any Haskell module eg Foo.hs:

main :: IO ()
main = putStrLn "Hello World"

Then set to byte-codeand load the module:

$ ghc --interactive -fobject-code
GHCi, version 8.10.1: https://www.haskell.org/ghc/  :? for help
Prelude> :set -fbyte-code 
Prelude> :l Foo.hs
[1 of 1] Compiling Main             ( Foo.hs, Foo.o )
Ok, one module loaded.

The module is compiled to object code (Foo.o)

Expected behavior

The module should be compiled to interpreted byte-code as in GHC 8.8.4:

$ ghc --interactive -fobject-code
GHCi, version 8.8.4: https://www.haskell.org/ghc/  :? for help
Prelude> :set -fbyte-code 
Prelude> :l Foo.hs
[1 of 1] Compiling Main             ( Foo.hs, interpreted )
Ok, one module loaded.

Environment

  • GHC versions 8.10.1, 8.10.2 and HEAD contain the bug
  • GHC versions below eg 8.8.4, 8.8.3 etc work as expected

Optional:

  • Operating System: Debian 10
  • System Architecture: x86_64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking