0

I try to update a mac-pipeline for an open source project. This project requires to build the dependencies over jhbuild.

Currently, it uses a binary blob, which contains the jhbuild env and all prebuild deps. I want to get rid of the blob, because it slows the release progress (we can't bump the mac version, since we can't generate a blob).

What I tried so far: The original version uninstalled brew every time, but this increased build time by 5 minutes, this is ok for a release, but not to validate PR's.

So I've tried, what the gnome-devs suggested, to create a new user. Creating the new user and executing the scripts with the new user worked. But the script failed with an error in "/Users/git-bin/.new_local/bin/pipenv"

I also tried to unlink all brew symbolic links, which took more than 7 minutes.

Is uninstalling brew the only way it works?

We use continuous-integration.yml:

trigger:
  branches:
    include:
      - '*'
    exclude:
      - stable
      - l10n_master
  paths:
    exclude:
      - po/xournalpp.pot
      - po/*.po


stages:
  - stage: 'Build_Test_Stage'
    jobs:
      - job: macOS
        pool:
          vmImage: 'macOS-10.15'
        displayName: 'Test Xournal++ on MacOS'
        steps:
          - template: steps/build_mac.yml
            parameters:
              build_type: 'Debug'
              cmake_flags: '-DCMAKE_DEBUG_INCLUDES_LDFLAGS=ON -DENABLE_CPPUNIT=ON -DDEBUG_COMPILE=ON'
          - bash: |
              export PATH="$HOME/.local/bin:/Users/git-bin/gtk/inst/bin:$PATH"
              install_name_tool -add_rpath /Users/git-bin/gtk/inst/lib/. test/test-loadHandler
              install_name_tool -add_rpath /Users/git-bin/gtk/inst/lib/. test/test-util
              CI=true ctest --verbose
            workingDirectory: ./build
            displayName: 'Run tests'

and

build_mac.yml:

parameters:
  build_type: ''
  cmake_flags: ''
  jhbuild_user: 'git-bin'

steps:
  - bash: |
      sudo mkdir /Users/${{ parameters.jhbuild_user }}
      sudo dscl . -create /Users/${{ parameters.jhbuild_user }}
      sudo dscl . -create /Users/${{ parameters.jhbuild_user }} UserShell /bin/bash
      sudo dscl . -create /Users/${{ parameters.jhbuild_user }} RealName "gtk-bin"
      sudo dscl . -create /Users/${{ parameters.jhbuild_user }} UniqueID "1011"
      sudo dscl . -create /Users/${{ parameters.jhbuild_user }} PrimaryGroupID 20
      sudo dscl . -create /Users/${{ parameters.jhbuild_user }} NFSHomeDirectory /Users/${{ parameters.jhbuild_user }}
      sudo dscl . -passwd /Users/${{ parameters.jhbuild_user }} password
      sudo chown -R ${{ parameters.jhbuild_user }}: /Users/${{ parameters.jhbuild_user }}
      sudo -H -i -u ${{ parameters.jhbuild_user }} chmod -R 777 /Users/${{ parameters.jhbuild_user }}
      #echo "${{ parameters.jhbuild_user }}     ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers
    displayName: "create new user"
    timeoutInMinutes: 5
  - bash: |
      whoami
      cd mac-setup
      sudo -H -i -u ${{ parameters.jhbuild_user }} "$PWD"/build-gtk3.sh
    displayName: 'Install jhbuild and build gtk+'

build-gtk3.sh:

#!/bin/bash -x
set -x
export PATH="$HOME/.new_local/bin:$PATH"

curl -L -O https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/gtk-osx-setup.sh
chmod +x gtk-osx-setup.sh
./gtk-osx-setup.sh
jhbuild bootstrap-gtk-osx
jhbuild build meta-gtk-osx-bootstrap meta-gtk-osx-gtk3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.