-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swift fatal error on Ubuntu 16.04 (also command line arguments parsing issues) #4
Comments
Hello, Thank you |
Thank you, that fixes the non-responsiveness on output files! However, the second crash is still happening for me in the exact same way. I downloaded swift 4.0 (I was using 4.1.2) to see if it made a difference, but I got a similar crash:
I traced it to line 51 of PhotonFileHandler.swift with the help of GDB and the dumped core file though (had to run
This is what line 51 looks like: return try! Data(contentsOf: URL(fileURLWithPath: Bundle.main.path(forResource: "template", ofType: "photon") ?? "")) I also thought maybe I was missing some swift dependency or something, since I had installed swift "manually" instead of using your install script for swiftenv, so I tried that then.
Then I added the swiftenv directory to my PATH, then I ran I don't know if it's an issue with swift or the code to be honest. I'm hoping the error makes sense to you! |
Ok I have t further investigate it. It should work fine both with swift 4.0 and 4.1.2. Also swiftenv is not mine ;) |
I know swiftenv isn't yours, I just wanted to follow the exact steps you used in case I missed something! I am indeed using Ubuntu 16.04 (like the title says). When I ran I do have the aux/template.photon file, but I checked and noticed |
Indeed it is not supposed to return nil, I have a solution but I will only be able to commit it by tomorrow. |
It turns out that just copying the template.photon file to the .build/debug directory made it work! 🎉 Apparently it was looking for it in the wrong place.
This is what I'll be doing for now! Edit: may I suggest adding a check on the input image dimensions? I was momentarily scared that when I placed my 2560x1440 bmp file (instead of 1440x2560) the output file's figure was garbage. Again, thanks for this useful tool! |
@tlongeri cool. Still, I am removing that dependency so we can avoid this can of issues in the future and have better code. |
Hi, I built pcb2photon on Ubuntu 16.04 as follows:
When running
pcb2photon
at first I got no responsiveness at all (terminated instantly with no shell output and no files being generated), but soon I realized some error messages do work$ ./pcb2photon test.png -t Error: 01 Invalid value for t. $
I have zero experience with swift, but after looking at the code I changed the following (lines 147-152 of Converter.swift):
into
Now, this didn't fix the non-responsiveness if I didn't specify an output file, or if I didn't specify anything at all, but at least I could get past the parsing of the arguments now.
After building with that change, I tried again:
This time it took a while before crashing, so it looked like it was actually doing something. I omitted logging messages I added into the code, but I'm quite sure that the arguments were parsed correctly and it crashed deeper in the program.
That's as far as I got. I'm not sure what is causing this error, so I would really appreciate it if you help out. This seems like a great tool that could easily save someone like me several hours of work (who just discovered the most available means of getting some quick PCBs has turned out to be printing them in our DLP printer).
The text was updated successfully, but these errors were encountered: