PkgTool crashes if pkg/Project.gp4 doesn't exists
bucanero opened this issue · comments
I'm doing my first steps with the Open Orbis toolchain, and found an issue when trying to build a pkg
if the Project.gp4
doesn't exist.
To reproduce, any orbis-sample should be enough. Just delete the pkg/Project.gp4
, and run make pkg_build
you'll get a dotnet crash, with the unhandled exception:
~/github/orbisdev-samples/tetris % make pkg_build
cp bin/homebrew.self pkg/eboot.bin && cd pkg && pkgTool pkg_build Project.gp4 . && cp *.pkg ../bin/
Unhandled exception. System.IO.FileNotFoundException: Could not find file '/Users/dparrino/github/orbisdev-samples/tetris/pkg/Project.gp4'.
File name: '/Users/dparrino/github/orbisdev-samples/tetris/pkg/Project.gp4'
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at PkgTool.Program.<>c.<.cctor>b__6_2(String[] args) in /Users/dparrino/github/orbisdev/build/LibOrbisPkg/PkgTool/Program.cs:line 65
at PkgTool.Verb.<>c__DisplayClass4_0.<Create>b__0(Dictionary`2 _, Dictionary`2 _2, String[] a) in /Users/dparrino/github/orbisdev/build/LibOrbisPkg/PkgTool/Program.cs:line 591
at PkgTool.Verb.Run(Verb[] verbs, String[] args, String name)
at PkgTool.Program.Main(String[] args) in /Users/dparrino/github/orbisdev/build/LibOrbisPkg/PkgTool/Program.cs:line 21
/usr/local/orbisdev/bin/pkgTool: line 1: 93573 Abort trap: 6 dotnet $ORBISDEV/bin/pkgtools/PkgTool.Core.dll $* 2>&1
make: *** [pkg_build] Error 134
also if input package doesn't exist
Unhandled Exception: System.IO.FileNotFoundException: Could not find file 'F:\PS Tools\PS4\zzz.pkg'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileSystemRights rights, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.MemoryMappedFiles.MemoryMappedFile.CreateFromFile(String path, FileMode mode, String mapName, Int64 capacity, MemoryMappedFileAccess access)
at PkgTool.Program.<>c.<.cctor>b__6_4(Dictionary2 flags, Dictionary2 optionals, String[] args)
at PkgTool.Verb.Run(Verb[] verbs, String[] args, String name)
at PkgTool.Program.Main(String[] args)
regards
If the project file doesn’t exist, then you can’t build a PKG. I don’t really see a point catching these exceptions when the error message is already there. If someone wanted to add all the exception catching code the PRs are open...