R-macos / recipes

System for building static dependent libraries for CRAN packages
44 stars 17 forks source link

error when installing fribidi, seems to be issue with glib #38

Closed jonathon-love closed 1 year ago

jonathon-love commented 1 year ago

hi,

i'm getting the following error when using bash build.sh fribidi under macos 11 (with github actions).

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h:193:7: error: variably modified ‘bytes’ at file scope
  char bytes[kAuthorizationExternalFormLength];
       ^~~~~
  CC       gspawn.lo
...
make: *** [pkgconfig-0.29.2-dst] Error 2
Error: Process completed with exit code 2.

more details here

is there a way i could fix this?

this is the job i'm running:

jobs:
  build:
    runs-on: macos-11

    steps:
    - name: Checkout Code
      uses: actions/checkout@v3

    - name: Set up R
      uses: r-lib/actions/setup-r@v2
      with:
        r-version: '4.1.3'

    - name: Check R version
      run: R.version
      shell: Rscript {0}

    - name: Install R deps
      run: |
        git clone https://github.com/R-macos/recipes
        cd recipes
        sudo bash build.sh fribidi

my intention is to have a repo that i can use to build macOS binary packages more-or-less equivalent to those created by CRAN. this was prompted by the shuttering of MRAN snapshots, and i still need to be able to get access to historical R macOS binaries (that neither CRAN, nor rstudio package manager retain). (if someone knows of another project doing this, i'd be keen to hear about it!)

with thanks

s-u commented 1 year ago

To start from the bottom: you don't need to re-build the binaries - all old library binaries are still available - for the recipes ones they are all in https://mac.r-project.org/bin/ and the historic ones in https://mac.r-project.org/libs/, https://mac.r-project.org/libs-4/ and https://mac.r-project.org/libs-arm64/ (there are even older ones if you need them).

As for the error above, I suspect the runner has a very messy setup - try it without the r-setup action first and I'd also remove (aka move aside) /usr/local to make sure you don't have all the 3rd party compilers/libraries/tools in there. What SDK are you building against? (MacOSX.sdk is a symlink so it's hard to tell).

jonathon-love commented 1 year ago

you don't need to re-build the binaries

ah, thanks. so i'm now using

sudo R -e "
          source('https://mac.R-project.org/bin/install.R')
          install.libs(c('fribidi', 'gsl'), os='darwin17')
        "

however i now get:

usr/local/: Can't restore time
tar: Error exit delayed from previous errors.
Downloading + installing  https://mac.r-project.org/bin/darwin17/x86_64/gsl-2.7-darwin.17-x86_64.tar.xz ...
usr/local/: Can't restore time
tar: Error exit delayed from previous errors.
Downloading + installing  https://mac.r-project.org/bin/darwin17/x86_64/pkgconfig-0.29.2-darwin.17-x86_64.tar.xz ...
usr/local/: Can't restore time
tar: Error exit delayed from previous errors.
Downloading + installing  https://mac.r-project.org/bin/darwin17/x86_64/zlib-stub-0.1-darwin.17-x86_64.tar.xz ...
usr/local/: Can't restore time
tar: Error exit delayed from previous errors.

the sdk i'm using (not sure if this is still relevant) is the github actions one: https://github.com/actions/runner-images/blob/main/images/macos/macos-11-Readme.md

this is my current github runner config

  build:
    runs-on: macos-11

    steps:
    - name: Checkout Code
      uses: actions/checkout@v3

    - name: Install R deps
      run: |
        sudo R -e "
          source('https://mac.R-project.org/bin/install.R')
          install.libs(c('fribidi', 'gsl'), os='darwin17')
        "

any tips?

with thanks

jonathon-love commented 1 year ago

i'm making progress here ... there's something funny about /usr/local on these github runner instances, so it's not possible to tar xf to them. however, i can tar xf to somewhere else, and then rsync the content to /usr/local.

i.e. sudo rsync -av --no-perms --no-owner --no-group /tmp/usr/local/ /usr/local

coatless commented 1 year ago

@jonathon-love ran into that error myself awhile back. You need to place the downloads into a temporary folder and strip two directory levels. See the working solution at: https://github.com/R-macos/recipes/issues/36#issuecomment-1434045757

Alternative, feel free to install the {macrtools} package and use:

macrtools::recipes_binary_install(c('fribidi', 'gsl'))
s-u commented 1 year ago

@jonathon-love that is not an error - just a warning that you cannot change the timestamp of/usr/local because it is read-only which is expected.