HISE Logo Forum
    • Categories
    • Register
    • Login

    Compiling HISE with GitHub Actions

    Scheduled Pinned Locked Moved General Questions
    16 Posts 5 Posters 556 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dannytaurusD
      dannytaurus
      last edited by dannytaurus

      After a hilariously long (2h35m) compile on my 2020 M1 MacBook Air I decided to try compiling HISE using GitHub Actions.

      It works fine. It takes 10-15 mins but at least it 100% reliable (compiling on my MacBook would sometimes crash the whole machine) and doesn't freeze my computer while it's working.

      The only strange thing is, the compiled app is about twice the size of a locally compiled app.

      HISE compiled on MacBook = 194MB
      HISE compiled on GitHub = 385MB

      EDIT Both are debug versions. MacBook version built with Xcode Product > Build For > Running. GitHub version built with Debug configuration flag. /EDIT

      What's the reason for this? And is it any thing to worry about?

      EDIT - [SOLVED] The reason for the double size app is that the GitHub version is building a universal binary, whereas on my Mac I'm building only for 'My Mac' (only Apple Silicon). /EDIT

      Here are my workflow files and bash files, both adapted from the original HISE files.

      // .github/workflows/build_mac.yml
      
      name: Build Mac
      on:
        workflow_dispatch:
        push:
          branches:
            - develop
      jobs:
        build_mac:
          runs-on: macos-latest
          steps:
            - name: Check Xcode version
              run: |
                xcodebuild -version
                xcode-select -p
            - name: Checkout HISE repository
              uses: actions/checkout@v4
              with:
                ref: 'develop'
            - name: Build & Upload HISE Debug.app
              working-directory: ${{ github.workspace }}/tools/auto_build/
              run: sh ./build_mac.sh
            - name: Upload HISE Debug.app
              uses: actions/upload-artifact@v4
              with:
                name: "HISE Debug.app"
                path: "${{ github.workspace }}/projects/standalone/Builds/MacOSX/build/Debug/HISE Debug.app"
      
      
      // tools/auto_build/build_mac.sh
      
      #!/bin/bash
      set -e
      
      cd "$(dirname "$0")"
      cd ../..
      
      standalone_folder="projects/standalone"
      
      chmod +x "tools/Projucer/Projucer.app/Contents/MacOS/Projucer"
      
      "tools/Projucer/Projucer.app/Contents/MacOS/Projucer" --resave "projects/standalone/HISE Standalone.jucer"
      
      echo "Compiling Standalone App..."
      
      xcodebuild -project "$standalone_folder/Builds/MacOSX/HISE Standalone.xcodeproj" -configuration Debug | xcpretty
      
      echo "Build completed successfully"
      
      # Check if the app exists at the right path
      app_path="projects/standalone/Builds/MacOSX/build/Debug/HISE Debug.app"
      
      if [ -d "$app_path" ]; then
        echo "HISE Debug.app is ready for upload at $app_path"
      else
        echo "Error: Built app not found"
        exit 1
      fi
      

      Meat Beats: https://meatbeats.com
      Klippr Video: https://klippr.video

      Dan KorneffD ustkU 2 Replies Last reply Reply Quote 0
      • Dan KorneffD
        Dan Korneff @dannytaurus
        last edited by

        @dannytaurus you've built the debug version which contains extra data

        Dan Korneff - Producer / Mixer / Audio Nerd

        dannytaurusD 1 Reply Last reply Reply Quote 0
        • dannytaurusD
          dannytaurus @Dan Korneff
          last edited by

          @Dan-Korneff said in Compiling HISE with GitHub Actions:

          @dannytaurus you've built the debug version which contains extra data

          Sorry, I should've been more clear - it was the debug version for both.

          Edited the original post 馃憤

          Meat Beats: https://meatbeats.com
          Klippr Video: https://klippr.video

          Christoph HartC 1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart @dannytaurus
            last edited by

            @dannytaurus maybe the github action built a universal binary?

            dannytaurusD 2 Replies Last reply Reply Quote 1
            • dannytaurusD
              dannytaurus @Christoph Hart
              last edited by

              @Christoph-Hart said in Compiling HISE with GitHub Actions:

              @dannytaurus maybe the github action built a universal binary?

              Ah, that's probably it! My Xcode is set up to build for 'My Mac' and not 'Any Mac'.

              Nothing to worry about then! 馃檶

              Meat Beats: https://meatbeats.com
              Klippr Video: https://klippr.video

              Christoph HartC 1 Reply Last reply Reply Quote 0
              • Christoph HartC
                Christoph Hart @dannytaurus
                last edited by

                @dannytaurus but

                1. why do you build the debug build?
                2. Does compiling a plugin also takes hours on your MacBook?
                dannytaurusD 1 Reply Last reply Reply Quote 0
                • dannytaurusD
                  dannytaurus @Christoph Hart
                  last edited by dannytaurus

                  @Christoph-Hart said in Compiling HISE with GitHub Actions:

                  @dannytaurus but

                  1. why do you build the debug build?
                  2. Does compiling a plugin also takes hours on your MacBook?
                  1. Because I was told it was quicker to build.
                  2. No, exporting an AU plugin from the HISE Export menu takes a few minutes (if that's what you mean)

                  To be fair I haven't tried a release build on my MacBook but I can't imagine it would be quicker. Still worth a try though.

                  Meat Beats: https://meatbeats.com
                  Klippr Video: https://klippr.video

                  1 Reply Last reply Reply Quote 0
                  • ustkU
                    ustk @dannytaurus
                    last edited by

                    @dannytaurus said in Compiling HISE with GitHub Actions:

                    After a hilariously long (2h35m) compile on my 2020 M1 MacBook Air

                    Very strange, it takes about 5min with my M3, and even my ol' 2013 intel iMac took around 25-30min

                    Can't help pressing F5 in the forum...

                    dannytaurusD 1 Reply Last reply Reply Quote 0
                    • dannytaurusD
                      dannytaurus @ustk
                      last edited by

                      @ustk said in Compiling HISE with GitHub Actions:

                      Very strange, it takes about 5min with my M3, and even my ol' 2013 intel iMac took around 25-30min

                      How much RAM does each machine have?

                      I only have 8GB RAM, which I think is a limiting factor.

                      In Activity Monitor it's maxed out in the red during compilation.

                      However, I ran couple of tests in Safe Mode and compilation time was around 15 mins so even if RAM is limiting there is definitely still something running in my normal setup that causes these crazy long compile times.

                      I will continue to investigate but for now I'm happy to compile on GitHub and download the app.

                      Meat Beats: https://meatbeats.com
                      Klippr Video: https://klippr.video

                      d.healeyD 1 Reply Last reply Reply Quote 0
                      • dannytaurusD
                        dannytaurus @Christoph Hart
                        last edited by dannytaurus

                        @Christoph-Hart said in Compiling HISE with GitHub Actions:

                        @dannytaurus maybe the github action built a universal binary?

                        Bingo! That was it.

                        I changed the build script to build arm64 only and now the downloaded app is the same size as locally compiled app.

                        Interestingly the build time didn't decrease that much on GitHub - 13 mins down to 11 mins, but I'll take it! 馃帀

                        Meat Beats: https://meatbeats.com
                        Klippr Video: https://klippr.video

                        1 Reply Last reply Reply Quote 0
                        • d.healeyD
                          d.healey @dannytaurus
                          last edited by

                          @dannytaurus said in Compiling HISE with GitHub Actions:

                          I only have 8GB RAM, which I think is a limiting factor.

                          Try reducing the number of threads/jobs you're using to build, try no more than 1 thread per GB of RAM.

                          Libre Wave - Freedom respecting instruments and effects
                          My Patreon - HISE tutorials
                          YouTube Channel - Public HISE tutorials

                          dannytaurusD 1 Reply Last reply Reply Quote 0
                          • dannytaurusD
                            dannytaurus @d.healey
                            last edited by dannytaurus

                            @d-healey said in Compiling HISE with GitHub Actions:

                            Try reducing the number of threads/jobs you're using to build, try no more than 1 thread per GB of RAM.

                            There are 8 clang threads running but combined they're using about 12GB RAM, causing a lot of swap.

                            I could try with fewer threads.

                            Meat Beats: https://meatbeats.com
                            Klippr Video: https://klippr.video

                            d.healeyD 1 Reply Last reply Reply Quote 0
                            • d.healeyD
                              d.healey @dannytaurus
                              last edited by

                              @dannytaurus said in Compiling HISE with GitHub Actions:

                              I could try with fewer threads.

                              Try 6 or 4 - this will free up RAM which might help, but using fewer threads might negate the gains.

                              Libre Wave - Freedom respecting instruments and effects
                              My Patreon - HISE tutorials
                              YouTube Channel - Public HISE tutorials

                              Christoph HartC dannytaurusD 2 Replies Last reply Reply Quote 0
                              • Christoph HartC
                                Christoph Hart @d.healey
                                last edited by

                                @d-healey I don鈥榯 think you can set the thread count on macOS this is a Linux only feature of GCC.

                                d.healeyD 1 Reply Last reply Reply Quote 0
                                • d.healeyD
                                  d.healey @Christoph Hart
                                  last edited by d.healey

                                  @Christoph-Hart said in Compiling HISE with GitHub Actions:

                                  I don鈥榯 think you can set the thread count on macOS this is a Linux only feature of GCC.

                                  You can set it with -jobs - as you are doing here :)

                                  Oops, according to git blame I added that 馃懠

                                  Link Preview Image
                                  HISE/hi_backend/backend/CompileExporter.cpp at develop 路 christophhart/HISE

                                  The open source framework for sample based instruments - HISE/hi_backend/backend/CompileExporter.cpp at develop 路 christophhart/HISE

                                  favicon

                                  GitHub (github.com)

                                  Libre Wave - Freedom respecting instruments and effects
                                  My Patreon - HISE tutorials
                                  YouTube Channel - Public HISE tutorials

                                  1 Reply Last reply Reply Quote 0
                                  • dannytaurusD
                                    dannytaurus @d.healey
                                    last edited by

                                    @d-healey said in Compiling HISE with GitHub Actions:

                                    Try 6 or 4 - this will free up RAM which might help, but using fewer threads might negate the gains.

                                    Yes, will do. I'm trying compiling with the script first, since you can't set jobs in the Xcode UI anyway.

                                    First I'll see how the script build compares to the Xcode UI build. Should be the same I'm guessing.

                                    Then I'll reduce the threads in the script to see what effect that has.

                                    Meat Beats: https://meatbeats.com
                                    Klippr Video: https://klippr.video

                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post

                                    16

                                    Online

                                    1.7k

                                    Users

                                    11.9k

                                    Topics

                                    103.4k

                                    Posts