After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 752265 - Implement CPU usage reader and fix ctags problem on FreeBSD
Implement CPU usage reader and fix ctags problem on FreeBSD
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
unspecified
Other FreeBSD
: High critical
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-11 13:23 UTC by Ting-Wei Lan
Modified: 2015-07-21 06:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rg: implement CPU usage reader for FreeBSD (3.12 KB, patch)
2015-07-11 13:27 UTC, Ting-Wei Lan
none Details | Review
build: don't use unknown warning options when compiling with clang (1.36 KB, patch)
2015-07-11 13:28 UTC, Ting-Wei Lan
none Details | Review
libide: find Exuberant ctags via configure instead of hard-coding ctags (2.84 KB, patch)
2015-07-11 13:28 UTC, Ting-Wei Lan
none Details | Review
rg: implement CPU usage reader for FreeBSD (3.12 KB, patch)
2015-07-14 02:43 UTC, Ting-Wei Lan
none Details | Review
build: don't use unknown warning options when compiling with clang (1.36 KB, patch)
2015-07-14 02:43 UTC, Ting-Wei Lan
none Details | Review
libide: find Exuberant ctags via configure instead of hard-coding ctags (2.84 KB, patch)
2015-07-14 02:43 UTC, Ting-Wei Lan
none Details | Review
build: Add missing CLANG_CFLAGS for plugins/clang (701 bytes, patch)
2015-07-14 02:43 UTC, Ting-Wei Lan
none Details | Review
project-tree: use strcmp instead of g_utf8_collate to compare collation keys (1.22 KB, patch)
2015-07-14 16:33 UTC, Ting-Wei Lan
none Details | Review

Description Ting-Wei Lan 2015-07-11 13:23:18 UTC
After contrib/rg is added, gnome-builder no longer builds on FreeBSD because CPU usage reader is not implmented. I will attach 3 patches here to implment it and fix other issues.
Comment 1 Ting-Wei Lan 2015-07-11 13:27:36 UTC
Created attachment 307292 [details] [review]
rg: implement CPU usage reader for FreeBSD
Comment 2 Ting-Wei Lan 2015-07-11 13:28:15 UTC
Created attachment 307293 [details] [review]
build: don't use unknown warning options when compiling with clang

Clang usually doesn't show error when unknown warning options are used.
In order to check whether clang really supports a warning options, we
have to add -Werror=unknown-warning-option.

This commit is based on ax_compiler_flags_cflags.m4, which already does
the check to prevent useless warnings when compiling with clang.
Comment 3 Ting-Wei Lan 2015-07-11 13:28:36 UTC
Created attachment 307294 [details] [review]
libide: find Exuberant ctags via configure instead of hard-coding ctags

libide/ctags/ide-ctags-builder.c uses many Exuberant ctags features and
arguments, which are not supported by other ctags implementations, such as
BSD ctags and Emacs ctags. In order to make gnome-builder work without
user configurations, we check several names of Exuberant ctags when running
configure to set the correct default value for several systems, including
Debian(ctags-exuberant), FreeBSD(exctags), OpenBSD(ectags).
Comment 4 Christian Hergert 2015-07-13 19:07:53 UTC
Thanks for doing this!

I need a few more days to review things (limited access to internet for a few more days).

I pushed some big changes to master, so we'll need to rebase these. I'd be happy to do that, but will have to wait until I have a day with dedicated access to internet) :)

If you find time to rebase, that'd be appreciated, but not required.
Comment 5 Ting-Wei Lan 2015-07-14 02:43:08 UTC
Created attachment 307376 [details] [review]
rg: implement CPU usage reader for FreeBSD
Comment 6 Ting-Wei Lan 2015-07-14 02:43:22 UTC
Created attachment 307377 [details] [review]
build: don't use unknown warning options when compiling with clang

Clang usually doesn't show error when unknown warning options are used.
In order to check whether clang really supports a warning options, we
have to add -Werror=unknown-warning-option.

This commit is based on ax_compiler_flags_cflags.m4, which already does
the check to prevent useless warnings when compiling with clang.
Comment 7 Ting-Wei Lan 2015-07-14 02:43:30 UTC
Created attachment 307378 [details] [review]
libide: find Exuberant ctags via configure instead of hard-coding ctags

libide/ctags/ide-ctags-builder.c uses many Exuberant ctags features and
arguments, which are not supported by other ctags implementations, such as
BSD ctags and Emacs ctags. In order to make gnome-builder work without
user configurations, we check several names of Exuberant ctags when running
configure to set the correct default value for several systems, including
Debian(ctags-exuberant), FreeBSD(exctags), OpenBSD(ectags).
Comment 8 Ting-Wei Lan 2015-07-14 02:43:41 UTC
Created attachment 307379 [details] [review]
build: Add missing CLANG_CFLAGS for plugins/clang
Comment 9 Ting-Wei Lan 2015-07-14 03:11:49 UTC
There are still some problems when I try to use it.

If I try to open libgxps project, it shows this message and exits. Its path in recent-projects.xbel is /home/lantw44/tmp/libgxps/configure.ac, which does not exist.
gb-greeter-window[406998128]:  WARNING: No implementations of extension point.

I find my XDG_DOWNLOAD_DIR is also listed in recent projects, but clicking it causes segfault.

  • #0 strcoll_l
    at /usr/src/lib/libc/string/strcoll.c line 65
  • #1 g_utf8_collate
    at gunicollate.c line 135
  • #2 gb_project_file_compare
    at project-tree/gb-project-file.c line 57
  • #3 gb_project_file_compare_directories_first
    at project-tree/gb-project-file.c line 77
  • #4 compare_nodes_func
    at project-tree/gb-project-tree-builder.c line 111
  • #5 _gb_tree_insert_sorted
    at tree/gb-tree.c line 577
  • #6 gb_tree_node_insert_sorted
    at tree/gb-tree-node.c line 135
  • #7 build_file
    at project-tree/gb-project-tree-builder.c line 188
  • #8 gb_project_tree_builder_build_node
    at project-tree/gb-project-tree-builder.c line 209
  • #9 g_cclosure_marshal_VOID__OBJECTv
    at gmarshal.c line 2102
  • #10 _g_closure_invoke_va
    at gclosure.c line 864
  • #11 g_signal_emit_valist
    at gsignal.c line 3246
  • #12 g_signal_emit
    at gsignal.c line 3393
  • #13 _gb_tree_builder_build_node
    at tree/gb-tree-builder.c line 106
  • #14 gb_tree_build_node
    at tree/gb-tree.c line 99
  • #15 gb_tree_add
    at tree/gb-tree.c line 535
  • #16 _gb_tree_append
    at tree/gb-tree.c line 1421
  • #17 gb_tree_node_append
    at tree/gb-tree-node.c line 150
  • #18 build_context
    at project-tree/gb-project-tree-builder.c line 82
  • #19 gb_project_tree_builder_build_node
    at project-tree/gb-project-tree-builder.c line 207
  • #20 g_cclosure_marshal_VOID__OBJECTv
    at gmarshal.c line 2102
  • #21 _g_closure_invoke_va
    at gclosure.c line 864
  • #22 g_signal_emit_valist
    at gsignal.c line 3246
  • #23 g_signal_emit
    at gsignal.c line 3393
  • #24 _gb_tree_builder_build_node
    at tree/gb-tree-builder.c line 106
  • #25 gb_tree_build_node
    at tree/gb-tree.c line 99
  • #26 gb_tree_set_root
    at tree/gb-tree.c line 1325
  • #27 gb_project_tree_set_context
    at project-tree/gb-project-tree.c line 73
  • #28 gb_workbench_connect_context
    at workbench/gb-workbench.c line 261
  • #29 gb_workbench_set_context
    at workbench/gb-workbench.c line 307
  • #30 gb_workbench_set_property
    at workbench/gb-workbench.c line 654
  • #31 object_set_property
    at gobject.c line 1415
  • #32 g_object_new_internal
    at gobject.c line 1808
  • #33 g_object_new_valist
    at gobject.c line 2033
  • #34 g_object_new
    at gobject.c line 1617
  • #35 gb_application__context_new_cb
    at app/gb-application.c line 284
  • #36 g_task_return_now
    at gtask.c line 1104
  • #37 g_task_return
    at gtask.c line 1162
  • #38 ide_context_new_cb
    at ide-context.c line 303
  • #39 g_task_return_now
    at gtask.c line 1104
  • #40 g_task_return
    at gtask.c line 1162
  • #41 ide_async_helper_cb
    at ide-async-helper.c line 54
  • #42 g_task_return_now
    at gtask.c line 1104
  • #43 complete_in_idle_cb
    at gtask.c line 1118
  • #44 g_main_dispatch
    at gmain.c line 3122
  • #45 g_main_context_dispatch
    at gmain.c line 3737
  • #46 g_main_context_iterate
    at gmain.c line 3808
  • #47 g_main_context_iteration
    at gmain.c line 3869
  • #48 g_application_run
    at gapplication.c line 2311
  • #49 main
    at main.c line 111


In frame #1, the value of str1_norm is "buubdinfou\001\001\001\001iunm", and str2_norm is a null pointer.
Comment 10 Ting-Wei Lan 2015-07-14 16:33:32 UTC
Created attachment 307414 [details] [review]
project-tree: use strcmp instead of g_utf8_collate to compare collation keys

It seems it is possible for g_utf8_collate_key_for_filename() to return an
invalid UTF-8 string, which causes crashes in g_utf8_collate() because the
string cannot be normalized. According to the documentation of
g_utf8_collate_key_for_filename(), we should just use strcmp() to compare
its return value.
Comment 11 Christian Hergert 2015-07-19 19:50:28 UTC
Thanks for taking care of this!

So glad we have your contributions to keep this up to date.
Comment 12 Michael Catanzaro 2015-07-20 23:17:17 UTC
(In reply to Ting-Wei Lan from comment #6)
> Clang usually doesn't show error when unknown warning options are used.
> In order to check whether clang really supports a warning options, we
> have to add -Werror=unknown-warning-option.

Can we avoid needing this workaround by switching to the recommended AX_COMPILER_FLAGS macro instead?
Comment 13 Ting-Wei Lan 2015-07-21 06:09:17 UTC
Yes, AX_COMPILER_FLAGS uses the same check to prevent useless warnings.