collective.monkeypatch fails to detect Zope version (z3c.form) - plone

On some of our servers collective.monkeypatch does not work:
Unable to detect Zope version. Please make sure you have Zope 2.10.4 or newer installed.
2011-03-24 10:17:13 ERROR collective.monkeypatcher Could not patch because version not recognized. Wanted: [2, 13, 9], Installed: []
2011-03-24 10:17:13 INFO collective.monkeypatcher Preconditions for patching scope <class 'z3c.form.form.BaseForm'> not met (Zope2-=2.13.999)!
2011-03-24 10:17:13 ERROR collective.monkeypatcher Could not patch because version not recognized. Wanted: [2, 13, 9], Installed: []
2011-03-24 10:17:13 INFO collective.monkeypatcher Preconditions for patching scope <class 'z3c.form.group.GroupForm'> not met (Zope2-=2.13.999)!
We have tried the some buildout on different computers and cannot come up with reliable pattern why it is failing (probably something egg and version pindown related)
What could be the issue and how to

The Unable to detect Zope version. Please make sure you have Zope 2.10.4 or newer installed. comes from older Plone versions (version 3.0 and earlier, it was removed in the 3.1 line). It uses the old-style App.version_txt.getZopeVersion API to read a version.txt file from the Zope2 module directory, but that is not always written. I do not see it in my Zope2 installs installed with the plone.recipe.zope2install recipe in any case. This log message is otherwise harmless provided you do use Zope 2.10.4 or newer.
With the advent of a proper Zope2 egg, Plone now uses the pkg_resources module to make this test and in Zope 2.12 the getZopeVersion API uses pkg_resources internally as well. The collective.monkeypatcher precondition test also uses pkg_resources to introspect package versions.
From your Unable to detect Zope version log entry I infer that you are using an older Plone version (3.0 or older) and thus you are most likely using Zope 2.10. Zope 2.10 is not an egg, so there is no egg metadata for pkg_resources to get a version from. Thus the version test fails for any Zope version before 2.12.
The obvious work-around is to not use the package defining the monkeypatch on Zope servers older than 2.12. But you can also generate a fake egg with the version information included with the plone.recipe.zope2install recipe:
[zope2]
recipe = plone.recipe.zope2install
...
additional-fake-eggs =
Zope2 = 2.10.11
Fake eggs provide enough metadata for pkg_resources to get a version number, but the zope2install recipe writes a default Zope2 fake egg with a 0.0 version. By defining the fake egg with a version number you end up with pkg_resources giving you enough information to satisfy the precondition. You may have to upgrade your plone.recipe.zope2install version, I see some refactoring and bug-fixes have been applied to the way fake eggs are generated that may affect you.

I think the problem is in the preconditions attribute of your monkeypatch directive.
See documentation at http://pypi.python.org/pypi/collective.monkeypatcher

Related

Failed to find "gl.h" on macOS 11.3

I've got XCode 12.5 up and running on macOS 11.3 (M1 chip) in Github Actions as a self-hosted runner.
While my macOS workflow is able to find gl.h in the github-hosted machine just fine, my own self-hosted one reports this:
CMake Error at /Users/administrator/actions-runner/_work/Mudlet/Qt/5.14.2/clang_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
Error: Failed to find "gl.h" in
"/System/Library/Frameworks/OpenGL.framework/Headers;/System/Library/Frameworks/AGL.framework/Headers".
Call Stack (most recent call first):
/Users/administrator/actions-runner/_work/Mudlet/Qt/5.14.2/clang_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:202 (include)
3rdparty/vcpkg/scripts/buildsystems/vcpkg.cmake:555 (_find_package)
/Users/administrator/actions-runner/_work/Mudlet/Qt/5.14.2/clang_64/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:94 (find_package)
3rdparty/vcpkg/scripts/buildsystems/vcpkg.cmake:555 (_find_package)
/Users/administrator/actions-runner/_work/Mudlet/Qt/5.14.2/clang_64/lib/cmake/Qt5UiTools/Qt5UiToolsConfig.cmake:219 (find_package)
3rdparty/vcpkg/scripts/buildsystems/vcpkg.cmake:555 (_find_package)
3rdparty/edbee-lib/edbee-lib/CMakeLists.txt:177 (FIND_PACKAGE)
The code responsible is this line:
FIND_PACKAGE(Qt5UiTools REQUIRED)
What could be the reason that gl.h is not locatable?
I got this problem when I updated to MacOS Big Sur (11.6.2) when trying to make a qt app.
This was the error I got:
CMake Error at /usr/local/Qt-5.5.1/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
Failed to find "gl.h" in
"/System/Library/Frameworks/OpenGL.framework/Headers;/System/Library/Frameworks/AGL.framework/Headers".
Call Stack (most recent call first):
/usr/local/Qt-5.5.1/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:139 (include)
My google-fu found this from 2019 [https://github.com/ziglang/zig/issues/2208]
https://github.com/ziglang/zig/issues/2208 :
The new path to the framework is:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
I looked, and gl.h was found in several places, including OpenGL.framework.
As a work-around, I changed the library path in /usr/local/Qt-5.5.1/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 from:
set(_GL_INCDIRS "/System/Library/Frameworks/OpenGL.framework/Headers" "/System/Library/Frameworks/AGL.framework/Headers")
to:
set(_GL_INCDIRS "/System/Library/Frameworks/OpenGL.framework/Headers" "/System/Library/Frameworks/AGL.framework/Headers" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks")
running on macOS 11.3 (M1 chip) in Github Actions as a self-hosted runner.
Try again with the latest version of self-hosted runners, since (Aug. 2022):
GitHub Actions: Self-hosted runners now support Apple M1 hardware
Actions runner support for Apple silicon hardware, such as the M1 chip, is now generally available.
This provides teams with the capability to run self-hosted macOS workflows in a macOS ARM64 runtime.
Now the Actions runner supports M1 and the ARM64 runtime meaning developers can run it on their own M1 or M2 hardware.
Based on initial testing, there are currently two issues to be aware of:
macOS ARM64 does not support node12.
Therefore, the runner will automatically use node16 to execute any javascript Action written for node12.
All actions provided by GitHub are compatible with the runner except for a known issue with setup-python. The fix for that can be tracked here.
For additional information on how to set up a self-hosted macOS ARM64 runner, please refer to our documentation.
If you have any feedback or questions for Actions self-hosted Apple silicon support, you can submit an issue in the runner repository.

Error building Ada Web Server (AWS) on macOS Sierra

I have updated my gnat to the latest version from AdaCore and trying to rebuild the latest AWS (Ada Web Server) also downloaded from AdaCore. I got some errors when building:
aws-services-web_block-context.ads:106:21: argument of pragma "SUPPRESS" is not valid check name
aws-services-web_block-context.ads:106:21: argument of pragma "SUPPRESS" is not valid check name
compilation of aws-services-web_block-context.adb failed
compilation of aws-services-web_block-registry.adb failed
gprbuild: *** compilation phase failed
make: *** [build-native] Error 4
What could have been wrong? Or, have I overlook something?
Thanks.
Adrian
The check that is invalid is Tampering_Check, which is to do with the resource-intensive ARM-specified checks on improper use of Containers (basically, is one part of the code trying to change the structure of a Container that another is already using?)
I don’t know why you’ve had this problem: both GNAT GPL 2016 and FSF GCC 6.1.0 are OK with the pragma. Are you sure you’re using the latest compiler?
One other thing to watch out for is that the master branch at Github may rely on compiler features not available in compiler releases available to unsupported customers; if using GNAT GPL 2016, maybe the gpl-2016 branch would be safer, if not up to date.

XCode 4.3 - Build error "missing required architecture armv7"

After upgrade XCode from 4.2 to 4.3 I've got below problem. I can't build it.
Do you guys have idea how can I resolve this problem? even some clue would be helpful to me.
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit, missing required architecture armv7 in file
Undefined symbols for architecture armv7:
"_STComposeString", referenced from:
-[NSMutableURLRequest_ParametersTest verifyDefaultParametersForRequest:] in NSMutableURLRequest+ParametersTest.o
-[NSMutableURLRequest_ParametersTest verifyModifiedParametersForRequest:] in NSMutableURLRequest+ParametersTest.o
-[NSMutableURLRequest_ParametersTest verifyEmptyParametersForRequest:] in NSMutableURLRequest+ParametersTest.o
-[NSString_URLEncodingTest testURLEncodedString] in NSString+URLEncodingTest.o
-[NSURL_BaseTest testURLStringWithoutQuery] in NSURL+BaseTest.o
-[OAHMAC_SHA1SignatureProviderTest testSignClearText] in OAHMAC_SHA1SignatureProviderTest.o
-[OAMutableURLRequestTest testGenerateNonce] in OAMutableURLRequestTest.o
...
"_OBJC_CLASS_$_SenTestCase", referenced from:
_OBJC_CLASS_$_NSMutableURLRequest_ParametersTest in NSMutableURLRequest+ParametersTest.o
_OBJC_CLASS_$_NSString_URLEncodingTest in NSString+URLEncodingTest.o
_OBJC_CLASS_$_NSURL_BaseTest in NSURL+BaseTest.o
_OBJC_CLASS_$_OAHMAC_SHA1SignatureProviderTest in OAHMAC_SHA1SignatureProviderTest.o
_OBJC_CLASS_$_OAMutableURLRequestTest in OAMutableURLRequestTest.o
_OBJC_CLASS_$_OAPlaintextSignatureProviderTest in OAPlaintextSignatureProviderTest.o
_OBJC_CLASS_$_OARequestParameterTest in OARequestParameterTest.o
...
"_OBJC_METACLASS_$_SenTestCase", referenced from:
_OBJC_METACLASS_$_NSMutableURLRequest_ParametersTest in NSMutableURLRequest+ParametersTest.o
_OBJC_METACLASS_$_NSString_URLEncodingTest in NSString+URLEncodingTest.o
_OBJC_METACLASS_$_NSURL_BaseTest in NSURL+BaseTest.o
_OBJC_METACLASS_$_OAHMAC_SHA1SignatureProviderTest in OAHMAC_SHA1SignatureProviderTest.o
_OBJC_METACLASS_$_OAMutableURLRequestTest in OAMutableURLRequestTest.o
_OBJC_METACLASS_$_OAPlaintextSignatureProviderTest in OAPlaintextSignatureProviderTest.o
_OBJC_METACLASS_$_OARequestParameterTest in OARequestParameterTest.o
...
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I was getting the same linking error for the Simulator after upgrading from Xcode 4.2 -> 4.3.1. I noticed that new projects in 4.3.1 do work with Unit Tests, so just compared the project differences.
What fixed it for me was:-
Select Project in project navigator
Select Test Target
Select Build Settings
Go down to Framework Search Paths and single-click it
Delete whatever is there
Enter $(SDKROOT)/Developer/Library/Frameworks $(DEVELOPER_LIBRARY_DIR)/Frameworks
If you had any custom frameworks, add those back
Actually, Unit Tests run fine on the Device, too.
Looks like this was either an accidental (or on purpose) omission on Apple's part.
If (and only if) you are a registered Apple Developer, you can log into the Apple Developer Forums and if you copy this linked search query into your browser address bar, you will see other people have had the same problem.
For now, it looks like you can only use SenTestingKit on the simulator.
I had a similar issue with Xcode 4.4.
My solution path:
Removed SetTestingKit.framework from the main target's (the system under test) "link binary with libraries", leaving it in the test target as is. Not sure why it ended up there in the first place.
I believe this bug is now fixed in Xcode 4.4.1
Using xcode 4.6 and trying to add facebook SDK 3.1 I had this problem because I didn't select to add the files to my test target.
You should check both targets when you copy the framework.
I just upgraded to 4.3.1 There is a problem with SenTestingKit framework. I removed the test source code from the project, it builds ok. And it can run on 5.1 device. But I got _dyld_dyld_start error when I ran it on simulator. I had to remove SenTestingKit from the project to make it work on simulator.

Maven build(with Flexmojos) for multi module project throwing an error

I am trying to setup a Flex/Java multi module project in Eclipse. Using Maven to run the build and generate the war file. The details of the versions I am using are as follows:
Flexmojos : 3.5.0
Flex framework/compiler : 4.5.1.21328
Target player : 10.2.0
And the playerglobal dependency in my pom file uses classifier as 10.2 with version 4.5.1.21328
Now when I run the build using 'mvn install', I get the following error:
[ERROR] Failed to execute goal
org.sonatype.flexmojos:flexmojos-maven-plugin:3.5.0:compile-swf
(default-compile-swf) on project client: TargetPlayer and
playerglobal dependency version doesn't match! Target player: 10.2.0,
player global: 10.2 -> [Help 1]
Any ideas why this might be happening?
I tried just playing around changing those version numbers, but still couldn't make it work for Flex 4.5.1. Please let me know how to go about this (and if you need more information). Thanks.
Regards
Basith
Have you tried simply referencing "10.2" instead of "10.2.0"? I think there was only one Flash player deployed with a 3-segment version number.

Profiling Plone/Zope

What is current best practice for profiling Plone/Zope applications on a Plone 4.1/Zope 2.13 system?
Products.ZopeProfiler and the Plone.org version of CallProfiler both fail at install time with:
Traceback (most recent call last):
File "/home/derek/plone4/buildout-cache/eggs/Zope2-2.13.10-py2.6.egg/OFS/Application.py", line 689, in install_product
initmethod(context)
File "/home/derek/plone4/buildout-cache/eggs/Products.ZopeProfiler-2.0.1-py2.6.egg/Products/ZopeProfiler/__init__.py", line 8, in initialize
control_panel = context._ProductContext__app.Control_Panel
AttributeError: 'NoneType' object has no attribute 'Control_Panel'
z3c.profiler wants to install a lot of apparently-incompatible dependencies (not surprising since it's intended for Zope3).
collective.profiler looks promising, and installs, but doesn't let me profile the __call__ method of a View, because the method doesn't have a __dict__ attribute.
Have a look at repoze.profile and it's documentation. It runs as WSGI middleware component which aggregates profiling data across all requests to the WSGI application.
The ZopeProfiler in Version 2.0.2 works just fine with Plone 4.1

Resources