iostreamer-X / FuncShell

Improve your shell by making it functional through Haskell! (An update to Awkward)
MIT License
290 stars 8 forks source link

Error: Can't parse "/usr/lib/ghc/platformConstants" #3

Open myuon opened 7 years ago

myuon commented 7 years ago

I got an error message when using fsh: fsh: Can't parse "/usr/lib/ghc/platformConstants"

Running on Ubuntu with ghc-8.0.2 installed by stack, but I also have ghc-8.0.2 installed by binary package which is not located in my path (this may cause a problem?).

Thanks in advance.

iostreamer-X commented 7 years ago

I am not sure what the problem is. I have ghc-7.10.3 which I installed through the ubuntu repositories.

Can you check if you have that file? screenshot from 2017-05-02 10 19 19

myuon commented 7 years ago

I have the file, here is the content:

PlatformConstants {
    pc_platformConstants = ()
    , pc_CONTROL_GROUP_CONST_291 = 291
    , pc_STD_HDR_SIZE = 1
    , pc_PROF_HDR_SIZE = 2
    , pc_BLOCK_SIZE = 4096
    , pc_BLOCKS_PER_MBLOCK = 252
    , pc_TICKY_BIN_COUNT = 9
    , pc_OFFSET_StgRegTable_rR1 = 0
    , pc_OFFSET_StgRegTable_rR2 = 8
    , pc_OFFSET_StgRegTable_rR3 = 16
    , pc_OFFSET_StgRegTable_rR4 = 24
    , pc_OFFSET_StgRegTable_rR5 = 32
    , pc_OFFSET_StgRegTable_rR6 = 40
    , pc_OFFSET_StgRegTable_rR7 = 48
    , pc_OFFSET_StgRegTable_rR8 = 56
    , pc_OFFSET_StgRegTable_rR9 = 64
    , pc_OFFSET_StgRegTable_rR10 = 72
    , pc_OFFSET_StgRegTable_rF1 = 80
    , pc_OFFSET_StgRegTable_rF2 = 84
    , pc_OFFSET_StgRegTable_rF3 = 88
    , pc_OFFSET_StgRegTable_rF4 = 92
    , pc_OFFSET_StgRegTable_rF5 = 96
    , pc_OFFSET_StgRegTable_rF6 = 100
    , pc_OFFSET_StgRegTable_rD1 = 104
    , pc_OFFSET_StgRegTable_rD2 = 112
    , pc_OFFSET_StgRegTable_rD3 = 120
    , pc_OFFSET_StgRegTable_rD4 = 128
    , pc_OFFSET_StgRegTable_rD5 = 136
    , pc_OFFSET_StgRegTable_rD6 = 144
    , pc_OFFSET_StgRegTable_rXMM1 = 152
    , pc_OFFSET_StgRegTable_rXMM2 = 168
    , pc_OFFSET_StgRegTable_rXMM3 = 184
    , pc_OFFSET_StgRegTable_rXMM4 = 200
    , pc_OFFSET_StgRegTable_rXMM5 = 216
    , pc_OFFSET_StgRegTable_rXMM6 = 232
    , pc_OFFSET_StgRegTable_rYMM1 = 248
    , pc_OFFSET_StgRegTable_rYMM2 = 280
    , pc_OFFSET_StgRegTable_rYMM3 = 312
    , pc_OFFSET_StgRegTable_rYMM4 = 344
    , pc_OFFSET_StgRegTable_rYMM5 = 376
    , pc_OFFSET_StgRegTable_rYMM6 = 408
    , pc_OFFSET_StgRegTable_rZMM1 = 440
    , pc_OFFSET_StgRegTable_rZMM2 = 504
    , pc_OFFSET_StgRegTable_rZMM3 = 568
    , pc_OFFSET_StgRegTable_rZMM4 = 632
    , pc_OFFSET_StgRegTable_rZMM5 = 696
    , pc_OFFSET_StgRegTable_rZMM6 = 760
    , pc_OFFSET_StgRegTable_rL1 = 824
    , pc_OFFSET_StgRegTable_rSp = 832
    , pc_OFFSET_StgRegTable_rSpLim = 840
    , pc_OFFSET_StgRegTable_rHp = 848
    , pc_OFFSET_StgRegTable_rHpLim = 856
    , pc_OFFSET_StgRegTable_rCCCS = 864
    , pc_OFFSET_StgRegTable_rCurrentTSO = 872
    , pc_OFFSET_StgRegTable_rCurrentNursery = 888
    , pc_OFFSET_StgRegTable_rHpAlloc = 904
    , pc_OFFSET_stgEagerBlackholeInfo = -24
    , pc_OFFSET_stgGCEnter1 = -16
    , pc_OFFSET_stgGCFun = -8
    , pc_OFFSET_Capability_r = 24
    , pc_OFFSET_bdescr_start = 0
    , pc_OFFSET_bdescr_free = 8
    , pc_OFFSET_bdescr_blocks = 48
    , pc_SIZEOF_CostCentreStack = 96
    , pc_OFFSET_CostCentreStack_mem_alloc = 72
    , pc_REP_CostCentreStack_mem_alloc = 8
    , pc_OFFSET_CostCentreStack_scc_count = 48
    , pc_REP_CostCentreStack_scc_count = 8
    , pc_OFFSET_StgHeader_ccs = 8
    , pc_OFFSET_StgHeader_ldvw = 16
    , pc_SIZEOF_StgSMPThunkHeader = 8
    , pc_OFFSET_StgEntCounter_allocs = 48
    , pc_REP_StgEntCounter_allocs = 8
    , pc_OFFSET_StgEntCounter_allocd = 16
    , pc_REP_StgEntCounter_allocd = 8
    , pc_OFFSET_StgEntCounter_registeredp = 0
    , pc_OFFSET_StgEntCounter_link = 56
    , pc_OFFSET_StgEntCounter_entry_count = 40
    , pc_SIZEOF_StgUpdateFrame_NoHdr = 8
    , pc_SIZEOF_StgMutArrPtrs_NoHdr = 16
    , pc_OFFSET_StgMutArrPtrs_ptrs = 0
    , pc_OFFSET_StgMutArrPtrs_size = 8
    , pc_SIZEOF_StgSmallMutArrPtrs_NoHdr = 8
    , pc_OFFSET_StgSmallMutArrPtrs_ptrs = 0
    , pc_SIZEOF_StgArrBytes_NoHdr = 8
    , pc_OFFSET_StgArrBytes_bytes = 0
    , pc_OFFSET_StgTSO_alloc_limit = 96
    , pc_OFFSET_StgTSO_cccs = 112
    , pc_OFFSET_StgTSO_stackobj = 16
    , pc_OFFSET_StgStack_sp = 8
    , pc_OFFSET_StgStack_stack = 16
    , pc_OFFSET_StgUpdateFrame_updatee = 0
    , pc_OFFSET_StgFunInfoExtraFwd_arity = 4
    , pc_REP_StgFunInfoExtraFwd_arity = 4
    , pc_SIZEOF_StgFunInfoExtraRev = 32
    , pc_OFFSET_StgFunInfoExtraRev_arity = 28
    , pc_REP_StgFunInfoExtraRev_arity = 4
    , pc_MAX_SPEC_SELECTEE_SIZE = 15
    , pc_MAX_SPEC_AP_SIZE = 7
    , pc_MIN_PAYLOAD_SIZE = 1
    , pc_MIN_INTLIKE = -16
    , pc_MAX_INTLIKE = 16
    , pc_MIN_CHARLIKE = 0
    , pc_MAX_CHARLIKE = 255
    , pc_MUT_ARR_PTRS_CARD_BITS = 7
    , pc_MAX_Vanilla_REG = 10
    , pc_MAX_Float_REG = 6
    , pc_MAX_Double_REG = 6
    , pc_MAX_Long_REG = 1
    , pc_MAX_XMM_REG = 6
    , pc_MAX_Real_Vanilla_REG = 6
    , pc_MAX_Real_Float_REG = 6
    , pc_MAX_Real_Double_REG = 6
    , pc_MAX_Real_XMM_REG = 6
    , pc_MAX_Real_Long_REG = 0
    , pc_RESERVED_C_STACK_BYTES = 16384
    , pc_RESERVED_STACK_WORDS = 21
    , pc_AP_STACK_SPLIM = 1024
    , pc_WORD_SIZE = 8
    , pc_DOUBLE_SIZE = 8
    , pc_CINT_SIZE = 4
    , pc_CLONG_SIZE = 8
    , pc_CLONG_LONG_SIZE = 8
    , pc_BITMAP_BITS_SHIFT = 6
    , pc_TAG_BITS = 3
    , pc_WORDS_BIGENDIAN = False
    , pc_DYNAMIC_BY_DEFAULT = False
    , pc_LDV_SHIFT = 30
    , pc_ILDV_CREATE_MASK = 1152921503533105152
    , pc_ILDV_STATE_CREATE = 0
    , pc_ILDV_STATE_USE = 1152921504606846976
  }

Is there any difference from your one?

iostreamer-X commented 7 years ago

I think so

diff --git a/test b/usr/lib/ghc/platformConstants
index 9cf355d..4071af9 100644
--- a/test
+++ b/usr/lib/ghc/platformConstants
@@ -1,11 +1,9 @@
 PlatformConstants {
     pc_platformConstants = ()
-    , pc_CONTROL_GROUP_CONST_291 = 291
     , pc_STD_HDR_SIZE = 1
     , pc_PROF_HDR_SIZE = 2
     , pc_BLOCK_SIZE = 4096
     , pc_BLOCKS_PER_MBLOCK = 252
-    , pc_TICKY_BIN_COUNT = 9
     , pc_OFFSET_StgRegTable_rR1 = 0
     , pc_OFFSET_StgRegTable_rR2 = 8
     , pc_OFFSET_StgRegTable_rR3 = 16
@@ -83,8 +81,8 @@ PlatformConstants {
     , pc_OFFSET_StgMutArrPtrs_size = 8
     , pc_SIZEOF_StgSmallMutArrPtrs_NoHdr = 8
     , pc_OFFSET_StgSmallMutArrPtrs_ptrs = 0
-    , pc_SIZEOF_StgArrBytes_NoHdr = 8
-    , pc_OFFSET_StgArrBytes_bytes = 0
+    , pc_SIZEOF_StgArrWords_NoHdr = 8
+    , pc_OFFSET_StgArrWords_bytes = 0
     , pc_OFFSET_StgTSO_alloc_limit = 96
     , pc_OFFSET_StgTSO_cccs = 112
     , pc_OFFSET_StgTSO_stackobj = 16
myuon commented 7 years ago

Here is what I did.

After applying the patch, I got another error: fsh: No entry for "readelf command" in "/usr/lib/ghc/settings", so I added a line ("readelf command", "readelf") to settings file.

Then, fsh said: fsh: /usr/lib/ghc/package.conf.d/package.cache: GHC.PackageDb.readPackageDb: inappropriate type (Not a valid Unicode code point!)

I guess this is a ghc-8 issue, but just googling, I cannot get enough information about this error.

-- Anyways, I built fsh using stack and it worked. Now I use it. I am glad to share my information or help to fix this problem, though. Thanks.

iostreamer-X commented 7 years ago

That's so nice and I appreciate your eagerness to help.

iostreamer-X commented 7 years ago

Might wanna look into this #4