Skip to content

Add parameter linux64RemoveExecutableExtension#726

Open
kitlith wants to merge 3 commits intogame-ci:mainfrom
kitlith:linux-extension
Open

Add parameter linux64RemoveExecutableExtension#726
kitlith wants to merge 3 commits intogame-ci:mainfrom
kitlith:linux-extension

Conversation

@kitlith
Copy link

@kitlith kitlith commented Aug 19, 2025

Changes

  • Add parameter linux64RemoveExecutableExtension
    • Allows the end-user to restore the default unity behavior of using the file extension .x86_64, instead of no file extension.
    • Defaults to true for now, but is named such to highlight it as a non-default with an eye to flip the default on the next version bump.

Related Issues

Successful Workflow Run Link

PRs don't have access to secrets so you will need to provide a link to a successful run of the workflows from your own
repo.

  • ...
    • is there documentation (aside from reading all the workflow files) on what secrets this repo expects?

Checklist

  • Read the contribution guide and accept the
    code of conduct
  • Docs (If new inputs or outputs have been added or changes to behavior that should be documented. Please make a PR
    in the documentation repo)
    • There may yet be some bikeshedding to do on the naming/precise functionality of the new input, since I never received any feedback on the initial issue. I'd like to wait until that is settled before I open a documentation PR.
  • Readme (updated or not needed)
  • Tests (added, updated or not needed)

Summary by CodeRabbit

  • New Features
    • Added optional linux64RemoveExecutableExtension input parameter for Linux 64-bit builds. When enabled (default), removes the .x86_64 file extension from executable outputs, restoring behavior from earlier versions.

@github-actions
Copy link

Cat Gif

@coderabbitai
Copy link

coderabbitai bot commented Aug 19, 2025

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 96c7c4ce-4bb3-44a0-9707-f772a9d3c5bf

📥 Commits

Reviewing files that changed from the base of the PR and between e2cdacd and 37698d9.

⛔ Files ignored due to path filters (2)
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (5)
  • action.yml
  • src/model/build-parameters.test.ts
  • src/model/build-parameters.ts
  • src/model/input.test.ts
  • src/model/input.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/model/build-parameters.test.ts
  • action.yml
  • src/model/input.ts

📝 Walkthrough

Walkthrough

A new boolean input parameter linux64RemoveExecutableExtension is added to control whether the .x86_64 file extension is removed from StandaloneLinux64 builds. The parameter is wired through the Input class, action.yml configuration, and BuildParameters.parseBuildFile to conditionally append the extension based on platform and flag value.

Changes

Cohort / File(s) Summary
Configuration & Input Definition
action.yml, src/model/input.ts, src/model/input.test.ts
Added new optional input linux64RemoveExecutableExtension with default 'true'. Input class exposes a public getter that resolves the input value to a boolean, with corresponding test coverage for default and explicit true/false cases.
Build Parameters Logic
src/model/build-parameters.ts, src/model/build-parameters.test.ts
Updated BuildParameters.parseBuildFile() signature to accept the new linux64RemoveExecutableExtension parameter. Added conditional logic to append .x86_64 extension when platform is StandaloneLinux64 and the flag is false. Test matrix expanded to cover new parameter combinations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Suggested reviewers

  • webbertakken
  • davidmfinol

Poem

🐰 A new toggle hops into place,
Linux64 builds now have grace,
With .x86_64 we can choose,
To keep it or lose it—no blues!
The extension now bends to our will,
Configurable builds, what a thrill! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a new parameter linux64RemoveExecutableExtension to the codebase.
Description check ✅ Passed The description covers changes, related issues, checklist items, and provides context about the parameter's purpose and default behavior. However, the workflow run link section is incomplete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can disable sequence diagrams in the walkthrough.

Disable the reviews.sequence_diagrams setting to disable sequence diagrams in the walkthrough.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (4)
src/model/input.test.ts (1)

338-349: Consider adding a fallback-env test to exercise non-core input paths.

This strengthens confidence that LINUX64_FILE_EXTENSION (env-var) works when core.getInput is empty.

You could append something like this:

it('falls back to env var LINUX64_FILE_EXTENSION when core input is empty', () => {
  const original = process.env.LINUX64_FILE_EXTENSION;
  try {
    process.env.LINUX64_FILE_EXTENSION = '.x86_64';
    jest.spyOn(core, 'getInput').mockReturnValue(''); // force fallback path
    expect(Input.linux64FileExtension).toBe('.x86_64');
  } finally {
    if (original === undefined) {
      delete process.env.LINUX64_FILE_EXTENSION;
    } else {
      process.env.LINUX64_FILE_EXTENSION = original;
    }
  }
});
src/model/build-parameters.test.ts (1)

107-115: Use empty string instead of 'n/a' for non-Linux rows to avoid unrealistic values.

The property is a plain string and unused outside the Linux branch, but keeping it '' makes the test matrix semantically cleaner.

Apply:

-      ${Platform.types.Android}             | ${'.apk'}         | ${'androidPackage'}       | ${'n/a'}
-      ${Platform.types.Android}             | ${'.aab'}         | ${'androidAppBundle'}     | ${'n/a'}
-      ${Platform.types.Android}             | ${''}             | ${'androidStudioProject'} | ${'n/a'}
-      ${Platform.types.StandaloneWindows}   | ${'.exe'}         | ${'n/a'}                  | ${'n/a'}
-      ${Platform.types.StandaloneWindows64} | ${'.exe'}         | ${'n/a'}                  | ${'n/a'}
+      ${Platform.types.Android}             | ${'.apk'}         | ${'androidPackage'}       | ${''}
+      ${Platform.types.Android}             | ${'.aab'}         | ${'androidAppBundle'}     | ${''}
+      ${Platform.types.Android}             | ${''}             | ${'androidStudioProject'} | ${''}
+      ${Platform.types.StandaloneWindows}   | ${'.exe'}         | ${'n/a'}                  | ${''}
+      ${Platform.types.StandaloneWindows64} | ${'.exe'}         | ${'n/a'}                  | ${''}
src/model/build-parameters.ts (2)

256-259: Normalize and validate linux64FileExtension to avoid surprises (leading dot, path separators).

Prevents accidental “filenamex86_64” (missing dot) or injection of path separators. Non-breaking for current tests.

Apply:

-    if (platform === Platform.types.StandaloneLinux64) {
-      return `${filename}${linux64FileExtension}`;
-    }
+    if (platform === Platform.types.StandaloneLinux64) {
+      const trimmed = linux64FileExtension.trim();
+      if (/[\/\\]/.test(trimmed)) {
+        throw new Error('Invalid linux64FileExtension: must not contain path separators');
+      }
+      const normalized = trimmed === '' ? '' : (trimmed.startsWith('.') ? trimmed : `.${trimmed}`);
+      return `${filename}${normalized}`;
+    }

256-259: Add a Linux64 predicate to Platform (optional)

There isn’t currently a Platform.isLinux64 (or Platform.isLinux) helper in src/model/platform.ts. To stay consistent with the existing Platform.isWindows and Platform.isAndroid predicates—and for easier future extensions—you might add one:

In src/model/platform.ts:

static isLinux64(platform: string): boolean {
  return platform === Platform.types.StandaloneLinux64;
}

Then in src/model/build-parameters.ts (around line 256):

- if (platform === Platform.types.StandaloneLinux64) {
+ if (Platform.isLinux64(platform)) {
    return `${filename}${linux64FileExtension}`;
  }

This refactor is optional but will keep your platform checks uniform.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c6c8236 and 893ac80.

⛔ Files ignored due to path filters (2)
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (4)
  • src/model/build-parameters.test.ts (1 hunks)
  • src/model/build-parameters.ts (3 hunks)
  • src/model/input.test.ts (1 hunks)
  • src/model/input.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/model/build-parameters.test.ts (1)
src/model/input.ts (3)
  • targetPlatform (80-82)
  • androidExportType (162-164)
  • linux64FileExtension (285-287)
src/model/build-parameters.ts (1)
src/model/input.ts (2)
  • androidExportType (162-164)
  • linux64FileExtension (285-287)
🔇 Additional comments (4)
src/model/input.ts (1)

285-288: LGTM: new linux64FileExtension input is correctly exposed and defaults to empty string.

Matches existing Input getter patterns and preserves current behavior by default.

src/model/input.test.ts (1)

338-349: LGTM: tests cover default and explicit values for linux64FileExtension.

Clear, minimal, and consistent with other Input getter tests.

src/model/build-parameters.test.ts (1)

106-127: LGTM: matrix now validates Linux64 filename behavior with and without extension.

Good coverage tying Input.linux64FileExtension into BuildParameters.create and parse logic.

src/model/build-parameters.ts (1)

104-109: Correctly threading linux64FileExtension into parseBuildFile.

This keeps the extension decision centralized in parseBuildFile and preserves default behavior when the input is empty.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
action.yml (2)

271-272: Clarify accepted formats in the description (leading dot vs no dot).

Minor wording tweak to preempt ambiguity about whether users should include the leading dot. If your parsing already normalizes both, reflect that here; if not, this makes the expectation explicit.

Apply this diff to clarify:

-    description:
-      'Specify the file extension of the executable when building for StandaloneLinux64. For example, ".x86_64"'
+    description:
+      'Specify the file extension of the executable when building for StandaloneLinux64. For example, ".x86_64". Leave empty to omit. You may include or omit the leading dot; the builder will handle both.'

268-273: Remember to update docs and usage examples.

Once merged, add this input to README/action usage matrix and provide a snippet for enabling Unity’s default “.x86_64” extension.

Happy to draft the documentation snippet and a minimal example workflow if you’d like.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 893ac80 and dc38016.

📒 Files selected for processing (1)
  • action.yml (1 hunks)
🔇 Additional comments (1)
action.yml (1)

268-273: LGTM: New linux64FileExtension input is well-scoped and consistent.

Name, placement, and defaults align with existing inputs. Description clearly communicates the intent and example.

@kitlith kitlith changed the title Add parameter linux64FileExtension Add parameter linux64RemoveExecutableExtension Aug 20, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/model/input.ts (1)

285-289: Normalize boolean parsing to be case/whitespace-insensitive

Users sometimes pass True/TRUE or include spaces in workflow YAML. Normalizing here avoids subtle surprises and mirrors a more robust pattern.

   static get linux64RemoveExecutableExtension(): boolean {
-    const input = Input.getInput('linux64RemoveExecutableExtension') ?? 'true';
-
-    return input === 'true';
+    const raw = (Input.getInput('linux64RemoveExecutableExtension') ?? 'true').trim().toLowerCase();
+    return raw === 'true';
   }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between dc38016 and 20df148.

⛔ Files ignored due to path filters (2)
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (5)
  • action.yml (1 hunks)
  • src/model/build-parameters.test.ts (1 hunks)
  • src/model/build-parameters.ts (3 hunks)
  • src/model/input.test.ts (1 hunks)
  • src/model/input.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/model/input.test.ts
  • action.yml
  • src/model/build-parameters.ts
  • src/model/build-parameters.test.ts
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/model/input.ts (1)
src/model/index.ts (1)
  • Input (19-19)
🔇 Additional comments (2)
src/model/input.ts (2)

285-289: LGTM: adds boolean input with backward-compatible default

The getter correctly defaults to removing the extension (true), which preserves current behavior and avoids breaking changes.


285-289: No lingering linux64FileExtension — repo uses linux64RemoveExecutableExtension

Search results show no occurrences of linux64FileExtension; the code, tests and action metadata use linux64RemoveExecutableExtension:

  • action.yml — linux64RemoveExecutableExtension (lines ~268–270)
  • src/model/input.ts — getter linux64RemoveExecutableExtension (lines ~285–289)
  • src/model/input.test.ts — tests for linux64RemoveExecutableExtension (around lines ~338–351)
  • src/model/build-parameters.ts & src/model/build-parameters.test.ts — consume/mock linux64RemoveExecutableExtension
  • dist/index.js — compiled references to linux64RemoveExecutableExtension

Conclusion: no changes required in code/docs to remove an old name — you can consider updating the PR title (if it still says linux64FileExtension) to match linux64RemoveExecutableExtension.

@kitlith
Copy link
Author

kitlith commented Aug 20, 2025

making a couple of the AI nitpicks more visible:

256-259: Add a Linux64 predicate to Platform (optional)

There isn’t currently a Platform.isLinux64 (or Platform.isLinux) helper in src/model/platform.ts. To stay consistent with the existing Platform.isWindows and Platform.isAndroid predicates—and for easier future extensions—you might add one:

Felt redundant to me, then again Platform.isAndroid feels redundant to me, unlike Platform.isWindows, so shrug

285-289: Normalize boolean parsing to be case/whitespace-insensitive

Users sometimes pass True/TRUE or include spaces in workflow YAML. Normalizing here avoids subtle surprises and mirrors a more robust pattern.

Feels like this would be better off in a separate PR that normalizes the boolean parsing everywhere. As-is, I'm using the same pattern that is used everywhere else in the file.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 20df148 and e2cdacd.

⛔ Files ignored due to path filters (2)
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (2)
  • .github/workflows/build-tests-mac.yml (1 hunks)
  • .github/workflows/build-tests-windows.yml (2 hunks)

Comment on lines +85 to +87
name:
Build ${{ matrix.targetPlatform }} on MacOS (${{ matrix.unityVersion }})${{ matrix.buildProfile && ' With
Build Profile' || '' }}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Prevent newline insertion in artifact-name literal.

The line break inside ' With' Build Profile' injects a newline into the evaluated string, yielding a multi-line artifact name when buildProfile is set. Keep the literal on one line (or use a folded scalar) so the name stays single-line.

-        with:
-          name:
-            Build ${{ matrix.targetPlatform }} on MacOS (${{ matrix.unityVersion }})${{ matrix.buildProfile && '  With
-            Build Profile' || '' }}
+        with:
+          name: >-
+            Build ${{ matrix.targetPlatform }} on MacOS (${{ matrix.unityVersion }})${{ matrix.buildProfile && '  With Build Profile' || '' }}

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In .github/workflows/build-tests-mac.yml around lines 85 to 87, the artifact
name literal is split across lines causing a newline to be inserted when the
buildProfile branch is included; keep the entire name expression on a single
line (or replace with a folded scalar) so the conditional `'  With Build
Profile'` remains contiguous and produces a single-line artifact name; update
the YAML to remove the line break between `'  With` and `Build Profile'`
ensuring the evaluated string does not contain any embedded newlines.

Comment on lines +149 to +151
name:
Build ${{ matrix.targetPlatform }} on Windows (${{ matrix.unityVersion }})${{ matrix.enableGpu && ' With
GPU' || '' }}${{ matrix.buildProfile && ' With Build Profile' || '' }}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid embedding newlines in artifact-name expressions.

Splitting the scalar across lines puts an actual newline inside the ' With …' literal, so the artifact name becomes multi-line when enableGpu is true. Keep the literal on one line or use a folded scalar to preserve readability without introducing the newline.

-        with:
-          name:
-            Build ${{ matrix.targetPlatform }} on Windows (${{ matrix.unityVersion }})${{ matrix.enableGpu && ' With
-            GPU' || '' }}${{ matrix.buildProfile && '  With Build Profile' || '' }}
+        with:
+          name: >-
+            Build ${{ matrix.targetPlatform }} on Windows (${{ matrix.unityVersion }})${{ matrix.enableGpu && ' With GPU' || '' }}${{ matrix.buildProfile && '  With Build Profile' || '' }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
name:
Build ${{ matrix.targetPlatform }} on Windows (${{ matrix.unityVersion }})${{ matrix.enableGpu && ' With
GPU' || '' }}${{ matrix.buildProfile && ' With Build Profile' || '' }}
with:
name: >-
Build ${{ matrix.targetPlatform }} on Windows (${{ matrix.unityVersion }})${{ matrix.enableGpu && ' With GPU' || '' }}${{ matrix.buildProfile && ' With Build Profile' || '' }}
🤖 Prompt for AI Agents
.github/workflows/build-tests-windows.yml around lines 149 to 151: the artifact
name scalar is split across lines so the string literal for ' With GPU' contains
a newline when enableGpu is true; fix by keeping the entire name expression on a
single line (move the ' With GPU' segment up to the same line) or convert the
scalar to a folded scalar (using >) so the expression remains readable but does
not introduce a newline into the rendered artifact name.

Copy link
Member

@webbertakken webbertakken left a comment

Choose a reason for hiding this comment

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

Agree with the rationale. LGTM.

Lets list it as one of the things we should change when we bump the major version with breaking changes.

@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.43%. Comparing base (ab64768) to head (e2cdacd).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #726      +/-   ##
==========================================
+ Coverage   38.34%   38.43%   +0.09%     
==========================================
  Files          78       78              
  Lines        3169     3174       +5     
  Branches      663      665       +2     
==========================================
+ Hits         1215     1220       +5     
  Misses       1809     1809              
  Partials      145      145              
Files with missing lines Coverage Δ
src/model/build-parameters.ts 90.27% <100.00%> (+0.27%) ⬆️
src/model/input.ts 89.17% <100.00%> (+0.21%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kitlith
Copy link
Author

kitlith commented Mar 6, 2026

@frostebite Given that this has been mentioned in relation to a tracking issue for a major version bump, should I rebase and flip the default? Or is this action not involved in that version bump, and the default should stay the same?

Additionally, given the length of time that this has been left open, are there any blockers, such as the missing "Successful Workflow Run Link"? Last I was told, there were no blockers.

kitlith added 3 commits March 13, 2026 13:15
Allows the end-user to restore the default unity behavior of
using the file extension `.x86_64`, instead of no file extension.

Preserves the current behavior, to avoid surprise breakage.
and the rest that this entails.

This PR should probably be squashed before merging,
with attention paid to the commit message.
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