Skip to content
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

CI enhancements: app bundling, build wasm #486

Merged
merged 23 commits into from
Jan 19, 2021
Merged

CI enhancements: app bundling, build wasm #486

merged 23 commits into from
Jan 19, 2021

Conversation

iceiix
Copy link
Owner

@iceiix iceiix commented Jan 18, 2021

Update configuration for GitHub Actions:

@iceiix
Copy link
Owner Author

iceiix commented Jan 18, 2021

Trying to create an .app bundle for macos-latest, built using https://github.com/burtonageo/cargo-bundle. It builds (locally) but when I double-click to run it, nothing happens. cargo bundle --example hello in https://github.com/burtonageo/cargo-bundle, in contrast, does build a working .app (was an icon and everything, showing a simple winit window).

cargo bundle --release
target/release/bundle/osx/Stevenarella.app/Contents/MacOS/stevenarella # runs ok
target/release/bundle/osx/Stevenarella.app # nothing?
open -R target/release/bundle/osx/Stevenarella.app # then double-click: nothing

Adding code in src/main.rs to write to a file, confirms the code is executed, just no window pops up...

Logging to a file (#359) would be helpful here to debug further

But the problem is the current working directory, std::env::current_dir() shows it is set to "/". Setting with std::env::set_current_dir() to a hardcoded path with the assets fixes the launch problem. Setting cwd to the same directory as the executable works:

if let Some(parent) = std::env::current_exe().unwrap().parent() {
⚠         std::env::set_current_dir(parent);
      }  

but then it downloads index/objects into Contents/MacOS. An app-specific prefs dir would make more sense, but on the other hand when launched from the CLI, or from Linux, may make sense to leave it as the current directory..

@iceiix iceiix changed the title GitHub Actions: CI enhancements for OS targets CI: app bundling Jan 19, 2021
@iceiix iceiix changed the title CI: app bundling CI: app bundling, build wasm Jan 19, 2021
@iceiix iceiix changed the title CI: app bundling, build wasm CI enhancements: app bundling, build wasm Jan 19, 2021
@iceiix iceiix mentioned this pull request Jan 19, 2021
29 tasks
@iceiix iceiix merged commit c7bdb60 into master Jan 19, 2021
@iceiix iceiix deleted the moreci branch January 19, 2021 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI/CD consolidation/enhancements: macOS .app bundling
1 participant