koka-lang / koka

Koka language compiler and interpreter
http://koka-lang.org
Other
3.16k stars 153 forks source link

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

Open LittleJianCH opened 1 year ago

LittleJianCH commented 1 year ago

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.

tomsib2001 commented 11 months ago

Same issue on Koka 2.4.2, Ubuntu 20.04

JanBeh commented 11 months ago

Same with Koka 2.4.2 on FreeBSD 13.2

TimWhiting commented 6 months ago

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

LittleJianCH commented 6 months ago

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

TimWhiting commented 6 months ago

Maybe this is related to #283?

Were the files written to the tmp directory?