File tree 16 files changed +133
-34
lines changed
drake_bazel_external_legacy
16 files changed +133
-34
lines changed Original file line number Diff line number Diff line change 1
- # Used for setup, do not build
2
- drake-master
1
+ drake
Original file line number Diff line number Diff line change 3
3
4
4
set -euxo pipefail
5
5
6
+ # Use what we downloaded to drake_bazel_external/drake,
7
+ # rather than the URL to the latest Drake master branch
8
+ # found in drake_bazel_external/MODULE.bazel.
9
+ override_module_flag=" --override_module=drake=drake"
10
+
6
11
bazel version
7
- bazel test //...
12
+ bazel test " ${override_module_flag} " //...
Original file line number Diff line number Diff line change @@ -7,4 +7,4 @@ set -euxo pipefail
7
7
sudo .github/ubuntu_setup
8
8
9
9
# drake source setup
10
- setup/install_prereqs
10
+ setup/install_prereqs " $@ "
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ For an introduction to Bazel, refer to
8
8
## Instructions
9
9
10
10
First, run the ` install_prereqs ` script to download
11
- the Drake source to ` drake-master / ` (from the current directory).
11
+ the Drake source to ` drake/ ` (from the current directory).
12
12
This also runs Drake's setup script to install the required Ubuntu packages:
13
13
14
14
``` bash
Original file line number Diff line number Diff line change 4
4
5
5
set -euxo pipefail
6
6
7
+ drake_commit_hash=' master'
8
+
9
+ while [ " ${1:- } " != " " ]; do
10
+ case " $1 " in
11
+ --drake-commit-hash)
12
+ shift
13
+ if [[ $# -eq 0 ]]; then
14
+ echo ' No argument specified for --drake-commit-hash' >&2
15
+ exit 1
16
+ fi
17
+ drake_commit_hash=" $1 "
18
+ ;;
19
+ * )
20
+ echo ' Invalid command line argument' >&2
21
+ exit 1
22
+ esac
23
+ shift
24
+ done
25
+
7
26
maybe_sudo=
8
27
if [[ " ${EUID} " -ne 0 ]]; then
9
28
maybe_sudo=sudo
16
35
17
36
# Download the drake source
18
37
wget -O drake.tar.gz \
19
- https://github.com/RobotLocomotion/drake/archive/master .tar.gz
38
+ https://github.com/RobotLocomotion/drake/archive/${drake_commit_hash} .tar.gz
20
39
trap ' rm -f drake.tar.gz' EXIT
21
-
22
- # Setup script
23
- tar -xf drake.tar.gz
40
+ mkdir -p drake && tar -xf drake.tar.gz -C drake --strip-components 1
24
41
25
42
# Install the source prereqs
26
- drake-master /setup/install_prereqs --with-bazel
43
+ drake/setup/install_prereqs --with-bazel
Original file line number Diff line number Diff line change 1
- # Used for setup, do not build
2
- drake-master
1
+ drake
Original file line number Diff line number Diff line change 3
3
4
4
set -euxo pipefail
5
5
6
+ # Use what we downloaded to drake_bazel_external_legacy/drake,
7
+ # rather than the URL to the latest Drake master branch
8
+ # found in drake_bazel_external_legacy/WORKSPACE.
9
+ export EXAMPLES_LOCAL_DRAKE_PATH=$( realpath drake)
10
+
6
11
bazel version
7
12
bazel test //...
Original file line number Diff line number Diff line change @@ -7,4 +7,4 @@ set -euxo pipefail
7
7
sudo .github/ubuntu_setup
8
8
9
9
# drake source setup
10
- setup/install_prereqs
10
+ setup/install_prereqs " $@ "
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ For an introduction to Bazel, refer to
13
13
## Instructions
14
14
15
15
First, run the ` install_prereqs ` script to download the
16
- Drake source to ` drake-master / ` (from the current directory).
16
+ Drake source to ` drake/ ` (from the current directory).
17
17
This also runs Drake's setup script to install the required Ubuntu packages:
18
18
19
19
``` bash
Original file line number Diff line number Diff line change 4
4
5
5
set -euxo pipefail
6
6
7
+ drake_commit_hash=' master'
8
+
9
+ while [ " ${1:- } " != " " ]; do
10
+ case " $1 " in
11
+ --drake-commit-hash)
12
+ shift
13
+ if [[ $# -eq 0 ]]; then
14
+ echo ' No argument specified for --drake-commit-hash' >&2
15
+ exit 1
16
+ fi
17
+ drake_commit_hash=" $1 "
18
+ ;;
19
+ * )
20
+ echo ' Invalid command line argument' >&2
21
+ exit 1
22
+ esac
23
+ shift
24
+ done
25
+
7
26
maybe_sudo=
8
27
if [[ " ${EUID} " -ne 0 ]]; then
9
28
maybe_sudo=sudo
16
35
17
36
# Download the drake source
18
37
wget -O drake.tar.gz \
19
- https://github.com/RobotLocomotion/drake/archive/master .tar.gz
38
+ https://github.com/RobotLocomotion/drake/archive/${drake_commit_hash} .tar.gz
20
39
trap ' rm -f drake.tar.gz' EXIT
21
-
22
- # Setup script
23
- tar -xf drake.tar.gz
40
+ mkdir -p drake && tar -xf drake.tar.gz -C drake --strip-components 1
24
41
25
42
# Install the source prereqs
26
- drake-master /setup/install_prereqs --with-bazel
43
+ drake/setup/install_prereqs --with-bazel
Original file line number Diff line number Diff line change 3
3
4
4
set -euxo pipefail
5
5
6
+ drake_commit_hash=
7
+
8
+ while [ " ${1:- } " != " " ]; do
9
+ case " $1 " in
10
+ --drake-commit-hash)
11
+ shift
12
+ if [[ $# -eq 0 ]]; then
13
+ echo ' No argument specified for --drake-commit-hash' >&2
14
+ exit 1
15
+ fi
16
+ drake_commit_hash=" $1 "
17
+ ;;
18
+ * )
19
+ echo ' Invalid command line argument' >&2
20
+ exit 1
21
+ esac
22
+ shift
23
+ done
24
+
6
25
cmake --version
7
26
8
27
mkdir build
9
28
pushd build
10
29
11
30
export LD_LIBRARY_PATH=" ${PWD} /install/lib${LD_LIBRARY_PATH: +: ${LD_LIBRARY_PATH} } "
12
31
13
- cmake ..
32
+ cmake_args=()
33
+ if [[ ! -z " ${drake_commit_hash} " ]]; then
34
+ # Use a specific commit of Drake source,
35
+ # rather than the latest from master.
36
+ cmake_args+=(-DDRAKE_COMMIT_HASH=${drake_commit_hash} )
37
+ fi
38
+
39
+ cmake .. " ${cmake_args[@]} "
14
40
cmake --build .
15
41
16
42
cd drake_external_examples
20
46
21
47
chmod -R a+w build || true
22
48
rm -rf build
23
-
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ set -euxo pipefail
7
7
sudo .github/ubuntu_setup
8
8
9
9
# drake source setup
10
- setup/install_prereqs
10
+ setup/install_prereqs " $@ "
11
11
12
12
# Provide regression coverage for the WITH_USER_...=ON options by un-installing
13
13
# packages that should not be necessary in this particular build flavor. This
Original file line number Diff line number Diff line change @@ -93,13 +93,19 @@ ExternalProject_Add(spdlog
93
93
# also pass this explicitly to ExternalProject_Add.
94
94
set (DRAKE_PREFIX "${PROJECT_BINARY_DIR} /drake-prefix" )
95
95
96
+ # Options to override Drake's latest source on master with a specific commit.
97
+ # See README.md for details.
98
+ set (DRAKE_COMMIT_HASH "master" CACHE STRING "Commit hash for Drake" )
99
+ set (DRAKE_COMMIT_SHA256 CACHE STRING "SHA256 hash value for Drake commit archive" )
100
+
101
+ if (NOT "${DRAKE_COMMIT_SHA256} " STREQUAL "" )
102
+ string (PREPEND DRAKE_COMMIT_SHA256 "SHA256=" )
103
+ endif ()
104
+
96
105
ExternalProject_Add(drake
97
106
DEPENDS eigen fmt spdlog
98
- URL https://github.com/RobotLocomotion/drake/archive/master.tar.gz
99
- # Or from a commit (download and use "shasum -a 256 'xxx.tar.gz'" on it to
100
- # get the URL_HASH.
101
- # URL https://github.com/RobotLocomotion/drake/archive/65c4366ea2b63278a286b1e22b8d464d50fbe365.tar.gz
102
- # URL_HASH SHA256=899d98485522a7cd5251e50a7a6b8a64e40aff2a3af4951a3f0857fd938cafca
107
+ URL https://github.com/RobotLocomotion/drake/archive/${DRAKE_COMMIT_HASH} .tar.gz
108
+ URL_HASH ${DRAKE_COMMIT_SHA256}
103
109
TLS_VERIFY ON
104
110
CMAKE_ARGS
105
111
-DCMAKE_BUILD_TYPE:STRING =${CMAKE_BUILD_TYPE}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ This pulls in Drake using the CMake `ExternalProject_Add(drake)` mechanism.
5
5
## Instructions
6
6
7
7
First, run the ` install_prereqs ` script to download the
8
- Drake source to ` drake-master / ` (from the current directory).
8
+ Drake source to ` drake/ ` (from the current directory).
9
9
This also runs Drake's setup script to install the required Ubuntu packages:
10
10
11
11
``` bash
@@ -29,3 +29,13 @@ cmake --build .
29
29
cd drake_external_examples
30
30
ctest -V .
31
31
```
32
+
33
+ ### Using a specific commit of Drake
34
+
35
+ To use Drake sources from a specific commit, pass two cache variables to
36
+ CMake (from either the CLI or the GUI):
37
+
38
+ * ` DRAKE_COMMIT_HASH ` : the commit hash
39
+ * ` DRAKE_COMMIT_SHA256 ` : the checksum of the archive downloaded from GitHub
40
+ (download https://github.com/RobotLocomotion/drake/archive/ <DRAKE_COMMIT_HASH>.tar.gz
41
+ and use ` shasum -a 256 'xxx.tar.gz' ` )
Original file line number Diff line number Diff line change 4
4
5
5
set -euxo pipefail
6
6
7
+ drake_commit_hash=' master'
8
+
9
+ while [ " ${1:- } " != " " ]; do
10
+ case " $1 " in
11
+ --drake-commit-hash)
12
+ shift
13
+ if [[ $# -eq 0 ]]; then
14
+ echo ' No argument specified for --drake-commit-hash' >&2
15
+ exit 1
16
+ fi
17
+ drake_commit_hash=" $1 "
18
+ ;;
19
+ * )
20
+ echo ' Invalid command line argument' >&2
21
+ exit 1
22
+ esac
23
+ shift
24
+ done
25
+
7
26
maybe_sudo=
8
27
if [[ " ${EUID} " -ne 0 ]]; then
9
28
maybe_sudo=sudo
16
35
17
36
# Download the drake source
18
37
wget -O drake.tar.gz \
19
- https://github.com/RobotLocomotion/drake/archive/master .tar.gz
38
+ https://github.com/RobotLocomotion/drake/archive/${drake_commit_hash} .tar.gz
20
39
trap ' rm -f drake.tar.gz' EXIT
21
-
22
- # Setup script
23
- tar -xf drake.tar.gz
40
+ mkdir -p drake && tar -xf drake.tar.gz -C drake --strip-components 1
24
41
25
42
# Install the source prereqs
26
- drake-master /setup/install_prereqs
43
+ drake/setup/install_prereqs
Original file line number Diff line number Diff line change 60
60
".bazelignore" ,
61
61
".bazelproject" ,
62
62
".clang-format" ,
63
- ".github/ci_build_test" ,
64
63
".github/setup" ,
65
64
".github/ubuntu_setup" ,
66
65
"BUILD.bazel" ,
You can’t perform that action at this time.
0 commit comments