Repository navigation
Let a unit carry a removelist and name the variables its conf script reads - #5
Merged
Merged
Conversation
…reads The unit loop read overlay/ and conf and nothing else, so two thirds of what a component is could be expressed as a unit and the last third could not. A removelist. A common component goes through three phases: its overlay, its conf script, its removelist. A unit had no slot for the third, so a component with a non-empty removelist could not leave the shared tree. The loop now has that phase, after the unit conf scripts and before the common removelists, where the common removelists sit relative to the common conf scripts. Only a regular file counts, as for the product-local REMOVELIST. CONF_VARS. _CONF_VARS is settled before any unit is looked at, so a unit had no way to ask for a build-time variable: mk/turnkey/mysql.mk line 1 is "CONF_VARS += MYSQL_PASS" and the unit form of that line did not exist. A unit may now carry conf-vars, naming one variable per line with # starting a comment, and those names join CONF_VARS. The values still come from the environment or the product Makefile, exactly as a makefile fragment naming a variable leaves them. The names are read from UNIT_DIRS and not from UNITS, so the chroot environment of a layered build does not change with the set of units that build applies; an entry that is not a variable name stops make and names the file it came from, rather than reaching export as junk. UNIT_DIRS moves above the CONF_VARS block, since _CONF_VARS now needs it. tests/units.sh grows to 56 checks: the removelist applied, its position, a removelist that is a directory, a unit without one, a unit left out of UNITS, a failing removelist, and for conf-vars a set variable reaching the chroot, an unset one left out, several units contributing, the set not moving with UNITS, and the error path. tests/coverage.sh: 75 of 75, 100 percent.
6 of 7 tasks
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.
The second half of the Keel decision 0010 prerequisite: the unit loop read
overlay/andconfand nothing else, so two thirds of what a component is could be expressed as a unit and the last third could not.A removelist. A common component goes through three phases: its overlay, its conf script, its removelist. A unit had no slot for the third, so a component with a non-empty removelist could not leave the shared tree (
common/removelists/mysqlis 0 bytes, which is why the experiment did not notice). The loop now has that phase, after the unit conf scripts and before the common removelists, which is where the common removelists sit relative to the common conf scripts. Only a regular file counts, as for the product-localREMOVELIST.CONF_VARS.
_CONF_VARSis settled before any unit is looked at, so a unit had no way to ask for a build-time variable:mk/turnkey/mysql.mkline 1 isCONF_VARS += MYSQL_PASS, and the unit form of that line did not exist. A unit may now carryconf-vars, one variable name per line with#starting a comment; those names joinCONF_VARS. Values still come from the environment or the product Makefile, exactly as a makefile fragment naming a variable leaves them. The names are read fromUNIT_DIRSand not fromUNITS, so the chroot environment of a layered build does not change with the set of units that build applies. An entry that is not a variable name stops make and names the file it came from, instead of reachingexportas junk.UNIT_DIRSmoves above theCONF_VARSblock, since_CONF_VARSnow needs it.Test plan
tests/units.sh, 56 checks (was 38): the removelist applied and its position, aremovelistthat is a directory, a unit without one, a unit left out ofUNITS, a failing removelist; forconf-varsa set variable reachingFAB_CHROOT_ENV, an unset one left out, two units contributing, the set not moving withUNITS, no file at all, and the error path with the offending file named.tests/coverage.sh 100: 75 of 75 checks, 100 percent, gate 100.tests/source-date-epoch.shunchanged and passing.