tinygo
tinygo copied to clipboard
device: change the import path
I moved the files under device/ to a different location. For testing purposes, I've put it at github.com/sago35/device, but will eventually put it at tinygo.org/x/device.
This PR is related to #1780 .
@aykevl Currently, import has failed. I don't know what I need to do to fix this.
https://github.com/tinygo-org/tinygo/blob/device-files/src/runtime/arch_386.go#L3
=== RUN TestCompiler
=== RUN TestCompiler/basic.go
compiler_test.go:75: failed to create target machine: ../../.cache/tinygo/goroot-go1.14.15-8f5af9189e0ae0f6e4ec25cf171e364cb0d96a0f78868f1f955125c96befb907/src/runtime/arch_386.go:3:8: cannot find package
=== RUN TestCompiler/pointer.go
compiler_test.go:75: failed to create target machine: ../../.cache/tinygo/goroot-go1.14.15-8f5af9189e0ae0f6e4ec25cf171e364cb0d96a0f78868f1f955125c96befb907/src/runtime/arch_386.go:3:8: cannot find package
=== RUN TestCompiler/slice.go
compiler_test.go:75: failed to create target machine: ../../.cache/tinygo/goroot-go1.14.15-8f5af9189e0ae0f6e4ec25cf171e364cb0d96a0f78868f1f955125c96befb907/src/runtime/arch_386.go:3:8: cannot find package
=== RUN TestCompiler/string.go
compiler_test.go:75: failed to create target machine: ../../.cache/tinygo/goroot-go1.14.15-8f5af9189e0ae0f6e4ec25cf171e364cb0d96a0f78868f1f955125c96befb907/src/runtime/arch_386.go:3:8: cannot find package
=== RUN TestCompiler/float.go
compiler_test.go:75: failed to create target machine: ../../.cache/tinygo/goroot-go1.14.15-8f5af9189e0ae0f6e4ec25cf171e364cb0d96a0f78868f1f955125c96befb907/src/runtime/arch_386.go:3:8: cannot find package
=== RUN TestCompiler/interface.go
compiler_test.go:75: failed to create target machine: ../../.cache/tinygo/goroot-go1.14.15-8f5af9189e0ae0f6e4ec25cf171e364cb0d96a0f78868f1f955125c96befb907/src/runtime/arch_386.go:3:8: cannot find package
=== RUN TestCompiler/func.go
compiler_test.go:75: failed to create target machine: ../../.cache/tinygo/goroot-go1.14.15-8f5af9189e0ae0f6e4ec25cf171e364cb0d96a0f78868f1f955125c96befb907/src/runtime/arch_386.go:3:8: cannot find package
--- FAIL: TestCompiler (1.49s)
--- FAIL: TestCompiler/basic.go (0.22s)
--- FAIL: TestCompiler/pointer.go (0.29s)
--- FAIL: TestCompiler/slice.go (0.27s)
--- FAIL: TestCompiler/string.go (0.20s)
--- FAIL: TestCompiler/float.go (0.12s)
--- FAIL: TestCompiler/interface.go (0.20s)
--- FAIL: TestCompiler/func.go (0.20s)
FAIL
FAIL github.com/tinygo-org/tinygo/compiler 1.586s
Rebased to the latest dev branch. Still doesn't pass the test.
The tests that are failing when make smoketest is executed are as follows.
/c/tinygo/tinygo/build/tinygo build -size short -o test.hex -target=pca10040 examples/test
C:\Users\sago3\AppData\Local\tinygo\goroot-go1.16.5-55879651303f171eac85ae573cde226e44ca7379b8a4ca9a43f1c1faf2da2809-syscall\src\runtime\arch_cortexm.go:6:2: cannot find package
C:\Users\sago3\AppData\Local\tinygo\goroot-go1.16.5-55879651303f171eac85ae573cde226e44ca7379b8a4ca9a43f1c1faf2da2809-syscall\src\runtime\runtime_nrf.go:7:2: cannot find package
/c/tinygo/tinygo/build/tinygo build -size short -o test.gba -target=gameboy-advance examples/gba-display
C:\Users\sago3\AppData\Local\tinygo\goroot-go1.16.5-55879651303f171eac85ae573cde226e44ca7379b8a4ca9a43f1c1faf2da2809-syscall\src\runtime\arch_arm.go:5:8: cannot find package
The make test also fails in some cases.
Here are some examples of tests that fail
CGO_CPPFLAGS="-DCINDEX_NO_EXPORTS -IC:/tinygo/tinygo/llvm-project/llvm/include -IC:/tinygo/tinygo/llvm-build/include -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:/tinygo/tinygo/llvm-build/tools/clang/include -IC:/tinygo/ti
nygo/llvm-project/clang/include -IC:/tinygo/tinygo/llvm-project/lld/include" CGO_CXXFLAGS="-std=c++14" CGO_LDFLAGS="-static -static-libgcc -static-libstdc++ C:/tinygo/tinygo/llvm-build/lib/liblibclang.a -LC:/tinygo/tinygo/llvm-build/lib -Wl,--start-group -lclangAnalysis -lc
langAST -lclangASTMatchers -lclangBasic -lclangCodeGen -lclangCrossTU -lclangDriver -lclangDynamicASTMatchers -lclangEdit -lclangFormat -lclangFrontend -lclangFrontendTool -lclangHandleCXX -lclangHandleLLVM -lclangIndex -lclangLex -lclangParse -lclangRewrite -lclangRewriteF
rontend -lclangSema -lclangSerialization -lclangTooling -lclangToolingASTDiff -lclangToolingCore -lclangToolingInclusions -Wl,--end-group -lstdc++ -Wl,--start-group -llldCOFF -llldCommon -llldCore -llldDriver -llldELF -llldMachO -llldMinGW -llldReaderWriter -llldWasm -llldY
AML -Wl,--end-group -LC:/tinygo/tinygo/llvm-build/lib -lLLVMOption -lLLVMMCJIT -lLLVMLTO -lLLVMPasses -lLLVMObjCARCOpts -lLLVMExtensions -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMCoverage -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectoriz
e -lLLVMLinker -lLLVMIRReader -lLLVMFrontendOpenMP -lLLVMAsmParser -lLLVMXtensaDisassembler -lLLVMXtensaCodeGen -lLLVMXtensaAsmParser -lLLVMXtensaDesc -lLLVMXtensaInfo -lLLVMAVRDisassembler -lLLVMAVRCodeGen -lLLVMAVRAsmParser -lLLVMAVRDesc -lLLVMAVRInfo -lLLVMWebAssemblyDis
assembler -lLLVMWebAssemblyCodeGen -lLLVMWebAssemblyDesc -lLLVMWebAssemblyAsmParser -lLLVMWebAssemblyInfo -lLLVMRISCVDisassembler -lLLVMRISCVCodeGen -lLLVMRISCVAsmParser -lLLVMRISCVDesc -lLLVMRISCVUtils -lLLVMRISCVInfo -lLLVMAArch64Disassembler -lLLVMAArch64CodeGen -lLLVMAA
rch64AsmParser -lLLVMAArch64Desc -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMUtils -lLLVMARMInfo -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMCFGuard -lLLVMGlobalISel -lLLVMSelectio
nDAG -lLLVMAsmPrinter -lLLVMDebugInfoDWARF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMBitReader -lLLVMCore -l
LLVMRemarks -lLLVMBitstreamReader -lLLVMX86Desc -lLLVMMCDisassembler -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMBinaryFormat -lLLVMX86Info -lLLVMSupport -lLLVMDemangle -lpsapi -lshell32 -lole32 -luuid -ladvapi32 -lstdc++ -lversion" go test -v -buildmode exe -
tags byollvm -parallel 1 -run TestReflect -v ./transform
=== RUN TestReflect
=== PAUSE TestReflect
=== CONT TestReflect
C:\Users\sago3\AppData\Local\tinygo\goroot-go1.16.5-55879651303f171eac85ae573cde226e44ca7379b8a4ca9a43f1c1faf2da2809\src\runtime\arch_386.go:3:8: cannot find package
FAIL github.com/tinygo-org/tinygo/transform 1.267s
FAIL
All of these are probably caused by the following
When I set up GOROOT and run go list, it cannot find the github.com/sago35/device package.
https://github.com/tinygo-org/tinygo/blob/64d048c47c95bc0a70b4cff109afc1f9039705a4/loader/loader.go#L106-L109
Here's where it actually fails.
$ GOROOT=/c/Users/sago3/AppData/Local/tinygo/goroot-go1.16.5-55879651303f171eac85ae573cde226e44ca7379b8a4ca9a43f1c1faf2da2809 GOOS=linux GOARCH=386 go list -json -deps -tags "linux 386 tinygo gc.conservative scheduler.tasks serial.none" ./transform/testdata/reflect.go > out
.txt && echo OK
C:\Users\sago3\AppData\Local\tinygo\goroot-go1.16.5-55879651303f171eac85ae573cde226e44ca7379b8a4ca9a43f1c1faf2da2809\src\runtime\arch_386.go:3:8: cannot find package
@aykevl @deadprogram I don't know how to solve this problem. Is there anything I can do? Maybe we can move the device to tinygo.org/x/device if the following is resolved.
I forgot to write it down. The md5 displayed by make smoketest matches the md5 before and after the fix.
The following go-get will fail. I think go-list may be failing for the same reason.
$ GOROOT=/c/Users/sago3/AppData/Local/tinygo/goroot-go1.16.5-55879651303f171eac85ae573cde226e44ca7379b8a4ca9a43f1c1faf2da2809 GOOS=linux GOARCH=386 go get -v github.com/sago35/device
github.com/sago35/device
# github.com/sago35/device
dev\pkg\mod\github.com\sago35\[email protected]\asm.go:6:6: missing function body
dev\pkg\mod\github.com\sago35\[email protected]\asm.go:21:6: missing function body
info: https://github.com/golang/go/blob/master/src/cmd/go/testdata/script/build_overlay.txt#L165