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

fix(cli): ensure gradlew is executable and does not use CRLF #10751

Merged
merged 5 commits into from
Aug 23, 2024

Conversation

lucasfernog
Copy link
Member

This is required due to a limitation of our template engine, which cannot preserve file permissions.

When you generate the Android project on Android and commit it, it will fail to run in CI (if you are running on UNIX) because it will lack the executable permissions. Plus if it uses CRLF it will also fail to execute (/usr/bin/env: ‘sh\r’: No such file or directory).

@lucasfernog lucasfernog requested a review from a team as a code owner August 23, 2024 11:49
Copy link
Contributor

github-actions bot commented Aug 23, 2024

Package Changes Through 4429a93

There are 5 changes which include tauri-cli with prerelease, @tauri-apps/cli with prerelease, tauri-codegen with prerelease, tauri-bundler with prerelease, tauri-utils with prerelease

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tauri-utils 2.0.0-rc.6 2.0.0-rc.7
tauri-bundler 2.0.1-rc.5 2.0.1-rc.6
tauri-runtime 2.0.0-rc.6 2.0.0-rc.7
tauri-runtime-wry 2.0.0-rc.6 2.0.0-rc.7
tauri-codegen 2.0.0-rc.6 2.0.0-rc.7
tauri-macros 2.0.0-rc.5 2.0.0-rc.6
tauri-plugin 2.0.0-rc.6 2.0.0-rc.7
tauri-build 2.0.0-rc.6 2.0.0-rc.7
tauri 2.0.0-rc.6 2.0.0-rc.7
@tauri-apps/cli 2.0.0-rc.7 2.0.0-rc.8
tauri-cli 2.0.0-rc.7 2.0.0-rc.8

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

amrbashir
amrbashir previously approved these changes Aug 23, 2024
let mut permissions = metadata.permissions();
let is_executable = permissions.mode() & 0o111 != 0;
if !is_executable {
permissions.set_mode(0o755);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we preserve previous permissions and only add 0o111 for execution bit? instead of always setting 0o755

@lucasfernog lucasfernog merged commit 2d31aef into dev Aug 23, 2024
14 of 15 checks passed
@lucasfernog lucasfernog deleted the fix/ensure-gradlew-executable branch August 23, 2024 13:49
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.

2 participants