Skip to content

Conversation

@wking
Copy link
Contributor

@wking wking commented Mar 29, 2017

And add platform annotations.

By formally defining our syntax, we do a better job of making that syntax enforcable. We can also make platform-scoping very obvious, and no longer need to rely on “For Linux-based systems the process supports…” guards and similar.

The only intentional semantic change is that we now allow, platform-named properties that don't match platform.os. For example:

{
  "platform": {
    "os": "linux",
    …
  },
  "windows": {
    …
  },
  …
}

and even:

{
  "platform": {
    "os": "linux",
    …
  },
  "windows": "foo",
  …
}

are both legal now. This rolls back the “MUST NOT be set otherwise” requirements which had landed in #673 to make those properties consistent with our general:

Implementations that are reading/processing this configuration file MUST NOT generate an error if they encounter an unknown property.

and:

The state MAY include additional properties.

extensibility policies. The alternative would be cross-platform specification of those properties which then forbid the properties on non-matching platforms, but then the cross-platform definition would not match the platform-specific Go type. For example:

Linux *Linux `json:"linux,omitempty" platform:"linux"`

Blocking the non-matching-platform properties didn't seem to be worth the potential confusion of the Go platform tag not matching the Markdown platforms tag.

@wking wking force-pushed the mark-platform-specific-settings branch 3 times, most recently from cd05128 to cfd9af0 Compare April 7, 2017 19:17
And add platform annotations.

By formally defining our syntax, we do a better job of making that
syntax enforcable.  We can also make platform-scoping very obvious,
and no longer need to rely on "For Linux-based systems the process
supports..." guards.

The only intentional semantic change is that we now allow,
platform-named properties that don't match platform.os.  For example:

  {
    "platform": {
      "os": "linux",
      ...
    },
    "windows": {
      ...
    }
  }

and even:

  {
    "platform": {
      "os": "linux",
      ...
    },
    "windows": "foo",
  }

are both legal now.  This rolls back the "MUST NOT be set otherwise"
requirement which had landed in 718f9f3 (minor narrative cleanup
regarding config compatibility, 2017-01-30, opencontainers#673) to make those
properties consistent with our general:

  Implementations that are reading/processing this configuration file
  MUST NOT generate an error if they encounter an unknown property.

and:

  The state MAY include additional properties.

extensibility policies.  The alternative would be cross-platform
specification of those properties which then forbid the properties on
non-matching platforms, but then the cross-platform definition would
not match the platform-specific Go type.  For example:

  Linux *Linux `json:"linux,omitempty" platform:"linux"`

Blocking the non-matching-platform properties didn't seem to be worth
the potential confusion of the Go platform tag not matching the
Markdown platforms tag.

The ABNF highlighting comes from [1,2].

[1]: https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
[2]: https://github.com/github/linguist/blob/v5.0.8/lib/linguist/languages.yml#L50-L56

Signed-off-by: W. Trevor King <[email protected]>
@wking wking force-pushed the mark-platform-specific-settings branch from cfd9af0 to 05da00b Compare April 25, 2017 16:47
@mrunalp mrunalp closed this May 10, 2017
@wking
Copy link
Contributor Author

wking commented May 10, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants