Skip to content

Commit

Permalink
Support setting SNOPT_PATH=git
Browse files Browse the repository at this point in the history
For now, this is the same as the default (i.e., when SNOPT_PATH is
unset).  In the future, this will be required to use SNOPT from git.
  • Loading branch information
jwnimmer-tri committed May 23, 2018
1 parent cc8a89c commit 40504fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/bazel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ Using the RobotLocomotion git repository

1. Obtain access to the private RobotLocomotion/snopt GitHub repository.
2. `Set up SSH access to github.com <https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/>`_.
3. ``export SNOPT_PATH=git``

The build will attempt to use this mechanism anytime SNOPT is enabled and a
source archive has not been specified.
Expand Down
4 changes: 3 additions & 1 deletion tools/workspace/snopt/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ def _setup_local_archive(repo_ctx, snopt_path):

def _impl(repo_ctx):
snopt_path = repo_ctx.os.environ.get("SNOPT_PATH", "")
if not snopt_path:
# For now, an empty path defaults to use git. In the future, settting
# SNOPT_PATH="git" will be required -- an empty path will report an error.
if snopt_path in ["git", ""]:
_setup_git(repo_ctx)
else:
_setup_local_archive(repo_ctx, snopt_path)
Expand Down

0 comments on commit 40504fa

Please sign in to comment.