Repository navigation
Conversation
Every block in every lesson has carried an env= attribute since the first one. The tool parsed it, stored it, and read it nowhere. Every block in the repository says E0 and nothing has ever checked that, so the first block to say E1 would have run under E0 anyway and the page would have quoted output from the wrong runtime while saying it came from the right one. The list of configurations now lives in environments.json rather than in a sentence in a document, and the build reads it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every block in every lesson has carried an
env=attribute since the first one. The tool parsed it intoBlock.Env, stored it, and read it nowhere.That is a hole with no symptom today, because every block in the repository says
E0. It gets a symptom the first time somebody writesenv=E1: the block runs underE0anyway, the run succeeds, and the page pins output produced by the wrong runtime while saying in its own front matter that it used the right one. Wrong in the direction of looking correct is the worst kind of wrong this project can be, since the whole claim is that a machine checks what the pages say.This closes it. The M1 checklist line is "the
xraycommand line, enough of it to run and capture a lesson on every declared configuration", and until now nothing in the tool knew what a declared configuration was.One file says what a lesson is allowed to need
environments.jsonat the top of the repository, cheapest first. A block naming an id that is not in it fails the build.E0E1clrjitbeside it, chosen withDOTNET_JitName. This is whatDOTNET_JitDumpneeds.E2dotnet/runtimeat the pinned commit, built.This reorders
E1andE2relative to the one line that used to be indocs/lesson-format.md, which saidE1was a runtime built from source andE2was a checked build. That line was written before the checked JIT probe ran. The probe measured a checkedclrjitdropping into a stock release runtime on all four platforms, which makes it a download rather than a build, and therefore cheaper than a source build rather than more expensive. A numbered ladder whose rungs are not in cost order is not telling a reader anything, so the numbers now go cheap to expensive. That is the one judgement call in this pull request and it is the reason the build lesson stays at 97 of 99.What the build does with it now
resolveloads the declaration, works out which configurations this machine has, and puts it on the first line of every build:executeleaves out any lesson needing something this machine does not have. Leaving one out means it is named in the log with the reason and it produces nothing at all, so the check step never compares a committed page against a run that did not happen.Three rules keep that honest.
A skipped lesson has to have its page and its captured output already committed. Without this, a missing environment would be a way for a lesson nobody has ever built anywhere to sit in the repository looking fine.
A lesson needing more than the stock SDK has to say so on its own page with
{{needs}}, which writes the notice out ofenvironments.json. This is the CONTRIBUTING rule that used to say "a lesson that needs a runtime build without saying so in the second block, in bold, with the time and the disk cost", and it was enforced by somebody remembering it in review. It is enforced by the build now, and the notice cannot promise one configuration while the code runs in another because both come from the same file.The
envfield in a lesson's front matter has to match the most expensive thing any of its blocks asks for. A lesson says what it needs in two places, and two places that are never compared is one place plus a decoration.A blueprint generator is held to
E0outright. A blueprint is a specification generated from what the runtime and its libraries already publish, so a generator needing a built runtime would be a specification only its author could regenerate.A command that answers the question directly
Every absence comes with the reason for it, because "not here" on its own is the start of an afternoon rather than the end of one.
--require E1makes it fail instead of report, and the four platform jobs in CI now runxray env --require E0before they build anything. A job that prints what it found and carries on regardless is a job that goes green after quietly losing an environment. E0 is all the hosted runners are set up for today, and that line is the one that changes when that changes.The picture
Proving the rules do something
check --selftestgoes from nine cases to fourteen. The five new ones point a block at a configuration nobody declared, make the front matter disagree with the blocks, remove the{{needs}}from a lesson that needs one, skip a lesson for a missing configuration when its pages have never been built, and skip one when they have. The last of those has to pass, and it is the one that keeps the other four from being a harness that fails at everything.To declare a configuration nothing on this machine can provide, the harness has to add a rung to a copy of
environments.json, which is how the ladder rule that ids run fromE0upward with no gaps gets exercised too.One unrelated fix
Pointing the build at a single file, as in
build docs/diagrams/environment-ladder.dg, crashed with a raw stack trace out of the cite step, which was asking the operating system for the markdown underneath a file. It says nothing and moves on now. Found while generating the diagram above.Checked locally before this went up
Plus
check ../lessonsrun from insidedocs/, which is the bug #34 went in to catch and which the front matter reader could have brought back.