Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glibmm 2.80 bottle: link error when using Glib::DateTime::create_now_local() #172204

Closed
4 tasks done
lvillani opened this issue May 20, 2024 · 4 comments · Fixed by #176546
Closed
4 tasks done

glibmm 2.80 bottle: link error when using Glib::DateTime::create_now_local() #172204

lvillani opened this issue May 20, 2024 · 4 comments · Fixed by #176546
Labels
bug Reproducible Homebrew/homebrew-core bug stale No recent activity

Comments

@lvillani
Copy link

brew gist-logs <formula> link OR brew config AND brew doctor output

% brew config
HOMEBREW_VERSION: 4.3.1-11-g7c62002
ORIGIN: https://github.com/Homebrew/brew
HEAD: 7c620029fb045e0f7cb6769f8ad542eb7f0bcaf7
Last commit: 4 hours ago
Core tap JSON: 20 May 19:19 UTC
Core cask tap JSON: 20 May 19:19 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: vim
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_NO_ANALYTICS: set
HOMEBREW_NO_AUTO_UPDATE: set
HOMEBREW_NO_INSTALL_CLEANUP: set
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.1 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.1/bin/ruby
CPU: octa-core 64-bit arm_blizzard_avalanche
Clang: 15.0.0 build 1500
Git: 2.45.1 => /opt/homebrew/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: N/A
Rosetta 2: false

% brew doctor
Your system is ready to brew.

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

I'm trying to link a program to bottled glibmm that uses the Glib::DateTime::create_now_local() method but I'm getting a linking error.

What happened (include all command output)?

[1/1] Linking target program
FAILED: program 
c++  -o program program.p/program.cc.o -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/homebrew/Cellar/glibmm/2.80.0/lib -Wl,-rpath,/opt/homebrew/Cellar/glib/2.80.2/lib -Wl,-rpath,/opt/homebrew/opt/gettext/lib -Wl,-rpath,/opt/homebrew/Cellar/libsigc++/3.6.0/lib /opt/homebrew/Cellar/glibmm/2.80.0/lib/libglibmm-2.68.dylib /opt/homebrew/Cellar/glib/2.80.2/lib/libgobject-2.0.dylib /opt/homebrew/Cellar/glib/2.80.2/lib/libglib-2.0.dylib /opt/homebrew/opt/gettext/lib/libintl.dylib /opt/homebrew/Cellar/libsigc++/3.6.0/lib/libsigc-3.0.dylib
Undefined symbols for architecture arm64:
  "Glib::DateTime::create_now_local(long long)", referenced from:
      _main in program.cc.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

What did you expect to happen?

The application should link without errors.

The error seem to happen only when the bottled version of glibmm is used and disappears if one re-builds glibmm from source (e.g. with brew reinstall -s glibmm). Maybe the bottle needs to be re-built?

Step-by-step reproduction instructions (by running brew commands)

brew install --force-bottle glibmm

mkdir glibmm-repro
cd glibmm-repro

cat >meson.build <<EOF
project('program', 'cpp', default_options: ['cpp_std=c++20'])
glibmm_dep = dependency('glibmm-2.68')
program_name = 'program'
cpp_sources = ['program.cc']
executable(program_name,
  cpp_sources,
  dependencies: [glibmm_dep]
)
EOF

cat >program.cc <<EOF
#include <glibmm.h>

int main() {
    Glib::DateTime::create_now_local(0);
    return 0;
}
EOF

meson setup build
meson compile -C build
@lvillani lvillani added the bug Reproducible Homebrew/homebrew-core bug label May 20, 2024
@cho-m
Copy link
Member

cho-m commented May 21, 2024

The error seem to happen only when the bottled version of glibmm is used and disappears if one re-builds glibmm from source (e.g. with brew reinstall -s glibmm). Maybe the bottle needs to be re-built?

It might be that the glibmm bottle was built during the time glib's gint64 had accidentally switched to long rather than long long. That was fixed in #166473 but I had only rebuilt glibmm@2.66 back then.

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label Jun 16, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2024
@lvillani
Copy link
Author

lvillani commented Jul 5, 2024

Sorry for not following up on time. Would it be possible to re-open the issue? The problem itself is still present.
Not sure what is the best course of action to fix this issue. Is rebuilding the 2.80.0 bottle enough?

@lvillani
Copy link
Author

lvillani commented Jul 7, 2024

Thanks for rebuilding the bottle! It appears to have fixed the issues we were seeing in dune3d/dune3d#49.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/homebrew-core bug stale No recent activity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@lvillani @cho-m and others