Skip to content

Add more context to quit_if_file_exists in configure.py & delete config.toml in CI #112916

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

Merged
merged 1 commit into from
Aug 7, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def p(msg):


def err(msg):
print("configure: error: " + msg)
print("\nconfigure: ERROR: " + msg + "\n")
sys.exit(1)

def is_value_list(key):
Expand Down Expand Up @@ -544,7 +544,14 @@ def write_config_toml(writer, section_order, targets, sections):

def quit_if_file_exists(file):
if os.path.isfile(file):
err("Existing '" + file + "' detected.")
msg = "Existing '{}' detected. Exiting".format(file)

# If the output object directory isn't empty, we can get these errors
host_objdir = os.environ.get("OBJDIR_ON_HOST")
if host_objdir is not None:
msg += "\nIs objdir '{}' clean?".format(host_objdir)

err(msg)

if __name__ == "__main__":
# If 'config.toml' already exists, exit the script at this point
Expand Down
3 changes: 2 additions & 1 deletion src/ci/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ for example:
./src/ci/docker/run.sh x86_64-gnu
```

Images will output artifacts in an `obj` dir at the root of a repository.
Images will output artifacts in an `obj` dir at the root of a repository. Note
that the script will overwrite the contents of this directory.

To match conditions in rusts CI, also set the environment variable `DEPLOY=1`, e.g.:
```
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ docker \
--env BASE_COMMIT="$BASE_COMMIT" \
--env DIST_TRY_BUILD \
--env PR_CI_JOB \
--env OBJDIR_ON_HOST="$objdir" \
--init \
--rm \
rust-ci \
Expand Down
3 changes: 3 additions & 0 deletions src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ trap datecheck EXIT
# sccache server at the start of the build, but no need to worry if this fails.
SCCACHE_IDLE_TIMEOUT=10800 sccache --start-server || true

# Our build may overwrite config.toml, so we remove it here
rm -f config.toml

$SRC/configure $RUST_CONFIGURE_ARGS

retry make prepare
Expand Down