Skip to content

Commit

Permalink
Merge pull request #68 from WolframResearch/bugfix/broken-mac-compile…
Browse files Browse the repository at this point in the history
…-job

Misc fixes for WTC
  • Loading branch information
rhennigan authored Oct 16, 2022
2 parents 25ad6eb + f3774ae commit 79ebf5e
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Actions/build-paclet
Submodule build-paclet updated 1 files
+17 −4 src/main.sh
2 changes: 1 addition & 1 deletion Actions/check-paclet
Submodule check-paclet updated 1 files
+17 −4 src/main.sh
2 changes: 1 addition & 1 deletion Actions/submit-paclet
Submodule submit-paclet updated 1 files
+17 −4 src/main.sh
2 changes: 1 addition & 1 deletion Actions/test-paclet
Submodule test-paclet updated 1 files
+18 −5 src/main.sh
6 changes: 5 additions & 1 deletion Kernel/BuildPaclet.wl
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,11 @@ pacletToolsMessageFix[ eval_ ] := (
eval,
{
FileHash::noopen,
DocumentationBuild`DocumentationBuild::warning
DocumentationBuild`DocumentationBuild::warning,
DocumentationBuild`Info`GetNotebookHistoryData::notfound,
DocumentationBuild`Utils`CreateInputForm::err,
DocumentationBuild`Utils`CreateInputForm::str,
DocumentationBuild`Utils`Localized::nokey
}
]
]
Expand Down
11 changes: 10 additions & 1 deletion Kernel/Formatting.wl
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ actionCodeLabel[ code_String ] :=
(* ::**********************************************************************:: *)
(* ::Subsubsection::Closed:: *)
(*actionCommandLabel*)
$$pacSiteTest = Alternatives[
"if (\"${{ env.WLPR_PACLET_SITE }}\") {",
"if [ \"${{ env.WLPR_PACLET_SITE }}\" != \"\" ]",
"if test \"${{ env.WLPR_PACLET_SITE }}\" != \"\"; then"
];

actionCommandLabel[ { code_String } ] :=
If[ StringLength[ code ] < 40,
{ BoxForm`SummaryItem @ { "Command: ", code } },
Expand All @@ -134,7 +140,10 @@ actionCommandLabel[ { code_String } ] :=
} }
];

actionCommandLabel @ { code_String, rest__ } := {
actionCommandLabel[ { $$pacSiteTest, Except[ "fi" ].., "fi", cmd__String } ] :=
actionCommandLabel @ { cmd };

actionCommandLabel[ { code_String, rest__ } ] := {
BoxForm`SummaryItem @ {
"Command: ",
Tooltip[
Expand Down
7 changes: 0 additions & 7 deletions Kernel/Utilities.wl
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,6 @@ setOutput[ str_OutputStream, name_, value_ ] := (
ToString @ value
];

dnc`ConsolePrint @ StringJoin[
"::set-output name=",
ToString @ name,
"::",
ToString @ value
];

WriteLine[ str, ToString @ name <> "=" <> ToString @ value ]
);

Expand Down
44 changes: 25 additions & 19 deletions Kernel/Workflows.wl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Workflow[ as_Association, opts: OptionsPattern[ ] ] :=
catchTop @ Module[ { new, id },
new = makeWorkflowData @ as;
(* TODO: write a getWorkFlowID function *)
id = First[ KeyTake[ new, { "id", "name" } ], CreateUUID[ ] ];
id = First[ KeyTake[ new, { "name", "id" } ], CreateUUID[ ] ];
Workflow[ id, new, opts ]
];

Expand Down Expand Up @@ -599,7 +599,7 @@ WorkflowJob[ as_Association, opts: OptionsPattern[ ] ] :=
OptionValue @ OperatingSystem,
Module[ { new, id },
new = makeWorkflowJobData @ Association[ as, opts ];
id = First[ KeyTake[ new, { "id", "name" } ], CreateUUID[ ] ];
id = First[ KeyTake[ new, { "name", "id" } ], CreateUUID[ ] ];
WorkflowJob[ id, new ]
]
];
Expand Down Expand Up @@ -911,7 +911,7 @@ WorkflowStep[ as_Association, opts: OptionsPattern[ ] ] :=
Module[ { new, id },
new = makeWorkflowStepData @ <| as, opts |>;
(* TODO: write a getWorkFlowID function *)
id = First[ KeyTake[ new, { "id", "name" } ], CreateUUID[ ] ];
id = First[ KeyTake[ new, { "name", "id" } ], CreateUUID[ ] ];
WorkflowStep[ id, new ]
];

Expand Down Expand Up @@ -1271,6 +1271,10 @@ WorkflowExport // Options = {
(* ::**********************************************************************:: *)
(* ::Subsection::Closed:: *)
(*Main definition*)
(* FIXME: this should not be necessary *)
WorkflowExport[ pac_, wf_Workflow? workflowQ, opts: OptionsPattern[ ] ] :=
catchTop @ exportWorkflow[ pac, wf, opts ];

WorkflowExport[ pac_, spec_, opts: OptionsPattern[ ] ] :=
catchTop @ exportWorkflow[ pac, Workflow[ spec, <| |>, opts ] ];

Expand Down Expand Up @@ -2079,7 +2083,7 @@ normalizeCompilationJob[ sys_String, name_String, as_Association ] :=
normalizeCompilationJob // catchUndefined;

normalizeCompilationJob0[ "Windows-x86-64", as_Association ] := <|
"name" -> "Compile (Windows-x86-64)",
"name" -> "Compile-Windows-x86-64",
"runs-on" -> "windows-latest",
"env" -> compilationEnv[ "Windows-x86-64" ],
"timeout-minutes" -> $timeConstraint,
Expand All @@ -2094,7 +2098,7 @@ normalizeCompilationJob0[ "Windows-x86-64", as_Association ] := <|
|>;

normalizeCompilationJob0[ "MacOSX-x86-64", as_Association ] := <|
"name" -> "Compile (MacOSX-x86-64)",
"name" -> "Compile-MacOSX-x86-64",
"runs-on" -> "macos-12",
"env" -> compilationEnv[ "MacOSX-x86-64" ],
"timeout-minutes" -> $timeConstraint,
Expand All @@ -2109,7 +2113,7 @@ normalizeCompilationJob0[ "MacOSX-x86-64", as_Association ] := <|
|>;

normalizeCompilationJob0[ "Linux-x86-64", as_Association ] := <|
"name" -> "Compile (Linux-x86-64)",
"name" -> "Compile-Linux-x86-64",
"runs-on" -> "ubuntu-latest",
"container" -> $defaultJobContainer,
"env" -> compilationEnv[ "Linux-x86-64" ],
Expand All @@ -2130,7 +2134,7 @@ normalizeCompilationJob0 // catchUndefined;
(*buildCompiledPacletJob*)
buildCompiledPacletJob[ as_Association ] :=
"BuildPaclet" -> <|
"name" -> "Build Paclet",
"name" -> "BuildPaclet",
"runs-on" -> "ubuntu-latest",
"container" -> $defaultJobContainer,
"env" -> $defaultJobEnv,
Expand Down Expand Up @@ -2224,7 +2228,7 @@ windowsCompileStep[ as_ ] := <|
|>,
"run" -> joinLines[
"$env:Path += ';${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}\\'",
installPacletManagerString[ ],
installPacletManagerString[ "Windows-x86-64" ],
"wolfram -runfirst " <> $winSetScriptEnv <> " -script ${{ env.WOLFRAM_LIBRARY_BUILD_SCRIPT }}"
]
|>;
Expand Down Expand Up @@ -2291,7 +2295,7 @@ macCompileStep[ as_ ] := <|
|>,
"run" -> joinLines[
"export PATH=\"${{ env.WOLFRAMENGINE_EXECUTABLES_DIRECTORY }}:$PATH\"",
installPacletManagerString[ ],
installPacletManagerString[ "MacOSX-x86-64" ],
"wolframscript -runfirst " <> $macSetScriptEnv <> " -script ${{ env.WOLFRAM_LIBRARY_BUILD_SCRIPT }}"
]
|>;
Expand Down Expand Up @@ -2343,7 +2347,7 @@ apt-get -y install build-essential"
linuxCompileStep[ as_ ] := <|
"name" -> "Compile libraries",
"run" -> joinLines[
installPacletManagerString[ ],
installPacletManagerString[ "Linux-x86-64" ],
"wolframscript -script ${{ env.WOLFRAM_LIBRARY_BUILD_SCRIPT }}"
]
|>;
Expand All @@ -2364,21 +2368,23 @@ linuxUploadCompiledStep[ as_ ] := <|
(* ::Subsection::Closed:: *)
(*compilationEnv*)
compilationEnv[ "Windows-x86-64" ] := <|
"WOLFRAMSCRIPT_ENTITLEMENTID" -> "${{ secrets.WOLFRAMSCRIPT_ENTITLEMENTID }}",
"WOLFRAM_LIBRARY_BUILD_SCRIPT" -> "./Scripts/Compile.wls",
"WOLFRAM_LIBRARY_BUILD_OUTPUT" -> "LibraryResources/",
"WOLFRAM_LIBRARY_BUILD_SCRIPT" -> "./Scripts/Compile.wls",
"WOLFRAM_SYSTEM_ID" -> "Windows-x86-64",
"WOLFRAMENGINE_CACHE_KEY" -> "WolframEngine-A",
"WOLFRAMENGINE_INSTALL_MSI_DOWNLOAD_URL" -> "https://files.wolframcdn.com/packages/winget/13.0.0.0/WolframEngine_13.0.0_WIN.msi",
"WOLFRAMENGINE_CACHE_KEY" -> "WolframEngine-A"
"WOLFRAMSCRIPT_ENTITLEMENTID" -> "${{ secrets.WOLFRAMSCRIPT_ENTITLEMENTID }}"
|>;

compilationEnv[ "MacOSX-x86-64" ] := <|
"WOLFRAMSCRIPT_ENTITLEMENTID" -> "${{ secrets.WOLFRAMSCRIPT_ENTITLEMENTID }}",
"WOLFRAM_LIBRARY_BUILD_SCRIPT" -> "./Scripts/Compile.wls",
"WOLFRAM_LIBRARY_BUILD_OUTPUT" -> "LibraryResources/",
"WOLFRAM_SYSTEM_ID" -> "MacOSX-x86-64",
"WOLFRAMENGINE_CACHE_KEY" -> "WolframEngine-A",
"WOLFRAMENGINE_INSTALLATION_DIRECTORY" -> "\"/Applications/Wolfram Engine.app\""
"WOLFRAM_LIBRARY_BUILD_OUTPUT" -> "LibraryResources/",
"WOLFRAM_LIBRARY_BUILD_SCRIPT" -> "./Scripts/Compile.wls",
"WOLFRAM_SYSTEM_ID" -> "MacOSX-x86-64",
"WOLFRAMENGINE_CACHE_KEY" -> "WolframEngine-A",
"WOLFRAMENGINE_DOWNLOAD_PATH" -> "/tmp/downloads",
"WOLFRAMENGINE_INSTALL_DMG_DOWNLOAD_URL" -> "https://files.wolframcdn.com/packages/Homebrew/13.0.0.0/WolframEngine_13.0.0_MAC.dmg",
"WOLFRAMENGINE_INSTALLATION_DIRECTORY" -> "\"/Applications/Wolfram Engine.app\"",
"WOLFRAMSCRIPT_ENTITLEMENTID" -> "${{ secrets.WOLFRAMSCRIPT_ENTITLEMENTID }}"
|>;

compilationEnv[ "Linux-x86-64" ] := <|
Expand Down
2 changes: 1 addition & 1 deletion PacletInfo.wl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PacletObject[ <|
"SourceControlURL" -> "https://github.com/WolframResearch/PacletCICD",
"License" -> "MIT",
"PublisherID" -> "Wolfram",
"Version" -> "0.33.1",
"Version" -> "0.33.2",
"WolframVersion" -> "13.0+",
"ReleaseID" -> "$RELEASE_ID$",
"ReleaseDate" -> "$RELEASE_DATE$",
Expand Down
2 changes: 1 addition & 1 deletion Scripts/RunScript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WS_EXIT_CODE=$(echo $?)

if [ $WS_EXIT_CODE -eq 139 ]
then
echo "::warning::wolframscript segmentation fault"
echo "::warning::Warning: wolframscript did not exit cleanly"
exit 0
fi
exit $WS_EXIT_CODE
8 changes: 4 additions & 4 deletions Tests/Workflows.wlt
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ VerificationTest[
"Check",
<| "Needs" -> "OtherJob" |>
][ "Steps" ],
{ ___, "download-workflow-values-step", ___, "check-paclet-step", ___ },
{ ___, "DownloadWorkflowValues", ___, "Check", ___ },
SameTest -> MatchQ,
TestID -> "DownloadWorkflowValues-1@@Tests/Workflows.wlt:280,1-288,2"
]
Expand All @@ -293,7 +293,7 @@ VerificationTest[
<| "Needs" -> "OtherJob" |>,
"DownloadWorkflowValues" -> False
][ "Steps" ],
{ Except[ "download-workflow-values-step" ]..., "check-paclet-step", ___ },
{ Except[ "DownloadWorkflowValues" ]..., "Check", ___ },
SameTest -> MatchQ,
TestID -> "DownloadWorkflowValues-2@@Tests/Workflows.wlt:290,1-299,2"
]
Expand All @@ -304,7 +304,7 @@ VerificationTest[
<| "Needs" -> "OtherJob" |>,
"DownloadWorkflowValues" -> Automatic
][ "Steps" ],
{ ___, "download-workflow-values-step", ___, "check-paclet-step", ___ },
{ ___, "DownloadWorkflowValues", ___, "Check", ___ },
SameTest -> MatchQ,
TestID -> "DownloadWorkflowValues-3@@Tests/Workflows.wlt:301,1-310,2"
]
Expand All @@ -314,7 +314,7 @@ VerificationTest[
"Check",
"DownloadWorkflowValues" -> Automatic
][ "Steps" ],
{ Except[ "download-workflow-values-step" ]..., "check-paclet-step", ___ },
{ Except[ "DownloadWorkflowValues" ]..., "Check", ___ },
SameTest -> MatchQ,
TestID -> "DownloadWorkflowValues-4@@Tests/Workflows.wlt:312,1-320,2"
]
Expand Down

0 comments on commit 79ebf5e

Please sign in to comment.