-
Notifications
You must be signed in to change notification settings - Fork 72
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
.exe
could be added to custom builds if the extension is missing
#1339
Comments
Ah I see, because you're using a custom dist command, you need to manually specify to The immediate workaround is to go full makefile and reimplement exe ext logic yourself but nobody wants that, so I'm just mentioning it for the sake of context. I do wonder if go has some way to ask for this in a way where it picks the ext properly, though. cargo-dist fudging .exe is certainly a way to handle that, although I worry it could cause exciting accidents (although those accidents would already happen on linux so maybe it's fine actually?). another option would be for us to finally add templating to some of these inputs so you could write "go -o example{exe_ext}" and cargo-dist would substitute it, although that seems like a pretty heavy hammer here. ...kinda coming around to the "we do exe fudging" solution, strange as it is. |
Could you expand on the templating option? I'm backtracking a little on the original ask. Should I the author of the binary not ensure exactly how my application is spelt? Might be bad practice, but should I be able to call it on; mac, my_cli; linux, my_super_cli; windows, my_amazing_cli.exe? The point I'm trying to make is I think cargo dist should package whatever I call it, but it could/should lint for the |
Breaking this up into parts binary extensionsAs far as the final file name we package in archives / unpack to systems: extension isn't really negotiable, and if we were to attempt to let you mess with it we'd just be letting you shoot yourself in the foot for no reason. On windows the OS relies on the .exe extension to know that it's a runnable executable, unlike macos/linux. If you omit it the binary won't run. Also if Conversely, on linux/macos if you were to try to install it as binary namesWe have several features for renaming/aliasing binaries but none of them are configurable per-platform, because, well, that would be confusing. As you say, it's not a good practice. People want stuff to work the same on different platforms, and they're relying on us to ensure that. wrt goIn this specific case, the go compiler actually is aware of this and automatically adds .exe to the end of outputs but apparently when wrt future workIf there's something to do in this issue for cargo-dist I would maybe consider an implicit internal rule in cargo-dist that if it's looking for |
Testing out cargo dist on a basic Go project here: https://github.com/alexanderjophus/hello-world-go/tree/005e332f775dd79568c3a94ae192045b786741f2
Note: I haven't developed anything for windows before, so not sure how I should handle .exe, however I think that cargo dist should handle renaming the binary from
my_binary
tomy_binary.exe
.This was the error from that run: https://github.com/alexanderjophus/hello-world-go/actions/runs/10433209110/job/28894711643
The text was updated successfully, but these errors were encountered: