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

Fixed Urchin invocation problem in zsh and dash. Makefile "future-proofed" to take advantage of true cross-shell testing with Urchin, once available. #568

Merged
merged 1 commit into from
Nov 2, 2014

Conversation

mklement0
Copy link
Contributor

The - currently - pointless invocations of Urchin itself from the various shells have been removed, pending the amendment to Urchin that will allow true cross-shell tests (see #551).

This fixes #565.

@xcambar
Copy link
Contributor

xcambar commented Oct 31, 2014

Seems like one of the Travis jobs fell asleep :)

The PR fixes #565 for me.

@@ -33,12 +33,14 @@ list:

# Set of test-<shell> targets; each runs the specified test suites for a single shell.
# Note that preexisting NVM_* variables are unset to avoid interfering with tests, except when running the Travis tests (where NVM_DIR must be passed in and the env. is assumed to be pristine).
# CAVEAT: FOR NOW, ALL TESTS ARE INVARIABLY ALWAYS RUN WITH `sh`. THIS MUST BE FIXED ONCE `urchin` SUPPORTS THE `-s <shell>` OPTION - see https://github.com/creationix/nvm/issues/551:
# In the recipe command below, replace `$(URCHIN) -f test/$$suite` with `$(URCHIN) -s $$shell -f test/$$suite`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of the caveat, could we just add the -s $SHELL now, and it would theoretically be a noop until the PR is merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would break the urchin invocation, because the current urchin doesn't yet recognize -s.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

urchin -f test/install_script -s dash works fine locally, it's just got naive option parsing, so the -f has to go first. Presumably with the PR, option ordering wouldn't matter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only reason that works is a bug in the argument-validation code, which my urchin PR fixes.

However, my urchin PR requires that options come before non-option arguments, so your variant would break.

Do you feel that urchin should support options even after the (one and only) non-option argument?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All command line tools should accept all dashed or double-dashed option pairs in any order, always.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true for options, but not for positional arguments. I think you're mistaking -f to be the option for specifying the target directory, but it isn't: -f is a standalone option that means 'force running even if the target dir name doesn't contain the word "test"'.

Thus, test/install_script in the above is the (one and only) positional argument, so you'd effectively place the -s option after it, which is typically not supported (see http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html) - and I would recommend against it.

…s available, for true cross-shell testing.

Conversely, a warning is issued if it is missing, because that implies that no actual cross-shell testing will take place.

Also, the shell command that determines the set of available test suites is now POSIX-compliant.
@mklement0
Copy link
Contributor Author

The updated PR now does the following:

  • If the installed Urchin version is found to support the -s <shell> option, that option is used, and life is good.
  • Otherwise, a warning about the lack of true cross-shell tests is issued.

Thus, once the Urchin version that supports -s <shell> becomes available, the makefile should start using it automatically.

This strikes me as the most robust approach.

@mklement0 mklement0 changed the title Fixed Urchin invocation problem in zsh and dash. Fixed Urchin invocation problem in zsh and dash. Makefile "future-proofed" to take advantage of true cross-shell testing with Urchin, once available. Nov 1, 2014
ljharb added a commit that referenced this pull request Nov 2, 2014
Fixed Urchin invocation problem in zsh and dash.  Makefile "future-proofed" to take advantage of true cross-shell testing with Urchin, once available.
@ljharb ljharb merged commit 4b6075e into nvm-sh:master Nov 2, 2014
@mklement0 mklement0 deleted the fix_make_file branch November 5, 2014 23:23
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.

make test-* fails "can't open input file: urchin"
3 participants