Swift error on Windows: invalidManifestFormat: Missing or empty JSON output from manifest compilation - swift

I've installed Swift 5.6.1 on my Windows 10 machine, including all the necessary Visual Studio components, but I can't seem to build anything. Even just running the following set of commands in git bash results in an error:
mkdir swiftTest
cd swiftTest
swift package init --type executable
swift build
Specifically, the swift build command gives the following errors:
warning: Failed creating default cache location, Error Domain=NSCocoaErrorDomain Code=256 "(null)"
'swiftTest': error: invalidManifestFormat("Missing or empty JSON output from manifest compilation for swiftTest", diagnosticFile: nil)
The error message seems surprisingly rare -- the top google results were the source of the program that generated that error, and an unrelated error with similar wording from a ReactJS application.
Do I just have to add some flags to the swift build command, or is there something else wrong with my setup?

In my case what fixed it was invoking the command from a Visual Studio Developer Command prompt.

Related

Vscode : Command 'CMake: Configure' resulted in an error (No usable generator found)

When I am configuring the CMake for vscode,I encounter a very puzzling problem.I follow the steps of Microsoft's vscode official documentation to configure CMake for vscode,and everything is good.I can finish the 'F5' debugging operation and running the project in the vscode.
However,later while configuring vscode for cmake with "cmake.generator": "Ninja" and using the CMake:Configure command, vscode generates an error——
Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings. json, your Kit configuration or Path variable
The following output[1] of the CMake Tools Extension indicated that it tried to find the new CMake generator but not found.
Command 'CMAKE:Configure' result in an error (No usable generator found.)
[rollbar] Unhandled exception: Unhandled Promise rejection: configure Error: No usable generator found.
I read the CMake official doucument,searched the problem in google but I can't find out why.
[1] the detailed error prompts

How to config CDT debug for cygwin?

I am new to eclipse CDT with cygwin. I just created a HelloWorld C++ project.
The built exe works in cygwin.
If I click the exe in file in file explorer, it says that it can not find cygwin1.dll. This error can be resolved by adding C:\cygwin64\bin to the Path env variable.
If I try to debug directly, I got the following errors:
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Error creating process /cygdrive/c/WINDOWS/system32/C:/Users/Cheng_g15klso/Documents/Proj/HelloWorld/C:/Users/Cheng_g15klso/Documents/Proj/HelloWorld/Debug/HelloWorld.exe, (error 2).
The above diagnosis seems to point to lacking of C:\cygwin64\bin, so I add C:\cygwin64\bin to Path env variable in the env var tab of the debug config, but the result is the same.
My questions:
How to solve this issue?
Where to find a list of error to decode error 2?
It seems that the latest gdb above version 9.2-1 is wrong: https://www.eclipse.org/forums/index.php/t/1105969/
I have downgrade my gdb and gcc for cgywin to cure the issue

swift-package does not exist on my toolchain

I am following some tutorials, basically trying to start an echo server in swift, without xcode, just command line and plain text editors, so I can get a grasp of the ecosystem
but I found this error for which there seems to be no solution already online
swift package init --type executable
error: unable to invoke subcommand: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.14.xctoolchain/usr/bin/swift-package (No such file or directory)
It looks like I was pointing to the Swift compiler in the OS toolchain (which doesn't have swiftpm)
So after running
export TOOLCHAINS=default swift package init --type executable
The command worked successfully

Why do i get this error message when trying to add a new framework using carthage?

I want to add a FrameWork to this app I'm working on. It converts latitude and longitude coordinates to UTM coordinates.
I added this to the cartfile:
github "peterringset/UTMConversion" ~> 1.1
But when i run this code in the terminal to clone the framework:
carthage update --platform iOS
I get this error message:
A shell task (/usr/bin/env git clone --bare --quiet https://github.com/peterringset/UTMConversion.git /Users/Fallet/Library/Caches/org.carthage.CarthageKit/dependencies/UTMConversion) failed with exit code 128:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
I've used other external frameworks like this, and it used to work just fine.. Any idea how I can fix this?
The problem occurs due to a change in username by the publisher of his GitHub account. If you notice the link to the repository is https://github.com/wtw-software/UTMConversion while the Carthage reference is "peterringset/UTMConversion". I was able to solve it by changing the Carthage reference to "wtw-software/UTMConversion". But then you will get this error if you are on Swift 3 or below and Xcode 8 or below.
Task failed with exit code 65.....This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details
So I digged into the logs and found this:
Check dependencies
“Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
** BUILD FAILED **
I googled around this error and it looks like the project is developed with Swift 4 and with Xcode 9.

Mongodb Error on running phpunit test

I tried to run mongdodb's driver test using phpunit as stated at http://www.php.net/manual/en/mongo.testing.php but it seems to have a problem with a MongoInt32Test.php filew.
# phpunit tests/mongosuite.php
Warning: require_once(MongoInt32Test.php): failed to open stream: No such file or directory in C:\Documents and Settings\owner\Desktop\mongo-php-driver\tests\MongoSuite.php on line 4
Fatal error: require_once(): Failed opening required 'MongoInt32Test.php' (include_path='.;\programming_tools\xampp-portable\php\PEAR') in C:\Documents and Settings\owner\Desktop\mongo-php-driver\tests\MongoSuite.php on line 4
I am using a php_mongo-1.3.1-5.4-vc9.dll and running mongodb 2.0.8 in windows xp. Anybody knows how to fix this? I can't find MongoInt32Test.php anywhere.
The PHPUnit tests in the extension are legacy tests and are no longer supported. I created a ticket, PHP-695, to remind us to remove mention of them from the documentation. All extension tests are phpt files, and instructions for executing them are documented in the GitHub repository.