Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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 }
8 changes: 5 additions & 3 deletions settings/catalog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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]}
4 changes: 2 additions & 2 deletions settings/windows/msvc_paths.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion settings/windows/msvc_paths_x86.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 9 additions & 2 deletions tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,20 @@ def settings_page(out):
badge = (f'<span class="badge ok" title="the example project is built, tested and run with it">built in CI: {esc(ci)}</span>'
if ci else '<span class="badge" title="needs hardware the CI runners lack">not built in CI</span>')
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: "
"<code>maiken/settings.yaml</code> in <code>%HOME%</code>, else in "
"<code>%HOMEDRIVE%%HOMEPATH%</code>; then <code>mkn build</code> needs no "
"<code>-x</code>"
if entry.get("default") else
f"Use: <code>mkn build -x {esc(Path(entry['file']).stem)}</code> with the file saved "
"next to the project or in the settings directory")
cards.append(f"""
<article class="example" id="{anchor}">
<header><h3><a href="#{anchor}">{esc(entry["title"])}</a></h3>{tags}{badge}</header>
<p>{esc(leading_comment(text))}</p>
{code(text, "yaml")}
<p class="use">Use: <code>mkn build -x {esc(Path(entry["file"]).stem)}</code> with the file saved next to the
project or in the settings directory, or <a href="{rel}" download>download</a> /
<p class="use">{use}, or <a href="{rel}" download>download</a> /
<a href="{SITE_REPO}/blob/main/{rel}">view on GitHub</a></p>
</article>""")
intro = markdown.markdown(group["intro"], extensions=["fenced_code", "tables"]) if group.get("intro") else ""
Expand Down
Loading