Not able to compile swift on Ubuntu 18.04 - swift

I installed swift toolchain using instructions from swift.org. While compiling helloworld code I am getting below error.
warning: 'helloworld': failed loading cached manifest for 'helloworld': disk I/O error
error: 'helloworld': Invalid manifest
<unknown>:0: error: unable to open output file '/usr2/xyz/.cache/clang/ModuleCache/IJ5GUC7XMAO5/SwiftShims-1TLN9ZL6HKTHR.pcm': 'No such file or directory'
<unknown>:0: error: could not build C module 'SwiftShims'
I tried removing '/usr2/xyz/.cache/clang/ModuleCache', but did not work. Please help in resolving this issue.

Related

Unable to cross-compile Swift code on linux

When I try compile a swift code on linux (in my x64 machine), with the command swift build -c release --arch arm64 I am getting this error:
<unknown>:0: error: could not find module '_Concurrency' for target 'arm64-unknown-linux-gnu'; found: x86_64-unknown-linux-gnu, at: /home/kleber-manjaro/swift-5.5.2-RELEASE-ubuntu20.04/usr/lib/swift/linux/_Concurrency.swiftmodule
Anyone can tell me what is causing this and how to fix it?

Fatal error - cannot execute Fortran code in Eclipse compiler

The other night compiling Fortran in Eclipse was working for me, however, today I have been receiving this error:
gfortran: fatal error: cannot execute 'as': execvp: No such file or directory
compilation terminated.
It script builds but I would get the error:
Binary not found
Any idea on what I can do?
I cannot configure a build neither as no project can be searched for.

Swift compiling error: Module map file not found + Missing required module 'SwiftShims'

I keep getting these errors after mistakenly running pod update.
Spent the last couple of days searching for solution but nothing helped, some of my attemtps:
1) How to fix cocoapod .modulemap file not found
2) missing required module 'SwiftShims' error generated by Xcode in project
Tried all the mentioned solutions in these Q's and some other SO Q's and nothing helped.
Error:
<unknown>:0: error: module map file '/Users/admin/Library/Developer/Xcode/DerivedData/Demo-
dkfcfedygluokngempogitocknga/Build/Products/Debug-iphonesimulator/Charts/Charts.modulemap' not found
<unknown>:0: error: module map file '/Users/admin/Library/Developer/Xcode/DerivedData/Demo-
dkfcfedygluokngempogitocknga/Build/Products/Debug-iphonesimulator/Charts/Charts.modulemap' not found
<unknown>:0: error: missing required module 'SwiftShims'
This is my Podfile:
target "Demo" do
pod 'Firebase/Core'
pod 'Firebase/MLVision'
pod 'Firebase/MLVisionTextModel'
pod 'Charts', '3.2.0'
end
I'm running MacOS 10.13.6 with Xcode 10.1, Cocoa pods version is 1.7.1
I had the error while trying to compile from the .xcodeproj instead of the .xcworkspace
(Building a React Native with Okta)

Errors when running unit tests in Kitura

I am new to the Kitura and Xcode and facing some issues when adding test files.
It seems to be related to the #testing directive.
I have setup the same as shown on Kitura website.
When I invoke in the console swift build then swift test I get following error:
Compile Swift Module 'testTests' (1 sources)
Linking ./.build/debug/testPackageTests.xctest/Contents/MacOS/testPackageTests
Undefined symbols for architecture x86_64:
"__TFC4test3OkoCfT_S0_", referenced from:
__TFC9testTests8OkoTests8test_addfT_T_ in OkoTests.swift.o
"__TMaC4test3Oko", referenced from:
__TFC9testTests8OkoTests8test_addfT_T_ in OkoTests.swift.o
ld: symbol(s) not found for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: build had 1 command failures
error: exit(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/*user*/Projects/Kitura/test/.build/debug.yaml test
However when I comment out line #testable import test and type swift build then swift test then I get following error:
Compile Swift Module 'testTests' (1 sources)
/Users/*user*/Projects/Kitura/test/Tests/testTests/OkoTests.swift:6:17: error: use of unresolved identifier 'Oko'
let o = Oko()
^~~
<unknown>:0: warning: 'cacheParamsComputed' is deprecated
<unknown>:0: warning: 'cacheAlphaComputed' is deprecated
<unknown>:0: warning: 'keepCacheWindow' is deprecated
<unknown>:0: error: 'memoryless' is unavailable
Metal.MTLCommandBufferError:19:14: note: 'memoryless' has been explicitly marked unavailable here
case memoryless
^
<unknown>:0: error: build had 1 command failures
error: exit(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/*user*/Projects/Kitura/test/.build/debug.yaml test
When I try to test it from Xcode generated project instead (swift package generate-xcodeproj) then I get compile error:
Without Testing files, everything works properly.
Below I present project structure:
I believe the issue is that Swift is not able to compile unit tests for modules that contain a main.swift file (i.e., modules that are meant to be compiled into executables as opposed to libraries for use in other projects). I cloned your repo and was able to compile and run unit tests after 1) removing main.swift and 2) uncommenting the testable import statement.

Building Cyanogenmod from source - recipe for target failed (libnativehelper.so)

I'm getting the following error about an hour into my build of Cyanogenmod 12.1 for hlte, using the latest repo checkout. I am using Debian testing, have all dependencies installed as listed in Google's build guide and am using OpenJDK 7. I also have all proprietary files under vendor/samsung. What am I missing or what direction should I look in to solve this problem?
...
libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43
libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43
clang: error: linker command failed with exit code 1 (use -v to see invocation)
build/core/host_shared_library_internal.mk:44: recipe for target '/home/james/android/cm/out/host/linux-x86/obj32/lib/libnativehelper.so' failed
make: *** [/home/james/android/cm/out/host/linux-x86/obj32/lib/libnativehelper.so] Error 1