Opened 4 years ago
Closed 4 years ago
#60508 closed defect (fixed)
gimp2:error: use of undeclared identifier 'MACH_TASK_BASIC_INFO_COUNT
Reported by: | iefdev (Eric F) | Owned by: | dbevans (David B. Evans) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.6.2 |
Keywords: | lion snowleopard leopard tiger | Cc: | |
Port: | gimp2 |
Description
$ grep -n 'error: ' gimp2_main.log | grep -v '404' 6195::info:build gimpdashboard.c:2410:31: error: variable has incomplete type 'struct mach_task_basic_info' 6201::info:build gimpdashboard.c:2411:48: error: use of undeclared identifier 'MACH_TASK_BASIC_INFO_COUNT' 6204::info:build gimpdashboard.c:2413:36: error: use of undeclared identifier 'MACH_TASK_BASIC_INFO'
This error dates back to Feb 24 (when it broke), if that helps.
Attachments (5)
Change History (36)
Changed 4 years ago by iEFdev
Attachment: | gimp2_main.log added |
---|
comment:1 Changed 4 years ago by iEFdev
comment:2 follow-ups: 3 5 Changed 4 years ago by kencu (Ken)
I pegged it <https://github.com/kencu/SnowLeopardPorts/tree/master/graphics/gimp2> at 2.10.14_3 until someone gets around to fixing it. You can do that too, if 2.10.14_3 meets your needs for now.
comment:3 Changed 4 years ago by iEFdev
Replying to kencu:
I pegged it <https://github.com/kencu/SnowLeopardPorts/tree/master/graphics/gimp2> at 2.10.14_3 until someone gets around to fixing it. You can do that too, if 2.10.14_3 meets your needs for now.
Thanks Ken… I'll have a look at that one. It's the one I have now.
gimp2 @2.10.14_3+python27+quartz-universal (active) platform='darwin 11' archs='x86_64' date='2020-02-15T04:30:04+0100'
But, before I do that… I read your post last night about “how to install and use a newer libc++ on older systems 10.7 to 10.12”
Do you think that one could help?
Gimp 2.10.20 is out (2.10.18 in port), and I really hope this is fixed for that one. It looks like a really good version.
Here's the code by the way, the one with the errors…
in: gimp-2.10.18/app/widgets/gimpdashboard.c
Line | |
---|---|
2399 | #ifdef HAVE_MEMORY_GROUP |
2400 | #ifdef PLATFORM_OSX |
2401 | static void |
2402 | gimp_dashboard_sample_memory_used (GimpDashboard *dashboard, |
2403 | Variable variable) |
2404 | { |
2405 | GimpDashboardPrivate *priv = dashboard->priv; |
2406 | VariableData *variable_data = &priv->variables[variable]; |
2407 | |
2408 | variable_data->available = FALSE; |
2409 | #ifndef TASK_VM_INFO_REV0_COUNT /* phys_footprint added in REV1 */ |
2410 | struct mach_task_basic_info info; |
2411 | mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT; |
2412 | |
2413 | if( task_info(mach_task_self (), MACH_TASK_BASIC_INFO, |
2414 | (task_info_t)&info, &infoCount ) != KERN_SUCCESS ) |
2415 | return; /* Can't access? */ |
2416 | |
2417 | variable_data->available = TRUE; |
2418 | variable_data->value.size = info.resident_size; |
2419 | #else |
2420 | |
2421 | // ... // |
comment:4 Changed 4 years ago by kencu (Ken)
this is not a libc++ API thing here, so upgrading libc++ won't fix this one.
This is related to kernel interface API that looks like it was added in a later os version. You'd have to see what this code is trying to accomplish, and then sort out if it can be done using API available on your system version.
Sometimes comparing the file to last version you have that worked is illuminating; the author might have removed code that worked on your os before. If it's new code, then you might have to write a compatible version. If the API is just unavailable, then perhaps you can just return some reasonable fallback value for whatever it is.
And sometimes there is no fix, and you're out of luck...
comment:5 Changed 4 years ago by iEFdev
Replying to kencu:
I pegged it <https://github.com/kencu/SnowLeopardPorts/tree/master/graphics/gimp2> at 2.10.14_3 …
I downloaded the gimp
Portfile as well.
I got a config error about mypaint-brushes
not being 1.0. Installing mypaint-brushes1
solved it.
But, I get this error… I don't know how to work around that. Tried with a few different compilers (clang{9,8,5}). All the same.
:info:build gimpdata.c:460:40: error: expected expression :info:build else if (g_str_has_prefix (path, MYPAINT_BRUSHES_DIR)) :info:build ^ :info:build <command line>:8:29: note: expanded from here :info:build #define MYPAINT_BRUSHES_DIR /opt/local/share/mypaint-data/1.0/brushes :info:build ^ :info:build gimpdata.c:460:40: error: use of undeclared identifier 'opt' :info:build <command line>:8:30: note: expanded from here :info:build #define MYPAINT_BRUSHES_DIR /opt/local/share/mypaint-data/1.0/brushes :info:build ^ :info:build gimpdata.c:460:40: error: use of undeclared identifier 'local'; did you mean 'lockf'? :info:build <command line>:8:34: note: expanded from here :info:build #define MYPAINT_BRUSHES_DIR /opt/local/share/mypaint-data/1.0/brushes :info:build ^ :info:build /usr/include/unistd.h:609:6: note: 'lockf' declared here :info:build int lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf); :info:build ^ :info:build gimpdata.c:460:40: error: use of undeclared identifier 'share' :info:build else if (g_str_has_prefix (path, MYPAINT_BRUSHES_DIR)) :info:build ^ :info:build <command line>:8:40: note: expanded from here :info:build #define MYPAINT_BRUSHES_DIR /opt/local/share/mypaint-data/1.0/brushes :info:build ^ // ... // :info:build 16 errors generated
comment:6 Changed 4 years ago by kencu (Ken)
I guess we will have to try to really fix this :> I'll see if I can find some time. Riccardo is also deeply into gimp2 on older systems, and usually has fixes to contribute.
comment:7 Changed 4 years ago by kencu (Ken)
You'll need to add this <https://github.com/macports/macports-ports/blob/master/graphics/gimp2/files/MYPAINT_BRUSHES_DIR.patch>
comment:8 follow-up: 9 Changed 4 years ago by kencu (Ken)
the gimp2 in my snowleopardports repo has the patch added now. that was all it needed to build for me.
I'll see if I can sort out the newer version over the next bit.
comment:9 Changed 4 years ago by iEFdev
Replying to kencu:
the gimp2 in my snowleopardports repo has the patch added now. that was all it needed to build for me.
I'll see if I can sort out the newer version over the next bit.
Thanks! 👍 Yes, I added it here to. Mine is still building.
comment:10 Changed 4 years ago by iEFdev
Thanks again Ken! It built and started up fine now. So nice to get rid of the rev-upgrade msg. My Lion said: “purrfect”. 👌
comment:11 Changed 4 years ago by kencu (Ken)
Summary: | gimp2: error: variable has incomplete type, error: use of undeclared identifier → gimp2:error: use of undeclared identifier 'MACH_TASK_BASIC_INFO_COUNT |
---|
comment:12 Changed 4 years ago by kencu (Ken)
Keywords: | lion snowleopard leopard tiger added |
---|
comment:13 follow-up: 16 Changed 4 years ago by dbevans (David B. Evans)
This build failure is occurring with gimp2 2.10.20 on 10.7 and earlier (with MYPAINT_BRUSHES_DIR.patch applied). I'm not sure what happened before but I don't think it looks like this patch has anything to do with it. I'm looking into it but I would appreciate any input from you guys on this.
comment:14 Changed 4 years ago by kencu (Ken)
Yes, we found that patch was needed to fix an earlier gimp2 version (2.10.14) building against an updated mypaint-brushes1.
I don't think we ever got anything newer building on < 10.8, and I haven't tried in a while...
comment:15 follow-up: 23 Changed 4 years ago by dbevans (David B. Evans)
Anyway the place the build breaks (for < 10.8) is in app/widgets/gimpdashboard.c and it looks like it could be bypassed, if needed, by just using #undef HAVE_MEMORY_GROUP there.
On the more recent machines, the missing definitions are in <mach/task_info.h>. The GIMP code includes <mach/mach.h> which eventually includes this header. (mach/mach.h includes mach/mach_types.h includes mach/task_info.h)
I'd be interested if this is the case on the failing machines or not or something else. Appreciate it if you could take a look for me.
Thanks in advance.
comment:16 follow-up: 17 Changed 4 years ago by iEFdev
Replying to dbevans:
This build failure is occurring with gimp2 2.10.20 on 10.7 and earlier (with MYPAINT_BRUSHES_DIR.patch applied). I'm not sure what happened before but I don't think it looks like this patch has anything to do with it. I'm looking into it but I would appreciate any input from you guys on this.
Unrelated to the original err, but it it is to any help…
I'll attach the configure.log
and main.log
from upgrading to 2.10.20.
grep'ed the errors and put in a separate `err.txt`
There are a couple of unknown arguments and options, a couple of missing headers, a new undeclared identifier: _NL_MEASUREMENT_MEASUREMENT
, and the XML::Parser perl module is missing. 2 of the patches had some offset.
Changed 4 years ago by iEFdev
Attachment: | logs.tar.xz added |
---|
Changed 4 years ago by iEFdev
comment:17 follow-up: 19 Changed 4 years ago by dbevans (David B. Evans)
Replying to iEFdev:
There are a couple of unknown arguments and options, a couple of missing headers, a new undeclared identifier:
_NL_MEASUREMENT_MEASUREMENT
, and the XML::Parser perl module is missing. 2 of the patches had some offset.
This is not entirely consistent with the result on the buildbots. Particularly the perl bit should be handled correctly and if not is symptomatic of some error in your setup. Will attach the 10.7 buildbot log for comparison.
Maybe were not doing the same thing. Are you building using the gimp2 port that I pushed this morning or something else?
Changed 4 years ago by dbevans (David B. Evans)
Attachment: | main-10.7.log added |
---|
10.7 build log from buildbot
comment:18 follow-up: 20 Changed 4 years ago by dbevans (David B. Evans)
This
:info:configure checking for perl... (cached) /opt/local/bin/perl5.30 :info:configure checking for perl >= 5.8.1... 5.30.3 :info:configure checking for XML::Parser... configure: error: XML::Parser perl module is required for intltool :info:configure Command failed: cd "/opt/local/var/macports/build/
is because you're using perl 5.30 and intltool is expecting 5.28 (you have p5.30-xml-parser installed) but intltool wants p5.28-xml-parser. Possibly you have perl5 +perl5_30 installed?
comment:19 Changed 4 years ago by iEFdev
Replying to dbevans:
Are you building using the gimp2 port that I pushed this morning or something else?
Yes, the new 2.10.20 update. Perhaps the differences are because of my variants? … +python27+quartz-universal
.
I renamed my pegged 2.10.14
to gimp2_
. Made sure it showed up as outdated with 2.10.20
as the new one, and then ran an port upgrade
(to get the logs and errs).
comment:20 Changed 4 years ago by iEFdev
Replying to dbevans:
…but intltool wants p5.28-xml-parser. Possibly you have perl5 +perl5_30 installed?
Yes, I have. I'll try add +perl5_28
to the upgrade and see if the err gets removed.
Maybe add port:p5.28-xml-parser
as a dep?
comment:21 Changed 4 years ago by dbevans (David B. Evans)
The ports code is assuming that the default perl5 (+perl5_28) is installed. Bad assumption, as you have demonstrated. Will go and fix it.
comment:22 Changed 4 years ago by dbevans (David B. Evans)
Just pushed fix for the perl issue. After updating your ports tree, the perl configuration should work regardless of which variant of perl5 is installed (or no perl5 installed at all).
comment:23 Changed 4 years ago by iEFdev
Replying to dbevans:
Just pushed fix for the perl issue. After updating your ports tree, the perl configuration should work regardless of which variant of perl5 is installed (or no perl5 installed at all).
Thanks! 👍 I've tried with both now, and it's the old msg.
Replying to dbevans:
On the more recent machines, the missing definitions are in <mach/task_info.h>. The GIMP code includes <mach/mach.h> which eventually includes this header. (mach/mach.h includes mach/mach_types.h includes mach/task_info.h)
In 10.7, there's no MACH_TASK_BASIC_INFO_COUNT
, but there is a TASK_BASIC_INFO_COUNT
. What's the extected output? Perhaps it's just renamed.
comment:24 Changed 4 years ago by kencu (Ken)
I think it probably is just renamed.
10.15:
#define MACH_TASK_BASIC_INFO_COUNT \ (sizeof(mach_task_basic_info_data_t) / sizeof(natural_t))
10.7:
#define TASK_BASIC_INFO_COUNT \ (sizeof(task_basic_info_data_t) / sizeof(natural_t))
see: <http://newosxbook.com/src.jl?tree=xnu-1699.32.7&file=/osfmk/mach/task_info.h>
comment:25 follow-up: 26 Changed 4 years ago by kencu (Ken)
so perhaps we just
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1080 #define MACH_TASK_BASIC_INFO_COUNT TASK_BASIC_INFO_COUNT #define mach_task_basic_info_data_t task_basic_info_data_t #endif
comment:26 Changed 4 years ago by iEFdev
Replying to kencu:
so perhaps we just
…
Yes, almost. Got another, but simular error. I think I've fixed it, and have prepared a patch.
I used this:
#ifdef HAVE_MEMORY_GROUP #ifdef PLATFORM_OSX #if MAC_OS_X_VERSION_MAX_ALLOWED < 1080 #define MACH_TASK_BASIC_INFO_COUNT TASK_BASIC_INFO_COUNT #define mach_task_basic_info_data_t task_basic_info_data_t #define MACH_TASK_BASIC_INFO TASK_BASIC_INFO #define mach_task_basic_info task_basic_info #endif static void
…and it finished the build, but since I had prepared the Portfile (and my muscle memory must've ⌘S that), so it errored on destroot. But, it did build. :–)
$ sudo port destroot gimp2 +python27 +quartz ---> Computing dependencies for gimp2 ---> Configuring gimp2 ---> Building gimp2 Portfile changed since last build; discarding previous state. ---> Staging gimp2 into destroot Error: Failed to destroot gimp2: command execution failed
I'll retry in a moment, and see if I can fix the (2) offsets on the othe patches to before that.
comment:27 Changed 4 years ago by iEFdev
It built and installed, and the program open up fine.
$ port -v installed gimp2 The following ports are currently installed: gimp2 @2.10.14_3+python27+quartz-universal platform='darwin 11' archs='x86_64' date='2020-07-28T01:27:36+0200' gimp2 @2.10.20_0+python27+quartz-universal (active) platform='darwin 11' archs='x86_64' date='2020-08-29T19:04:06+0200'
That “Yes, it worked”-feeling is a nice one. :–)
Made a PR for this here: https://github.com/macports/macports-ports/pull/8262
comment:28 Changed 4 years ago by kencu (Ken)
That's great. Perhaps even something we might be able include in legacy-support
to make this transparent someday.
comment:31 Changed 4 years ago by iEFdev
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I'd really appreciate if someone could have a look, &/or help me with this.