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

etc: Fix install script for rpath removal #15550

Merged
merged 2 commits into from Jul 9, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 35 additions & 6 deletions src/etc/install.sh
Expand Up @@ -285,6 +285,19 @@ then
CFG_LIBDIR_RELATIVE=bin
fi

if [ "$CFG_OSTYPE" = "pc-mingw32" ] || [ "$CFG_OSTYPE" = "w64-mingw32" ]
then
CFG_LD_PATH_VAR=PATH
CFG_OLD_LD_PATH_VAR=$PATH
elif [ "$CFG_OSTYPE" = "Darwin" ]
then
CFG_LD_PATH_VAR=DYLD_LIBRARY_PATH
CFG_OLD_LD_PATH_VAR=$DYLD_LIBRARY_PATH
else
CFG_LD_PATH_VAR=LD_LIBRARY_PATH
CFG_OLD_LD_PATH_VAR=$LD_LIBRARY_PATH
fi

flag uninstall "only uninstall from the installation prefix"
opt verify 1 "verify that the installed binaries run correctly"
valopt prefix "/usr/local" "set installation prefix"
Expand Down Expand Up @@ -312,11 +325,13 @@ then
if [ -z "${CFG_UNINSTALL}" ]
then
msg "verifying platform can run binaries"
export $CFG_LD_PATH_VAR="${CFG_SRC_DIR}/lib":$CFG_OLD_LD_PATH_VAR
"${CFG_SRC_DIR}/bin/rustc" --version > /dev/null
if [ $? -ne 0 ]
then
err "can't execute rustc binary on this platform"
fi
export $CFG_LD_PATH_VAR=$CFG_OLD_LD_PATH_VAR
fi
fi

Expand Down Expand Up @@ -452,17 +467,31 @@ while read p; do
done < "${CFG_SRC_DIR}/${CFG_LIBDIR_RELATIVE}/rustlib/manifest.in"

# Sanity check: can we run the installed binaries?
#
# As with the verification above, make sure the right LD_LIBRARY_PATH-equivalent
# is in place. Try first without this variable, and if that fails try again with
# the variable. If the second time tries, print a hopefully helpful message to
# add something to the appropriate environment variable.
if [ -z "${CFG_DISABLE_VERIFY}" ]
then
msg "verifying installed binaries are executable"
"${CFG_PREFIX}/bin/rustc" --version > /dev/null
"${CFG_PREFIX}/bin/rustc" --version 2> /dev/null 1> /dev/null
if [ $? -ne 0 ]
then
ERR="can't execute installed rustc binary. "
ERR="${ERR}installation may be broken. "
ERR="${ERR}if this is expected then rerun install.sh with \`--disable-verify\` "
ERR="${ERR}or \`make install\` with \`--disable-verify-install\`"
err "${ERR}"
export $CFG_LD_PATH_VAR="${CFG_PREFIX}/lib":$CFG_OLD_LD_PATH_VAR
"${CFG_PREFIX}/bin/rustc" --version > /dev/null
if [ $? -ne 0 ]
then
ERR="can't execute installed rustc binary. "
ERR="${ERR}installation may be broken. "
ERR="${ERR}if this is expected then rerun install.sh with \`--disable-verify\` "
ERR="${ERR}or \`make install\` with \`--disable-verify-install\`"
err "${ERR}"
else
echo
echo " please ensure '${CFG_PREFIX}/lib' is added to ${CFG_LD_PATH_VAR}"
echo
fi
fi
fi

Expand Down
100 changes: 50 additions & 50 deletions src/libsyntax/ast.rs
Expand Up @@ -561,56 +561,56 @@ pub enum TokenTree {
TTNonterminal(Span, Ident)
}

/// Matchers are nodes defined-by and recognized-by the main rust parser and
/// language, but they're only ever found inside syntax-extension invocations;
/// indeed, the only thing that ever _activates_ the rules in the rust parser
/// for parsing a matcher is a matcher looking for the 'matchers' nonterminal
/// itself. Matchers represent a small sub-language for pattern-matching
/// token-trees, and are thus primarily used by the macro-defining extension
/// itself.
///
/// MatchTok
/// --------
///
/// A matcher that matches a single token, denoted by the token itself. So
/// long as there's no $ involved.
///
///
/// MatchSeq
/// --------
///
/// A matcher that matches a sequence of sub-matchers, denoted various
/// possible ways:
///
/// $(M)* zero or more Ms
/// $(M)+ one or more Ms
/// $(M),+ one or more comma-separated Ms
/// $(A B C);* zero or more semi-separated 'A B C' seqs
///
///
/// MatchNonterminal
/// -----------------
///
/// A matcher that matches one of a few interesting named rust
/// nonterminals, such as types, expressions, items, or raw token-trees. A
/// black-box matcher on expr, for example, binds an expr to a given ident,
/// and that ident can re-occur as an interpolation in the RHS of a
/// macro-by-example rule. For example:
///
/// $foo:expr => 1 + $foo // interpolate an expr
/// $foo:tt => $foo // interpolate a token-tree
/// $foo:tt => bar! $foo // only other valid interpolation
/// // is in arg position for another
/// // macro
///
/// As a final, horrifying aside, note that macro-by-example's input is
/// also matched by one of these matchers. Holy self-referential! It is matched
/// by a MatchSeq, specifically this one:
///
/// $( $lhs:matchers => $rhs:tt );+
///
/// If you understand that, you have closed the loop and understand the whole
/// macro system. Congratulations.
// Matchers are nodes defined-by and recognized-by the main rust parser and
// language, but they're only ever found inside syntax-extension invocations;
// indeed, the only thing that ever _activates_ the rules in the rust parser
// for parsing a matcher is a matcher looking for the 'matchers' nonterminal
// itself. Matchers represent a small sub-language for pattern-matching
// token-trees, and are thus primarily used by the macro-defining extension
// itself.
//
// MatchTok
// --------
//
// A matcher that matches a single token, denoted by the token itself. So
// long as there's no $ involved.
//
//
// MatchSeq
// --------
//
// A matcher that matches a sequence of sub-matchers, denoted various
// possible ways:
//
// $(M)* zero or more Ms
// $(M)+ one or more Ms
// $(M),+ one or more comma-separated Ms
// $(A B C);* zero or more semi-separated 'A B C' seqs
//
//
// MatchNonterminal
// -----------------
//
// A matcher that matches one of a few interesting named rust
// nonterminals, such as types, expressions, items, or raw token-trees. A
// black-box matcher on expr, for example, binds an expr to a given ident,
// and that ident can re-occur as an interpolation in the RHS of a
// macro-by-example rule. For example:
//
// $foo:expr => 1 + $foo // interpolate an expr
// $foo:tt => $foo // interpolate a token-tree
// $foo:tt => bar! $foo // only other valid interpolation
// // is in arg position for another
// // macro
//
// As a final, horrifying aside, note that macro-by-example's input is
// also matched by one of these matchers. Holy self-referential! It is matched
// by a MatchSeq, specifically this one:
//
// $( $lhs:matchers => $rhs:tt );+
//
// If you understand that, you have closed the loop and understand the whole
// macro system. Congratulations.
pub type Matcher = Spanned<Matcher_>;

#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)]
Expand Down