-
Notifications
You must be signed in to change notification settings - Fork 6
Get debug working on linux #77
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
Open
cshingle
wants to merge
4
commits into
Garethp:linux-debugging
Choose a base branch
from
cshingle:linux-debugging
base: linux-debugging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/bin/sh | ||
| set -e | ||
| # This script builds the plugin on Linux | ||
|
|
||
| export Version="2024.1-EAP" | ||
|
|
||
| ./gradlew :buildPlugin |
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
Binary file modified
BIN
-2.01 MB
(4.2%)
src/rider/main/resources/UnityDoorstop/Linux/Doorstop/0Harmony.dll
100644 → 100755
Binary file not shown.
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
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line was messing up the commandline.
When running on linux the command should be /bin/sh and the run script command should be the first argument. Any user provided arguments should come at the end. The println I added makes the issue pretty obvious once you look at the output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't have been messing it up. The arguments I had should have ended up as
/bin/shas the command and then["dir/run.sh", "dir/RimWorldLinux", ...userArgs]as the end result. If you take a look atrun.sh:75it should be taking the first argument in as the executable name, so not passing in the executable would mean that if a user defines arguments in the command line options, it would eat the first argument as the executable name.Perhaps it was the fact that the executable name shouldn't include it's directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it work the way you had it you would want
arguments = "$bashScriptPath $arguments"You already build the run.sh path on this line
val bashScriptPath = "${Path(pathToRun).parent}/run.sh"The reason I refactored the code some is to do the
.split(' ')sooner. I have created a lot of programs that call commandline stuff from Java that needed to run on Windows, Linux and AIX. Splitting on space is fine until some asshole gives you a file path or file name with a space in it."Perhaps it was the fact that the executable name shouldn't include it's directory?"
Since we are setting the work directory you could just call
run.shand it would work. It is totally a matter of preference.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had some trouble getting
run.shexecutable. Setting it as+xin the resources wasn't preserving the permissions when copying it over and setting the permissions manually in Kotlin wasn't working for me, which is why I'm callingrun.shas an argument to/bin/shinstead.But yeah, I think moving the
.splitearlier makes sense, I was going to just look into havinggetCommandLineOptionsreturn a list directlyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing a bash script into /bin/sh is a MUCH more portable solution than trying to execute the bash script directly. This was the right call.
"But yeah, I think moving the .split earlier makes sense, I was going to just look into having getCommandLineOptions return a list directly"
I totally support this.