Preserve exec bit in CLI zip; document installation via mise#267
Draft
rolang wants to merge 1 commit into
Draft
Conversation
sbt's IO.zip uses java.util.zip which does not store Unix mode bits, so the executable bit on the native binary was lost in the archive and mise extracted it as 0644, producing 'Permission denied' on run. Shell out to the 'zip' CLI (available on the ubuntu/macos runners) which records the file mode in the entry's external attributes, so unzip/mise keep the 0755 mode after extraction. Also add a 'mise' subsection to the README so users can install via 'mise use -g github:rolang/dumbo@latest'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
buildCliBinaryso the executable bit survives in the archive.sbt.IO.zip(viajava.util.zip.ZipOutputStream) does not store Unix mode bits in the entry's external attributes, so the binary extracted as0644and mise producedPermission deniedon run. Replace it with a call to thezipCLI (zip -X -j), which records the file mode in the entry's external attributes, sounzip/mise restore0755after extraction. Thezipandchmodcommands are available on the ubuntu and macOS runners used by CI.#### misesubsection toREADME.mdanddocs/README.mdunder the command-line install instructions, showingmise use -g github:rolang/dumbo@latest(or themise.tomlconfig).Test plan
Generate CLI native binary (release)step producesmodules/cli/native/target/bin/dumbo-cli-<arch>-<os>.zipwhosedumboentry shows-rwxr-xr-xviaunzip -ZT.mise use -g github:rolang/dumbo@<tag>installs anddumbo --versionruns withoutchmod.dumbobinary.rename_exe = "dumbo"workaround; they are not affected by this change.