How to fix '[WARNING] The callable Microsoft.Quantum.Canon.InverseMod has been deprecated.' warning in Q#? - q#

In IntegerFactorization Q# sample in Microsoft/Quantum repository, there isn't InverseMod function. But when I compile and run the code, it produces a number of warnings "The callable Microsoft.Quantum.Canon.InverseMod has been deprecated in favor of Microsoft.Quantum.Math.InverseModI.". How can I fix it?
There is no word InverseMod anywhere in Shor.qs file.
I expect warning is disappear. Plese help me TT

This was caused by the use of the deprecated function InverseMod in arithmetic libraries used by the IntegerFactorization project.
The project has dependencies on several NuGet packages, among them Microsoft.Quantum.Standard which provides standard library functions, including modular arithmetic. This package used the deprecated function in its version 0.6.1905.301, which caused this runtime warning. If you check the source code of the package in Microsoft/QuantumLibraries repository, you'll notice that this has been fixed two days ago, so with the next release of the NuGet package this warning will disappear.
Edit: This should be fixed in release 0.7.1905.3109. The samples repository has been updated to use the new release; if you get the latest version of the repository and try running the project again the warning should go away.

Related

Swift Package Manager (SPM) and Cocoapod Dependency Conflict

Overview
I have two dependencies, one available as a Swift Package, and the other only available as a Cocoapod. The problem is that each has a dependency on a third package, which results in undefined behavior when multiple versions exist.
At a basic level, here is a graphic of my dependencies
APP imports:
B (SPM) imports:
C (SPM) imports:
D (SPM) <-
E (Pod) imports:
D (Pod) <-
I would like to remove the D (Pod) version and point to the D (SPM) version either via a Podfile script or build script.
More specific information:
I have a NetworkingService Swift Package that imports Firebase, and my main app imports the NetworkingService. My Podfile imports GoogleMLKit/PoseDetection. Firebase and PoseDetection share dependencies that result in undefined behavior (runtime crash) when a duplicate is present.
Note: This error should be reproducible by removing the intermediary NetworkingService package and importing Firebase to the main app as a Swift package.
Podfile
platform :ios, '15.0'
target 'MyApp' do
use_frameworks!
pod 'GoogleMLKit/PoseDetection', '2.5.0'
end
In Package.swift
.package(
name: "Firebase",
url: "https://github.com/firebase/firebase-ios-sdk.git",
.upToNextMajor(from: "8.10.0")
),
They duplicate a few dependencies, including GoogleUtilities and FBLPromises. Launching the app after pod install crashes with runtime exception:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FBLPromise HTTPBody]: unrecognized selector sent to instance 0x6000017685d0'
Searching that brought me to this GitHub issue where a contributor mentions:
The duplicate warnings are indicative of non-deterministic behavior. When there are multiple copies of a library, the right one may or may not be chosen.
I then attempted to refactor all Cocoapod dependencies with a modified version of this script I found linked on another StackOverflow post. The attempt was to make PoseDetection explicitly point to symbols from GoogleUtilitiesCopy and FBLPromisesCopy. But it seems that even the existence of these copies, despite pointing to the corresponding dependency, created undefined behavior.
Partial Workaround
If I run pod install followed by File > Packages > Update to latest package versions. The app will launch without an immediate runtime crash. However, I encounter other runtime crashes later within the app.***
Ideal Solution
I would like to remove the duplicate pod dependencies and point to the SPM versions either via the Podfile or a build phase script, but I'm not sure where to begin.
Firebase can be imported as a pod, but I do not want to do this because I have an existing SPM infrastructure that depends on Firebase. I'd prefer not to convert all of these packages into pods.
The main problem with SPM and Cocapods is that:
SPM is not aware of Cocapods and Cocapods not aware of SPM.
I had a similar situation where:
pod library depends on some Library networking
SPM library also depends on the same Library networking.
There are two solutions I think are worth trying.
1.) remove the pod and try to use the XCFramework version of it (should be available). that means you should manually add the library to your project and it should be selected as embed & sign and also as required.
2.) you can convert the pod library to SPM by using a simple binary target. Basically, you need to create a Package file that points to the XCFramework in its archived version (hence it should be a zip file). that way the SPM graph will handle it by itself.
I know it's not ideal, but these two approaches works for me.

Groovy:General error during semantic analysis: java.lang.NoSuchMethodError:

Imported the gradle project from the "complete" folder and received the following error:
Groovy:General error during semantic analysis:
java.lang.NoSuchMethodError: 'org.codehaus.groovy.ast.expr.Expression org.codehaus.groovy.ast.tools.GeneralUtils.propX(org.codehaus.groovy.ast.expr.Expression, java.lang.String)'
I am using the latest version of Eclipse, 2020-12, with groovy tools installed.
From grails guide
https://guides.grails.org/gorm-without-grails/guide/index.html
Downloaded code sample from github
https://github.com/grails-guides/gorm-without-grails.git
It seems likely to be a version mismatch, but I cannot determine how to correct this problem.
I have tried to delete the offending file, src/main/groovy/demo/domain/Manufacturer.groovy, and the error appears on the file in this package on line 1.
The error does not appear in any other package. I have done the usual internet searches for resolutions that apply, but have thus far been unable to find a suitable solution. I am hopeful for a suggestion?
I think this error comes from an AST transform that references the older signature of GeneralUtils#propX. This method used to return Expression and was changed to return PropertyExpression.
The bridge method for binary compatibility was missing in groovy-eclipse. https://github.com/groovy/groovy-eclipse/commit/f6f448675d95f858b4ec65b6fc8e55f27ccaaa94

Pharo on RaspberryPi: Module not found at startup

I am on a raspbian stretch system with the spur32 VM for ARM and a Pharo 7 image. At Startup I always get an exception: Error - Module not found.
It seems to have to do with lgitlibrary. I really cannot figure out what this error is about.
Any ideas?
Thanks,
Henrik
I see. If you check #unixModuleName
unixModuleName
| pluginDir |
pluginDir := Smalltalk vm binary parent.
#('libgit2.so' 'libgit2.so.0')
detect: [ :each | (pluginDir / each) exists ]
ifFound: [ :libName | ^ libName ].
self error: 'Module not found.'
Here you have your error message: self error: 'Module not found.'
You probably have libgit2.so or libgit2.so.0 missing (or dependencies). You may suffer with similar problem as me: Getting error when adding OSSubprocess to my Pharo 6.1 on Centos 7.4x.
You should check the dependencies with ldd (check my question for details).
Edit Adding information due to comment:
I have yet to use IceBerg (the Pharo's git integration). My guess, would be to "(re-)initialize it": (Smalltalk at: #LGitLibrary) initialize.
For more information, I recommend reading these: pharo's iceberg and some Pharo project that uses git like pharo-contributor and checking blog pharoweekly (for some information about the pharo-contributor) - https://pharoweekly.wordpress.com/2018/04/24/pharo-contributor-to-contribute-to-pharo.
You may want to use some guide "How to use git and github with Pharo". Which was done by Peter Uhnak (you can find him on SO).
I had the similar problem and I needed to build libgit2 library from source using this instructions. The basic build didn't work because Pharo wasn't able to initialize the library. I compiled it again with parameter -DSTDCALL=ON an it works.

swift package --verbose generate-xcodeproj giving error: reachedTimeLimit

I'm attempting to generate an Xcode project and am getting:
error: reachedTimeLimit
Unfortunately I don't see a lot of help googling this error nor does there appear to be a way to extend whatever the current time limit is from the command line.
Any ideas?
There is a hardcoded 10 second time limit for package resolving baked into SPM - see the code in DependencyResolver.swift.
Line 1365 has let timeLimit = 10, and there is no way of changing this externally, except of course building your own version of SPM with a higher timeout.
I haven't dug deep enough into the resolver algorithm, but it seems that your dependency tree is pretty complex for the resolving to take so long.

Update from Qt 5.5.1 to Qt 5.6 leads to linking errors

I just try to update a project from Qt5.5.1 to Qt5.6 and now it fails during linking.
C:/Qt/Qt5.6.0/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lC:/Qt/Qt5.6.0/5.6/mingw49_32/lib/liblibQt5Core.a
C:/Qt/Qt5.6.0/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lC:/Qt/Qt5.6.0/5.6/mingw49_32/lib/liblibQt5Sql.a
C:/Qt/Qt5.6.0/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lC:/Qt/Qt5.6.0/5.6/mingw49_32/lib/liblibQt5Gui.a
C:/Qt/Qt5.6.0/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lC:/Qt/Qt5.6.0/5.6/mingw49_32/lib/liblibQt5Widgets.a
collect2.exe: error: ld returned 1 exit status
The programm compiled fine with QT5.5.1 using qbs.
Now I added the new QT Version and I get these errors.
I have no idea, why qbs adding two time the "lib" prefix, nor why qbs is trying to use it at all. This program should use the shared libraries of Qt.
Could someone give me a hint, how I can fix this? Or what the cause of the problem might be?
This issue was resolved in qbs 1.5.0.