Open vikramsubramanian opened 4 months ago
Summary: Issue with building CLI binary as executable prior to zip/release.
To implement the feature described in the Jira ticket, you need to ensure that the CLI binary is marked as executable before it is zipped and released. Here's how you can do it:
.github/workflows/linux-precompiled-bin-workflow.yml
and .github/workflows/windows-precompiled-bin-workflow.yml
files, add a step after the build process to change the permissions of the CLI binary.chmod +x kuzu
to set the executable bit.Here's an example of how you can modify the Linux workflow:
- name: Set executable bit
run: chmod +x kuzu
Place this step right after the build step and before the artifact upload step.
Additionally, ensure that the packaging script that creates the zip file retains the executable bit. This can be done by using the tar
command with the correct options to preserve file permissions.
Here's an example of how you can modify the packaging script in tools/nodejs_api/package.js
:
console.log("Creating tarball...");
// Create the tarball
await new Promise((resolve, reject) => {
childProcess.execFile(
"tar",
["-czvf", "kuzu-source.tar.gz", "--preserve-permissions", "package"],
{ cwd: CURRENT_DIR },
(err) => {
if (err) {
reject(err);
} else {
resolve();
}
}
);
});
The --preserve-permissions
option tells tar
to preserve the file permissions (including the executable bit) when creating the archive.
Make sure to test the changes by running the modified workflow and packaging script, then downloading the resulting zip file and verifying that the CLI binary is executable upon extraction.
.github/workflows/linux-precompiled-bin-workflow.yml
This workflow is responsible for building the Linux precompiled binaries and should be modified to ensure the CLI binary is executable after unzipping.
This script is involved in the packaging process and may need to be updated to include setting the executable bit on the CLI binary before it is zipped.
.github/workflows/windows-precompiled-bin-workflow.yml
This workflow is responsible for building the Windows precompiled binaries and could be referenced for consistency, although the executable issue is specific to Linux/MacOS.
The current CLI downloaded via the URL (for example, [this one]( when unzipped just provides a file. The user has to manually convert the file to an executable on Linux/MacOS by typing
chmod +x kuzu
to allow it to be executed.Is there something that could be done during the build process that allows us to unzip the downloaded file directly as an executable? )