diff --git a/.github/workflows/settings.yml b/.github/workflows/settings.yml index 00030b0..6c105c5 100644 --- a/.github/workflows/settings.yml +++ b/.github/workflows/settings.yml @@ -76,7 +76,9 @@ jobs: ../mkn.exe -v $settings = "$env:GITHUB_WORKSPACE/settings/${{ matrix.os }}/${{ matrix.file }}" # msvc_paths*: no Developer prompt; its properties set to the runner's install, found as - # the page describes, in a copy, as a user edits the file + # the page describes, in a copy saved as mkn's default settings file, as a user does + # where mkn cannot write that file (the runner's gcc lets it, this replaces it), no -x + $x = @("-x", $settings) if ("${{ matrix.file }}" -like "msvc_paths*") { $vs = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -property installationPath $ver = (Get-Content "$vs\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt").Trim() @@ -86,9 +88,13 @@ jobs: -replace '(?m)^ msvc: .*$', (" msvc: $vs/VC/Tools/MSVC/$ver" -replace '\\','/') ` -replace '(?m)^ sdk: .*$', (" sdk: $sdk" -replace '\\','/') ` -replace '(?m)^ sdk\.version: .*$', " sdk.version: $sdkver" - $settings = "$env:RUNNER_TEMP/${{ matrix.file }}" + $env:KLOG = "0" # -G's value only + $mknhome = ../mkn.exe -G MKN_HOME | Select-Object -Last 1 + $env:KLOG = "3" + $settings = Join-Path $mknhome "settings.yaml" Set-Content $settings $text Get-Content $settings + $x = @() } - ../mkn.exe clean build test run -p app -q -x $settings + ../mkn.exe clean build test run -p app -q @x if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } diff --git a/settings/catalog.yaml b/settings/catalog.yaml index d5513c9..f7281f4 100644 --- a/settings/catalog.yaml +++ b/settings/catalog.yaml @@ -30,7 +30,9 @@ windows: environment variables, which `vcvarsall.bat` sets: a *Developer Command Prompt* or *Developer PowerShell* is one with them set. From one, settings need only name the tools ([MSVC](#windows-msvc)); mkn's own default settings file is then written with those paths. Without - one, a settings file gives the same paths itself ([MSVC without a Developer prompt](#windows-msvc-paths)). + one, and without gcc or clang, mkn cannot write that file and stops with a message pointing here: + the default settings file is then one you write, giving the same paths itself + ([MSVC without a Developer prompt](#windows-msvc-paths)). They come from two places: | | Directory | Include | Libraries | Tools | @@ -54,8 +56,8 @@ windows: all, and the lines using it are quoted. `env:` values are raw too. entries: - {file: msvc.yaml, title: MSVC, tags: [msvc], ci: windows-latest} - - {file: msvc_paths.yaml, title: MSVC without a Developer prompt, tags: [msvc, windows sdk], ci: windows-latest} - - {file: msvc_paths_x86.yaml, title: 32 bit MSVC without a Developer prompt, tags: [msvc, windows sdk, x86], ci: windows-latest} + - {file: msvc_paths.yaml, title: MSVC without a Developer prompt, tags: [msvc, windows sdk], ci: windows-latest, default: true} + - {file: msvc_paths_x86.yaml, title: 32 bit MSVC without a Developer prompt, tags: [msvc, windows sdk, x86], ci: windows-latest, default: true} - {file: msvc_2015.yaml, title: Visual Studio 2015 and older, tags: [msvc, windows sdk]} - {file: clang.yaml, title: clang, tags: [clang], ci: windows-latest} - {file: csharp.yaml, title: "C#", tags: [csharp]} diff --git a/settings/windows/msvc_paths.yaml b/settings/windows/msvc_paths.yaml index c4c569d..ff9ac13 100644 --- a/settings/windows/msvc_paths.yaml +++ b/settings/windows/msvc_paths.yaml @@ -1,7 +1,7 @@ # MSVC without a Developer Command Prompt: the MSVC toolset's and Windows SDK's include, library # and bin directories given here, as vcvarsall.bat sets them in INCLUDE, LIB and PATH. Set the -# four properties for your install (see above); their values are raw, the lines using them quoted -super: settings +# four properties for your install (see above); their values are raw, the lines using them quoted. +# mkn cannot write its default settings file without a Developer prompt, gcc or clang: this is it property: msvc: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207 diff --git a/settings/windows/msvc_paths_x86.yaml b/settings/windows/msvc_paths_x86.yaml index 852de76..971e3b4 100644 --- a/settings/windows/msvc_paths_x86.yaml +++ b/settings/windows/msvc_paths_x86.yaml @@ -1,6 +1,5 @@ # 32 bit MSVC without a Developer Command Prompt: as msvc_paths.yaml with x86 libraries and the # x86 hosted compiler (HostX64/x86 cross compiles from a 64 bit host as well) -super: settings property: msvc: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207 diff --git a/tools/build.py b/tools/build.py index 61f0e32..375481c 100644 --- a/tools/build.py +++ b/tools/build.py @@ -178,13 +178,20 @@ def settings_page(out): badge = (f'built in CI: {esc(ci)}' if ci else 'not built in CI') rel = f"settings/{os_key}/{entry['file']}" + use = ( # default: the settings file mkn could not write itself, no super: settings + "Use: save as mkn's default settings file, the path its message prints: " + "maiken/settings.yaml in %HOME%, else in " + "%HOMEDRIVE%%HOMEPATH%; then mkn build needs no " + "-x" + if entry.get("default") else + f"Use: mkn build -x {esc(Path(entry['file']).stem)} with the file saved " + "next to the project or in the settings directory") cards.append(f"""

{esc(entry["title"])}

{tags}{badge}

{esc(leading_comment(text))}

{code(text, "yaml")} -

Use: mkn build -x {esc(Path(entry["file"]).stem)} with the file saved next to the - project or in the settings directory, or download / +

{use}, or download / view on GitHub

""") intro = markdown.markdown(group["intro"], extensions=["fenced_code", "tables"]) if group.get("intro") else ""