termusic icon indicating copy to clipboard operation
termusic copied to clipboard

Failed to release V0.8.0

Open tramhao opened this issue 1 year ago • 19 comments

Before I publish, I use

cargo hack check --feature-powerset --depth=1

and

cargo hack check --feature-powerset --depth=2

to verify if each feature can compile along and can be combined. However, right now rusty,mpv,gstreamer and all-backends are exclusive. Many errors happened. I have to yank the version published to crates.io and revert the V0.8.0 tag.

How to combine these options?

tramhao avatar Mar 23 '24 16:03 tramhao

Also the release ci give error:

<br class="Apple-interchange-newline">
Invalid workflow file: .github/workflows/release.yml#L1The workflow is not valid. .github/workflows/release.yml: Unexpected tag '!matrix.cross'
--


[Invalid workflow file: .github/workflows/release.yml#L1](https://github.com/tramhao/termusic/actions/runs/8402646915/workflow)
The workflow is not valid. .github/workflows/release.yml: Unexpected tag '!matrix.cross'

tramhao avatar Mar 23 '24 16:03 tramhao

to verify if each feature can compile along and can be combined. However, right now rusty,mpv,gstreamer and all-backends are exclusive. Many errors happened. I have to yank the version published to crates.io and revert the V0.8.0 tag.

the likely problem is that crate server requires to set features in crate playback, but rust has no conditional to enable code based on a feature enabled in a lower crate and needs it enabled in the current crate too (ie you cannot have mpv enabled in playback, while feature mpv is not enabled on server). in addition i made it a compile-error if no backends are compiled in (from my reading of cargo-hack --feature-powerset it tries to run with --no-default-features and so may end up running without any backends)

hasezoey avatar Mar 23 '24 19:03 hasezoey

if you really want to compile with no default features (ie no backends selected) and / or to have the server & playback consistencies a little better, i could refactor it (similar to how cursive's backends work via boxed dynamic trait objects)

context for the cargo-hack errors:

error: No useable backend feature!
   --> playback/src/lib.rs:137:9
    |
137 |         compile_error!("No useable backend feature!");
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
   --> playback/src/lib.rs:128:67
    |
128 |     fn new_default(config: &Settings, cmd_tx: PlayerCmdSender) -> Self {
    |        -----------                                                ^^^^ expected `Backend`, found `()`
    |        |
    |        implicitly returns `()` as its body has no tail or `return` expression

For more information about this error, try `rustc --explain E0308`.

or are there different ones for you?

hasezoey avatar Mar 23 '24 20:03 hasezoey

Maybe we could leave it for now. No need to change now. As long as conpiles are ok, I could live with that.

tramhao avatar Mar 23 '24 21:03 tramhao

Here comes an awkward situation. When I publish termusic-playback, the default option is no backend, so I have to add "rusty" as default backend. Then when I publish termusic-server, the default option of playback will lead to uncovered pattern in line 288 of server.rs(rusty backend), and I have to change it back. Magically, the installation by cargo install works. I really don't know why. I think it's best that we could use rusty as default backend, and mpv/gst as added. For crates.io package, it's best to keep minimum requirement. For github package, it's best to include all packages.

tramhao avatar Mar 24 '24 09:03 tramhao

i will look into making it less "uncovered"

hasezoey avatar Mar 24 '24 11:03 hasezoey

Any way, I have to go to v0.9.0 becuase 0.8.0 was yanked before. And I think it's a big improvement. Need a major release. For later fixes, we could put it in 0.9.1

tramhao avatar Mar 24 '24 11:03 tramhao

what was the reasoning for not just going to 0.8.1 (as the 0.8.0 had been yanked) and going straight to 0.9.0?

hasezoey avatar Mar 24 '24 11:03 hasezoey

Because I think this release is a big improvement. If we release V0.8.1, probably some user will think it's a bug fix release only.

tramhao avatar Mar 24 '24 13:03 tramhao

We could close this now. Thanks.

tramhao avatar Mar 25 '24 06:03 tramhao

Second thought, we should leave this open. After solving the compile error of no backend, we could close it.

tramhao avatar Mar 25 '24 07:03 tramhao

After solving the compile error of no backend, we could close it.

which solution do you want instead, a Dummy backend with no panic (but also will never do anything), or panic on no backend?

personally, i like having a compile error, that way you dont get surprised that there is no backend

hasezoey avatar Mar 25 '24 10:03 hasezoey

The problem is, with the compile error, cargo publish will fail. Up to now I still don't know why v0.9.0 from crates.io can compile. I modified default of playback to publish it, and then revert it to publish server.

tramhao avatar Mar 25 '24 13:03 tramhao

The problem is, with the compile error, cargo publish will fail. Up to now I still don't know why v0.9.0 from crates.io can compile. I modified default of playback to publish it, and then revert it to publish server.

sure now we can set rusty as a default feature in playback, if it is not compiled in via no-default-features, everything will work now (at least it should)

hasezoey avatar Mar 25 '24 13:03 hasezoey

In af1d013e I added rusty as default backend. Publishing playback is working. However, when I try to publish termusic-server, error happens:

error[E0599]: no method named `media_info` found for struct `GeneralPlayer` in the current scope
   --> src/server.rs:289:53
    |
289 | ...   p_tick.radio_title = player.media_info().media_title.unwrap_or_default();
    |                                   ^^^^^^^^^^ method not found in `GeneralPlayer`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `termusic-server` (bin "termusic-server") due to 1 previous error
error: failed to verify package tarball

tramhao avatar Mar 26 '24 01:03 tramhao

However, when I try to publish termusic-server, error happens:

cannot reproduce this error, maybe try removing target/ and try again?

hasezoey avatar Mar 26 '24 08:03 hasezoey

Please try this: af1d013e2510da5629c5313b627b98c2e4932d8a and

cargo publish -p termusic-server --dry-run

I deleted target and same error happened.

tramhao avatar Mar 26 '24 09:03 tramhao

I deleted target and same error happened.

can reproduce, if i read the logs correctly, that is because to publish the crate, it downloads all the dependencies (including workspace crates) from crates.io, so it tried to download termusic-playback v0.9.0, which obviously does not have that feature yet, as it is not published yet as v0.9.1 (or other version)

TL;DR: you need to publish termusic-playback before you can publish termusic-server

hasezoey avatar Mar 26 '24 10:03 hasezoey

Ok. That'll be the next release.

tramhao avatar Mar 26 '24 13:03 tramhao

When I publish V0.9.1, firstly I publish termusic-lib with:

cargo publish -p termusic-lib

and it's fine. Then I publish termusic-playback with:

cargo publish -p termusic-playback

The error with no-default-backend happened. I tried with:

cargo publish --features all-backends -p termusic-playback

and it's fine. @hasezoey Is this the right way to do the publishing? Thanks.

tramhao avatar Aug 21 '24 08:08 tramhao

Here comes the problem: When I try to publish the last package, it complains about no usable backends. And I cannot publish with --feature all-backends because it's not a feature for tui.

cargo publish --features all-backends -p termusic --dry-run
error: none of the selected packages contains these features: all-backends

How should I publish the last package?

tramhao avatar Aug 21 '24 08:08 tramhao

I solve it with:

cargo publish --features termusic-playback/all-backends -p termusic

And let's see the result. If something is wrong, we'll have to go to v0.9.2

tramhao avatar Aug 21 '24 08:08 tramhao

cargo install termusic

doesn't work

cargo install --features termusic-playback/all-backends termusic

works.

tramhao avatar Aug 21 '24 08:08 tramhao

When I try to publish the last package, it complains about no usable backends. And I cannot publish with --feature all-backends because it's not a feature for tui.

this should be addressed by #359, with it termusic-playback can compile without a backend selected (but will panic at runtime if trying to use one), but the TUI does not make use of any backend, only some types. now termusic-server will compile-error instead as it would not make any sense to compile it without any backend (where it would then error at runtime); also it has a default backend (rusty) set.

hasezoey avatar Aug 21 '24 13:08 hasezoey

should be fixed by 211fc3fe008932d052d31d3b836e8a80eade3cfe

tramhao avatar Aug 23 '24 16:08 tramhao