Skip to content

fix: actionable download hint and stale-archive fix in build script#188

Merged
lklimek merged 7 commits into
developfrom
copilot/update-build-script-for-tenderdash
Mar 12, 2026
Merged

fix: actionable download hint and stale-archive fix in build script#188
lklimek merged 7 commits into
developfrom
copilot/update-build-script-for-tenderdash

Conversation

Copilot AI commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

In restricted network environments (corporate proxies, self-signed certs), ureq/rustls fails to download the Tenderdash proto archive with InvalidCertificate(UnknownIssuer). A secondary bug left a zero-byte zip on disk, causing the retry to emit a confusing InvalidArchive error instead of repeating the actionable hint.

proto-compiler/src/functions.rs

  • Initiate the HTTP request before File::create so a failed connection never leaves a stale empty archive that confuses the retry logic.
  • Emit an actionable download hint on every download failure (not just SSL errors). The hint includes the source URL and the exact local path where the archive should be saved, so users can download it manually with a browser or curl and re-run the build.
  • Removed the TENDERDASH_PROTO_ARCHIVE env-var workaround; the hint-based manual workflow is sufficient.
Original prompt

This section details on the original issue you should resolve

<issue_title>copilot cannot build tenderdash abci</issue_title>
<issue_description>Copilot cannot build this create because tenderdash cannot be downloaded due to invalid SSL certificate. please update the build script to display an actionable error in in this case with a guide how to download the file manually and where to put it on disk. You can also add some env variable that will point to location of the downloaded file. </issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…ar support in build script

Co-authored-by: lklimek <842586+lklimek@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with tenderdash build due to invalid SSL certificate fix: actionable SSL error and TENDERDASH_PROTO_ARCHIVE support in build script Mar 12, 2026
Copilot AI requested a review from lklimek March 12, 2026 18:19
Comment thread proto-compiler/src/functions.rs Outdated
.map_err(|e| format!("cannot download archive from: {}: {:?}", url, e))?;
let rb = ureq::get(url).call().map_err(|e| {
let err_str = format!("{:?}", e).to_lowercase();
// Detect SSL / TLS certificate errors and emit an actionable hint.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot emit the hint on all errors, not just SSL. When download fails, show hint.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in c97f4bd. The hint is now emitted on all download errors, regardless of error type.

Comment thread proto-compiler/src/functions.rs Outdated
const RETRIES: usize = 2;
let mut last_err: Option<String> = None;

// If the caller supplied a custom archive via TENDERDASH_PROTO_ARCHIVE and

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Let's revert that TENDERDASH_PROTO_ARCHIVE feature. It's enough to display a hint to the user every time download fails. The hint should include: source url and destination path. Also check if check_state function is in use; if yes, adjust hint to create state file, otherwise remove that unused function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in c97f4bd. TENDERDASH_PROTO_ARCHIVE is reverted. The hint now fires on every download failure and includes the source URL and destination path. Since check_state is in use, Option 2 (TENDERDASH_DIR) also instructs users to create a download.state file in the output directory containing the commitish.

…E, note state file for TENDERDASH_DIR

Co-authored-by: lklimek <842586+lklimek@users.noreply.github.com>
Copilot AI changed the title fix: actionable SSL error and TENDERDASH_PROTO_ARCHIVE support in build script fix: actionable download error hint in build script Mar 12, 2026
Copilot AI requested a review from lklimek March 12, 2026 18:42
Comment thread proto-compiler/src/functions.rs Outdated
2. Save it to: {archive_file}\n\
3. Re-run the build.\n\
\n\
Option 2 – Provide pre-extracted sources:\n\

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove option 2, just support option 1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in bdced96. Option 2 is removed; the hint now only shows the archive download/save steps.

…karound

Co-authored-by: lklimek <842586+lklimek@users.noreply.github.com>
…ive on download failure

Co-authored-by: lklimek <842586+lklimek@users.noreply.github.com>
…ad hint

Co-authored-by: lklimek <842586+lklimek@users.noreply.github.com>
Copilot AI changed the title fix: actionable download error hint in build script ci: dynamic protoc install + auto-recover from SSL archive download failure Mar 12, 2026
@lklimek

lklimek commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator

@copilot revert 560241e

Co-authored-by: lklimek <842586+lklimek@users.noreply.github.com>

Copilot AI commented Mar 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot revert 560241e

Done in e649d22. .github/actions/deps/action.yaml is restored to its state before 560241e.

Copilot AI changed the title ci: dynamic protoc install + auto-recover from SSL archive download failure fix: actionable download hint and stale-archive fix in build script Mar 12, 2026
@lklimek
lklimek marked this pull request as ready for review March 12, 2026 19:46
@lklimek
lklimek merged commit 1695d09 into develop Mar 12, 2026
8 of 9 checks passed
@lklimek
lklimek deleted the copilot/update-build-script-for-tenderdash branch March 12, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

copilot cannot build tenderdash abci

2 participants