Skip to content

Update ParallelizableBuildSummaryPlugin.m to fix Windows filepath issue.#3

Open
sameagen-MW wants to merge 8 commits intomainfrom
parallelizable-plugin-fix
Open

Update ParallelizableBuildSummaryPlugin.m to fix Windows filepath issue.#3
sameagen-MW wants to merge 8 commits intomainfrom
parallelizable-plugin-fix

Conversation

@sameagen-MW
Copy link

Currently the plugin uses the task name to determine the name of the file to save the task detail in. For example, a task t1 will have it's detail saved as t1.mat.

This causes issues with tasks that are part of a task group on Windows, since : is not a valid character that can be used for file names. For example mex:myfile.mat is not a valid file name.

This change switches over to using UUIDs instead, and also adds a bit of robustness so failing to save a detail will throw a warning but not stop the build.

Copy link
Member

@mcafaro mcafaro left a comment

Choose a reason for hiding this comment

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

Should we put in a regression test?

try
save(name, "taskDetail");
catch e
warning("buildframework:BuildSummaryPlugin:UnableToSaveTrace", "Unable to save an artifact required to create the MATLAB build summary table");
Copy link
Member

Choose a reason for hiding this comment

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

Not directly related to this review but these error/warning ids and package names are not currently consistent with our guidelines. The first component should relate to the product containing the code (I believe we use "ciplugins" on Jenkins). I opened an issue to track this: #4

runTask@matlab.buildtool.plugins.BuildRunnerPlugin(plugin, pluginData);

name = fullfile(plugin.TempFolder, pluginData.Name + ".mat");
name = fullfile(plugin.TempFolder, matlab.lang.internal.uuid() + ".mat");
Copy link
Member

Choose a reason for hiding this comment

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

We should try to avoid using internal packages, especially in code outside of the base product like this. What about using matlab.lang.makeValidName to turn the task name into a valid identifier, which should also be a valid filename?

@sameagen-MW
Copy link
Author

Should we put in a regression test?

Yeah for sure. One of the downsides of this repository structure though is I don't think right now we have it set up so we can actually run that here. We'll probably need to test it in the run-build action.

@sameagen-MW
Copy link
Author

Should we put in a regression test?

Yeah for sure. One of the downsides of this repository structure though is I don't think right now we have it set up so we can actually run that here. We'll probably need to test it in the run-build action.

I'll set this up in a separate PR to the run-build repo.

@sameagen-MW sameagen-MW requested a review from mcafaro February 3, 2026 16:06
@mcafaro
Copy link
Member

mcafaro commented Feb 3, 2026

Should we put in a regression test?

Yeah for sure. One of the downsides of this repository structure though is I don't think right now we have it set up so we can actually run that here. We'll probably need to test it in the run-build action.

Opened #5

Copy link
Member

@mcafaro mcafaro left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for adding some tests!

Comment on lines 11 to 19
arguments
options.TempFolder (1,:) string = string.empty()
end

if ~isempty(options.TempFolder)
tempRoot = options.TempFolder;
else
tempRoot = getenv("RUNNER_TEMP");
end
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
arguments
options.TempFolder (1,:) string = string.empty()
end
if ~isempty(options.TempFolder)
tempRoot = options.TempFolder;
else
tempRoot = getenv("RUNNER_TEMP");
end
arguments
options.TempFolder (1,1) string = getenv("RUNNER_TEMP")
end

- uses: actions/checkout@v5
- uses: matlab-actions/setup-matlab@v2
with:
release: latest-including-prerelease
Copy link
Member

Choose a reason for hiding this comment

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

Should we test against the oldest and newest releases of MATLAB we claim to support?

Copy link
Author

Choose a reason for hiding this comment

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

This specific plugin is only used for R2026a+, so it's not relevant here. As we add tests for the other plugins I think that makes sense though.

Copy link
Contributor

@mw-kapilg mw-kapilg left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

Comment on lines +10 to +21
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: windows-latest
- os: macos-latest
steps:
- uses: actions/checkout@v5
- uses: matlab-actions/setup-matlab@v2
with:
release: latest-including-prerelease
- uses: matlab-actions/run-tests@v2
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: I think for the rest of the file, we have 2 spaces for indent. It would be nice to be consistent here as well

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