-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
The outputFile was only being set for darwin universal builds. I move… #2358
The outputFile was only being set for darwin universal builds. I move… #2358
Conversation
Thanks for this @gwynforthewyn! @Snider - have you been able to test this? Thanks. |
I'm very happy to add suggested test cases to the testing script, or to rewrite in a more useful format. |
Appreciate that @gwynforthewyn - this is a small change so I'm ok merging. Edge cases will appear quickly if there are any 👍 Thanks for taking the time to do this 🙏 |
@leaanthony that's great news!! For what it's worth, checking the wails master commits (https://github.com/wailsapp/wails/commits/master) it looks like this hasn't been merged just yet. |
Any chance you could update the CHANGELOG in the website directory? |
…d the variable assignment to a location where it will take place for all builds. The ProjectData entries are used in generating the .app plist file, so setting them here ensures that the app will run with the custom binary name.
7dcde48
to
6325a44
Compare
@leaanthony done! See what you think |
Awesome! Thank you so much 🙏 |
@gwynforthewyn - looks like the change affects removal of the windows syso file which seems odd! https://github.com/wailsapp/wails/actions/runs/4266942411/jobs/7428093337#step:6:99 |
Does this fix the problem that I'm having here: # Build Options
Platform(s) | darwin/universal
Compiler | /Users/runner/.asdf/installs/golang/1.18.3/go/bin/go
Skip Bindings | false
Build Mode | production
Frontend Directory | /Users/runner/work/discord-image-browser/discord-image-browser/frontend
Obfuscated | false
Skip Frontend | false
Compress | false
Package | true
Clean Bin Dir | false
LDFlags |
Tags | []
Race Detector | false
Output File | discordimagebrowser-darwin-universal 👈🏻 what I want I want • Compiling application: Building AMD64 Target: /Users/runner/work/discord-image-browser/discord-image-browser/build/bin/discordimagebrowser-darwin-universal-amd64
INFO Build command: go build -tags desktop,wv2runtime.download,production -ldflags "-w -s" -o /Users/runner/work/discord-image-browser/discord-image-browser/build/bin/discordimagebrowser-darwin-universal-amd64
...
INFO Build command: go build -tags desktop,wv2runtime.download,production -ldflags "-w -s" -o /Users/runner/work/discord-image-browser/discord-image-browser/build/bin/discordimagebrowser-darwin-universal-arm64 k, universal means two binaries. amd64 and arm64. • Packaging application: Done.
Built '/Users/runner/work/discord-image-browser/discord-image-browser/build/bin/discord-image-browser.app/Contents/MacOS/discord-image-browser' in 3m56.152s. Where did i asked for
Seems like there's some boundary here that needs to be walked back or redefined:
If we look over in the https://github.com/dAppServer/wails-build-action we see that there are infact many more steps required to properly package a windows or macosx app.
So either:
|
options.ProjectData.Name = outputFile | ||
options.ProjectData.Info.ProductName = outputFile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these two being set here? I'd want my structure to be /Applications/{{.Name}}.app/Contents/MacOS/{{.Outputfilename}}
. This is because I want the app name to be capitalized and the executable name to be lower case. So /Applications/MyApp.app/Contents/MacOS/myapp
.
…d the
variable assignment to a location where it will take place for all builds.
The ProjectData entries are used in generating the .app plist file, so setting them here ensures that the app will run with the custom binary name.
===
#2290
I wrote a bash script that runs the test cases. It's available at https://gist.github.com/gwynforthewyn/f045187d15f8be1a25d6be52f50e7497 - I didn't know whether there was a good location in the wails source repo for this file, so it's in a gist right now. Simply copy the script and put it anywhere on your file system to run it; it manages its own state internally and only relies on
wails
being inPATH
, and maybe a macOS userland too.Test cases in the test script
The test case the script covers is running a
wails build
with the default build options, and then runwails build -o ROFLCOPTER
with the and see whether the layout on the file system is the same or different. This script generates a shasum from the file system layout to validate the difference. As the macos builds need to support both universal and single architecture builds as explicit test cases, as they use different logical paths internally in the build subcommand but both should respect the -o flag, there is 1 test cases but on 2 architectures, for a total of 2 test cases.To achieve these two test cases, the script initialises a wails project in a temporary directory, then runs in succession the following commands, capturing the state of the
build/
directory after each build command:Then it does the same file system layout check for the architecture "darwin/universal".
Finally, it cleans the temporary test file system.
Usage
To use it:
The script has a built in help message you can activate with
--help
Here's the output using the current version of wails 2.3.1:
If you want to visually inspect a record of the data on the temporary file system, you can prevent the script from cleaning up the temporary file system it uses. This is detailed in the help message, but worth mentioning: