Skip to content

Conversation

@davidbuzinski
Copy link
Contributor

Update to use the new binary for run-matlab-command.

@davidbuzinski davidbuzinski requested a review from mcafaro August 10, 2022 18:08
fi
mkdir -p "$WORKINGDIR/$os"
wget -O "$WORKINGDIR/$os/run-matlab-command$bin_ext" "$RMC_BASE_URL/$os/run-matlab-command$bin_ext"
mv -f ./* "$DISTDIR/"
Copy link
Member

Choose a reason for hiding this comment

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

Can this just be done once after the loop? Or should the specific folder we want to move be specified here?

src/matlab.ts Outdated
Comment on lines 73 to 83
case "win32":
ext = ".exe";
platform_dir = "win64";
break;
case "darwin":
ext = "";
platform_dir = "maci64";
break;
default:
ext = "";
platform_dir = "glnxa64";
Copy link
Member

Choose a reason for hiding this comment

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

There's a bit of a disconnect here between platform and architecture. Maybe this function should take in the architecture as well so we can be sure we're picking the right binary or erroring if we don't have a binary for that combination.

Copy link
Contributor Author

@davidbuzinski davidbuzinski Aug 10, 2022

Choose a reason for hiding this comment

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

Hmmm yeah that's a good point. Is there any architectures beyond x64 that we know to be in use currently? Could this technically be a "breaking change" for some self-hosted runners?
(side note: I think it's supposed to be "easy" to cross-compile to many architectures with Golang, but I haven't tested other than x64)

Copy link
Member

@mcafaro mcafaro Aug 10, 2022

Choose a reason for hiding this comment

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

It looks like GitHub only supports x64 runners (and ARM32/64 on Linux), so we should be safe providing just x64 binaries since there is no ARM version of MATLAB yet. I think just from a code clarity and correctness standpoint, we should still take the arch into consideration here and just error if it doesn't match our expectations.

src/matlab.ts Outdated
*/
export function getRunMATLABCommandScriptPath(platform: string, architecture: string): string {
if (architecture != "x64") {
throw new Error(`This action is not supported for runners of platform ${platform} and architecture ${architecture}.`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mw-hrastega any thoughts on this error message?

Copy link
Member

Choose a reason for hiding this comment

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

Could you give me an example of the message holes? Will each hole be filled with a scalar or a list?

If both are scalar, maybe something like this?

This action is not supported on ${platform} runners using the ${architecture} architecture.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that sounds reasonable. Yes, they will both be scalar. One example of such an error would read This action is not supported on windows runners using the x86 architecture.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good to me.

@davidbuzinski davidbuzinski requested a review from mcafaro August 10, 2022 21:44
@davidbuzinski davidbuzinski merged commit 5c7228d into main Aug 11, 2022
@davidbuzinski davidbuzinski deleted the new-run-matlab-command branch August 12, 2022 17:14
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.

4 participants