Skip to content

Commit

Permalink
Remove ./configure script.
Browse files Browse the repository at this point in the history
This patch finally fixes a long-standing gripe that I have had with my
build toolchain with the requirement to run a ./configure script. By
removing the conditional TensorFlow GPU package, I finally feel ready
to let go of this configuration script and the generated
config.pbtxt. The last remaining piece of functionality ported over
from ./configure is the recording of the workspace source path, which
has been assimilated into build_info.pbtxt.

github.com//issues/73

Signed-off-by: format 2020.01.16 <github.com/ChrisCummins/format>
  • Loading branch information
ChrisCummins committed Jan 24, 2020
1 parent 7e8f19f commit ef18664
Show file tree
Hide file tree
Showing 45 changed files with 84 additions and 811 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# In-tree generated files.
/.env
/bootstrap.sh
/config.pbtxt
/learn/docker/clgen/*.tar.bz2
/experimental/deeplearning/clgen/docker_worker/*.tar.bz2
/experimental/deeplearning/clgen/docker_worker/cache
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ install:
- chmod -R 777 $TRAVIS_BUILD_DIR

script:
- docker run -v$TRAVIS_BUILD_DIR:/phd chriscummins/phd_build:latest -c "./configure --noninteractive && ./tools/flaky_bazel.sh run --config=travis //tools:whoami"
- docker run -v$TRAVIS_BUILD_DIR:/phd chriscummins/phd_build:latest -c "./tools/flaky_bazel.sh run --config=travis //tools:whoami"

notifications:
email:
Expand Down
38 changes: 0 additions & 38 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ sh_binary(
srcs = ["make_build_info_pbtxt.sh"],
)

filegroup(
name = "config",
srcs = ["config.pbtxt"],
visibility = ["//visibility:public"],
)

proto_library(
name = "config_pb",
srcs = ["config.proto"],
Expand Down Expand Up @@ -103,38 +97,6 @@ py_library(
],
)

py_test(
name = "configure_test",
srcs = ["configure_test.py"],
data = [":configure_py"],
deps = [
"//labm8/py:app",
"//labm8/py:bazelutil",
"//labm8/py:test",
],
)

py_library(
name = "getconfig",
srcs = ["getconfig.py"],
visibility = ["//visibility:public"],
deps = [
"//:config_pb_py",
"//:config_pbtxt_py",
"//labm8/py:pbutil",
],
)

py_test(
name = "getconfig_test",
srcs = ["getconfig_test.py"],
deps = [
":getconfig",
"//labm8/py:app",
"//labm8/py:test",
],
)

# Golang.
# Gazelle directive:
# gazelle:prefix github.com/ChrisCummins/phd
Expand Down
20 changes: 4 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,22 +205,10 @@ about it and accept patches.

#### Ubuntu/MacOS instructions

Configure the build and answer the yes/no questions. The default answers should
be fine:

```sh
$ ./configure
```

Note that CUDA support requires CUDA to have been installed separately,
see the [TensorFlow build docs](https://www.tensorflow.org/install/) for
instructions. CUDA support has only been tested for Linux builds, not macOS or
Docker containers.

The configure process generates a `bootstrap.sh` script which will install the
required dependent packages. Since installing these packages will affect the
global state of your system, and may requires root access, inspect this script
carefully. Once you're happy to proceed, run it using:
Run `python3 ./tools/boostrap.py` to generate a `bootstrap.sh` script which will
install the required dependent packages. Since installing these packages will
affect the global state of your system, and may requires root access, inspect
this script carefully. Once you're happy to proceed, run it using:

```sh
$ bash ./bootstrap.sh
Expand Down
57 changes: 15 additions & 42 deletions config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,51 +23,24 @@ option java_multiple_files = true;
option java_outer_classname = "ConfigProto";
option java_package = "com.phd";

// The root message describing the repository configuration.
//
// A plaintext format instance of this message is generated in the root of this
// repository by the ./configure script, with path ./config.pbtxt.
message GlobalConfig {
// Either "darwin" or "linux" for macOS or Linux host OS, respectively.
required string uname = 1;
// An identifying sha256 string generated by ./configure and used to determine
// whether or not the configuration process needs to be run.
required string configure_id = 2;
// Whether or not the repository is configured to use CUDA.
// TODO(cec): Remove this field now that 'options' field exists.
required bool with_cuda = 100;
// Configuration options.
required GlobalConfigOptions options = 3;
// Important paths.
required GlobalConfigPaths paths = 4;
}

message GlobalConfigOptions {
required bool with_cuda = 1;
required bool update_git_submodules = 2;
}

// A list of absolute paths to import system files and directories.
message GlobalConfigPaths {
// The root directory of the repository.
required string repo_root = 1;
// The path of the system python.
required string python = 2;
}

// Bazel build stamp info.
message BuildInfo {
required int64 seconds_since_epoch = 1;
required string host = 2;
required string user = 3;
required string version = 4;
required bool repo_dirty = 5;
// The path of the workspace. This leaks the out-of-tree build abstraction
// enforced by bazel, and this directory is likely not available from within
// bazel test sandbox. Access this value only when truly required, such as
// from within tool that modify or export the source tree.
required string unsafe_workspace = 2;
required string host = 3;
required string user = 4;
required string version = 5;
required bool repo_dirty = 6;
// Git branch and remote are only available if on and tracking a git branch,
// respectively.
required string git_commit = 6;
optional string git_branch = 7;
optional string git_tracking = 8;
optional string git_remote_url = 9;
optional string git_commit_author = 10;
optional int64 git_commit_seconds_since_epoch = 11;
required string git_commit = 7;
optional string git_branch = 8;
optional string git_tracking = 9;
optional string git_remote_url = 10;
optional string git_commit_author = 11;
optional int64 git_commit_seconds_since_epoch = 12;
}
Loading

0 comments on commit ef18664

Please sign in to comment.