indygreg / python-build-standalone

Produce redistributable builds of Python
Mozilla Public License 2.0
1.97k stars 125 forks source link

All files are broken in 20230507 release #172

Closed bianjp closed 1 year ago

bianjp commented 1 year ago

All zst files in 20230507 release are actually ascii files.

$ file cpython-3.11.3+20230507-x86_64_v2-unknown-linux-gnu-pgo+lto-full.tar.zst
cpython-3.11.3+20230507-x86_64_v2-unknown-linux-gnu-pgo+lto-full.tar.zst: ASCII text, with very long lines (65536), with no line terminators
$ cat cpython-3.11.3+20230507-x86_64_v2-unknown-linux-gnu-pgo+lto-full.tar.zst.sha256
[99,52,52,99,50,49,54,101,49,99,97,56,49,100,102,57,52,53,49,51,5
rattlecattle commented 1 year ago

Same here. The files are all ascii text apparently.

rattlecattle commented 1 year ago

Looks like the error is originating from this lines:

https://github.com/indygreg/python-build-standalone/blob/dab7051c5b80af535f71c0bc4a2b07543868392c/src/github.rs#L66-L78

When passing the data to client.build_request, octocrab seems to be encoding the POST data as JSON always irrespective of what is set.

From https://github.com/XAMPPRocky/octocrab/blob/7061b48c9bb799cb7effa0ecb8fd366a23f13de2/src/lib.rs#L1219-L1239

    pub fn build_request<B: Serialize + ?Sized>(
        &self,
        mut builder: Builder,
        body: Option<&B>,
    ) -> Result<http::Request<String>> {
        // Since Octocrab doesn't require streamable bodies(aka, file upload) because it is serde::Serialize),
        // we can just use String body, since it is both http_body::Body(required by Hyper::Client), and Clone(required by BoxService).

        // In case octocrab needs to support cases where body is strictly streamable, it should use something like reqwest::Body,
        // since it differentiates between retryable bodies, and streams(aka, it implements try_clone(), which is needed for middlewares like retry).

        if let Some(body) = body {
            builder = builder.header(http::header::CONTENT_TYPE, "application/json");
            let request = builder
                .body(serde_json::to_string(body).context(SerdeSnafu)?)
                .context(HttpSnafu)?;
            Ok(request)
        } else {
            Ok(builder.body(String::new()).context(HttpSnafu)?)
        }
    }
indygreg commented 1 year ago

Ugh. Octocrab's new API doesn't even allow sending non-string HTTP requests as it requires a request: http::Request<String>.

Lessen learned from trusting the release process to just work. I'll try to get a new release shipped today.

indygreg commented 1 year ago

I deleted and re-uploaded the assets to the 20230507. Sorry about the mix-up, everyone.