koka icon indicating copy to clipboard operation
koka copied to clipboard

The executable Koka complied doesn't get permission on arm-macOS

Open LittleJianCH opened this issue 3 years ago • 9 comments

For example, this is the example on the Koka website:

// A generator effect with one operation
effect yield<a>
  fun yield( x : a ) : ()

// Traverse a list and yield the elements
fun traverse( xs : list<a> ) : yield<a> () 
  match xs
    Cons(x,xx) -> { yield(x); traverse(xx) }
    Nil        -> ()

fun main() : console () 
  with fun yield(i : int)
    println("yielded " ++ i.show)   
  [1,2,3].traverse

Store it in main.kk and run the command koka main.kk -o main && ./main, you will get the message below:

compile: main.kk
loading: std/core
loading: std/core/types
loading: std/core/hnd
check  : main
linking: main
created: .koka/v2.4.0/clang-debug/main
created: main
zsh: permission denied: ./main

To run the executable, you have give the executable permission by running chmod +x ./main. I think this is a part of work the compiler should do.

My platform is M1 Pro MacBook.

LittleJianCH avatar Jan 29 '23 09:01 LittleJianCH

Same issue on Koka 2.4.2, Ubuntu 20.04

tomsib2001 avatar Aug 06 '23 09:08 tomsib2001

Same with Koka 2.4.2 on FreeBSD 13.2

JanBeh avatar Aug 06 '23 11:08 JanBeh

Is this still an issue? What permissions does the file have?

TimWhiting avatar Jan 04 '24 06:01 TimWhiting

I directly applied chmod -x to the compiled files in this pr(#324). It works well on my machine.

LittleJianCH avatar Jan 04 '24 07:01 LittleJianCH

Maybe this is related to #283?

Were the files written to the tmp directory?

TimWhiting avatar Jan 04 '24 14:01 TimWhiting