koka-lang / koka

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

[homebrew] regression build only failed with macos 12 intel build #435

Open chenrui333 opened 5 months ago

chenrui333 commented 5 months ago

👋 while trying to upgrade koka to the latest release, 3.0.1, we ran into some regression test failure as below

    Minitest::Assertion: Expected /420000/ to match "\e]4;0;?\e\\\e[6ncompile: /usr/local/Cellar/koka/3.0.1/share/koka/v3.0.1/lib/samples/basic/rbtree.kk
    loading: std/core
    loading: std/core/types
    loading: std/core/hnd
    compile: /usr/local/Cellar/koka/3.0.1/share/koka/v3.0.1/lib/std/core/hnd.kk
    check  : std/core/hnd
    compile: /usr/local/Cellar/koka/3.0.1/share/koka/v3.0.1/lib/std/core.kk
    check  : std/core
    loading: std/os/env
    loading: std/os/path
    loading: std/text/parse
    compile: /usr/local/Cellar/koka/3.0.1/share/koka/v3.0.1/lib/std/text/parse.kk
    check  : std/text/parse
    compile: /usr/local/Cellar/koka/3.0.1/share/koka/v3.0.1/lib/std/os/path.kk
    check  : std/os/path
    compile: /usr/local/Cellar/koka/3.0.1/share/koka/v3.0.1/lib/std/os/env.kk
    check  : std/os/env
    check  : samples/basic/rbtree
    linking: samples_basic_rbtree
    created: /private/tmp/.koka/v3.0.1/clang-drelease/samples_basic_rbtree

    failure during program run:

       \"/private/tmp/.koka/v3.0.1/clang-drelease/samples_basic_rbtree\" 

    ".

The same regression test works fine for the other environments:

    (testpath/"hellobrew.kk").write('pub fun main() println("Hello Homebrew")')
    assert_match "Hello Homebrew", shell_output("#{bin}/koka -e hellobrew.kk")
    assert_match "420000", shell_output("#{bin}/koka -O2 -e samples/basic/rbtree")

Full build log, https://github.com/Homebrew/homebrew-core/actions/runs/7546799685/job/20545498099?pr=159906 relates to https://github.com/Homebrew/homebrew-core/pull/159906

TimWhiting commented 5 months ago

Interesting. I'm not sure what would have caused this. I can confirm it works fine on MacOS 14 (Intel).

chenrui333 commented 5 months ago

yeah, it is a bit funny, it only applies to 12 build

daanx commented 5 months ago

Hmm, I don't have a macos 12 Intel build to try on .. can you try running this in the interactive prompt and see if you can see more information? Like:

$ koka
> :l samples/basic/rbtree
> main()

or maybe stack exec koka if you built it from scratch. Thanks for the heads up. (I am guessing some header file is missing or the compiler is an older clang that does not support atomics -- although weird that it worked before...)

TimWhiting commented 1 month ago

@kuchta

The issue you noticed with homebrew not being updated is related to this issue: which I'm not sure whether is fixed or not, since I can't reproduce locally.

Using the vscode extension you can just search for the command to update the version, which will do the install command for you. Additionally, updating the extension should prompt you to download if the version the extension knows about is newer than your current version, and you haven't told it to not prompt for installing.

kuchta commented 1 month ago

@TimWhiting Thank you, Tim. Very nice job with extension letting me update it directly 👍