Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if Mac.OS requires the currently running OS X version to be included in the options #7815

Closed
vitorgalvao opened this issue Dec 5, 2014 · 3 comments

Comments

@vitorgalvao
Copy link
Member

Here’s an oddity I’ve noticed when working on #7813. Not sure if a bug or a feature.

Error: Cask 'keyremap4macbook' definition is invalid: 'url' stanza failed with: wrong number of arguments (0 for 1..2)

When using if MacOS.version, one of the options must refer to the latest OS X version (:yosemite) and have a valid url or we get the above error. This means it’s a requirement to have the equivalent to elsif > any_version_except_:yosemite, elsif <= :yosemite, elsif == :yosemite, or else, and those must have a valid url. If any of the first options are included, else can be safely excluded.

This can be seen as feature in that it tries to make sure the if logic addresses the latest version of the OS, but it can also be seen as a bug in cases where a version for Yosemite does not exist.

@rolandwalker
Copy link
Contributor

It's a bug. The depends_on doesn't get tested until install time.

One immediate answer is that we should allow a special value such as url :unknown which will ensure that the Cask "compiles" but allow a more graceful failure later in the process.

A longer term answer is a variant syntax instead of if.

EDIT: the relevant open issue on :unknown is #5248

@rolandwalker
Copy link
Contributor

For development purposes, it would also be nice to have a convenient way of overriding the OS X release, architecture, etc, at the CLI.

@vitorgalvao vitorgalvao added the bug Issue describing a reproducible bug. label Dec 5, 2014
@rolandwalker rolandwalker changed the title if Mac.OS requires latest OS X version to be included in the options if Mac.OS requires the currently running OS X version to be included in the options Dec 6, 2014
@rolandwalker
Copy link
Contributor

This is improved by #7935 in that the failing test will give a descriptive error such as "url is required".

The missing piece is to accept :unknown as a value for all required stanzas (or perhaps false). So I'm closing in favor of existing #5248.

@miccal miccal removed the bug Issue describing a reproducible bug. label Dec 23, 2016
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants