Open rogerluan opened 3 years ago
What's going on in your CI that CommandLine.arguments
returns /_test.swift
? These are supposed to be the launch arguments of the tool, but we don't have arguments that take files 🤔 I assume the way you are calling it is what is causing it to pass our tests and not your CI.
There was one more place in that PR that changed the processinfo stuff, I think changing those two parts should fix it.
Our CI calls it like this: swiftinfo
only (there's another place that invokes swiftinfo -release
but we don't even have to call that for it to crash)
The test.swift was a .swift script I wrote to test those 3 different paths/arguments 🙈
Your suggestion might work, I just haven't had the opportunity to test it
I would guess that there's something in the environment (or if you call it from a swift script) that adds more launch arguments, and then the logic of getting the script folder gets screwed up. Obviously that is a dumb excuse so we should just change it to what it was before 😛 But this is quite unexpected, I didn't know CommandLine behaved like this.
I made the changes to revert it, but your Error: Unknown option '-r'
errors are something else. We are using an special option in the argument parser to allow "custom arguments" and it works fine when called from the terminal/makefile, so there's something else in your case causing this
Aaaactually, I found out the problem. The argument parser's custom arguments only work if you follow the right naming scheme (-
for letters and --
for everything else). Your CI is failing because your argument needs to be --release
, not -release
. I updated the docs to reflect that now.
I tested it and it seems to work (as of current master) 👍 nice find @rockbruno ! 💪
Feel free to close this issue once a new release is submitted 😊
Hey 👋
After the latest release https://github.com/rockbruno/SwiftInfo/releases/tag/2.3.14 I couldn't get SwiftInfo to work.
On CI it triggers weird and misleading errors (e.g. Error: Unknown option '-u', although I'm not passing any -u option). On my local machine, attempting to run the same command than CI (
swiftinfo -release
) I'm getting this:I believe this has to do with the major refactor that happened here: https://github.com/rockbruno/SwiftInfo/pull/54
Attempting to run
swiftinfo -version
would work before. Now it throws:I'm assuming we should all forcefully adhere to the new API, so then this should work:
swiftinfo --version
, but:I noticed that amongst other things, that PR changed instances of
ProcessInfo.processInfo.arguments
withCommandLine.arguments
and those are not interchangeable. See:Outputs:
So that may be the root cause of the issue, but even after fixing that, I couldn't have it find my
Infofile.swift
anymore. At this point I'm just gonna rollback to the previous release that is stable and freeze it there for awhile 😞Quick feedback
The last release should've been a major bump IMO, since it broke existing APIs (it was not backwards compatible). Moreover, looks like it wasn't well tested before being released 😬 I'm just leaving a constructive feedback here 🙈 🤗 We currently use this in production, so stability is important 🙏
Appreciate all the hard work towards this great tool! 🚀