Skip to content

gitlab-elasticsearch-indexer can't be built with Homebrew without calling `brew link icu4c --force`

Overview

On a new GDK install on an M1, I got:

% bundle exec rspec spec/lib/banzai/filter/references/issue_reference_filter_spec.rb
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
rake aborted!
Gitlab::TaskFailedError: # pkg-config --cflags  -- icu-i18n icu-i18n
Package icu-i18n was not found in the pkg-config search path.
Perhaps you should add the directory containing `icu-i18n.pc'
to the PKG_CONFIG_PATH environment variable
No package 'icu-i18n' found
Package icu-i18n was not found in the pkg-config search path.
Perhaps you should add the directory containing `icu-i18n.pc'
to the PKG_CONFIG_PATH environment variable
No package 'icu-i18n' found
pkg-config: exit status 1
make: *** [build] Error 2
/Users/stanhu/gdk-ee/gitlab/lib/gitlab/task_helpers.rb:112:in `run_command!'
/Users/stanhu/gdk-ee/gitlab/ee/lib/tasks/gitlab/indexer.rake:20:in `block (4 levels) in <main>'
/Users/stanhu/gdk-ee/gitlab/ee/lib/tasks/gitlab/indexer.rake:20:in `chdir'
/Users/stanhu/gdk-ee/gitlab/ee/lib/tasks/gitlab/indexer.rake:20:in `block (3 levels) in <main>'
Tasks: TOP => gitlab:indexer:install
(See full trace by running task with --trace)

GitLab Elasticsearch Indexer failed to install, cleaning up tmp/tests/gitlab-elasticsearch-indexer!

An error occurred in a `before(:suite)` hook.

icu4c is installed:

% brew list icu4c | grep pc
/opt/homebrew/Cellar/icu4c/69.1/lib/pkgconfig/icu-uc.pc
/opt/homebrew/Cellar/icu4c/69.1/lib/pkgconfig/icu-io.pc
/opt/homebrew/Cellar/icu4c/69.1/lib/pkgconfig/icu-i18n.pc

I had to manually do this:

% brew link icu4c --force
Linking /opt/homebrew/Cellar/icu4c/69.1... 61 symlinks created.

If you need to have this software first in your PATH instead consider running:
  echo 'export PATH="/opt/homebrew/opt/icu4c/bin:$PATH"' >> ~/.zshrc
  echo 'export PATH="/opt/homebrew/opt/icu4c/sbin:$PATH"' >> ~/.zshrc
% pkg-config --cflags  -- icu-i18n icu-i18n
-I/opt/homebrew/Cellar/icu4c/69.1/include

This may be related: https://github.com/Homebrew/homebrew-core/issues/36958

Steps to replicate (optional)

Proposal (optional)

Automatically run brew link icu4c --force?

Environment (optional)


Operating system: Darwin jet-arm.local 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 arm64 Architecture: arm64 Ruby version: ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [arm64-darwin21] GDK version: 6f1290d6

GDK configuration: