Skip to content
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

Add gleam hex revert #3079

Merged
merged 1 commit into from
May 10, 2024
Merged

Add gleam hex revert #3079

merged 1 commit into from
May 10, 2024

Conversation

Pi-Cla
Copy link
Contributor

@Pi-Cla Pi-Cla commented May 1, 2024

A new package can be reverted or updated within 24 hours of it's initial publish, a new version of an existing package can be reverted or updated within one hour.

Resolves #3019

@Pi-Cla
Copy link
Contributor Author

Pi-Cla commented May 1, 2024

I did some live testing on my gling package and it looks like it worked! :D
https://hex.pm/packages/gling

@Pi-Cla Pi-Cla force-pushed the publish-revert branch 2 times, most recently from e0055b5 to f75626b Compare May 1, 2024 23:55
@Pi-Cla
Copy link
Contributor Author

Pi-Cla commented May 1, 2024

I ended up having to make revert a subcommand because if I tried to make it like:

gleam publish --revert [VERSION]

where --revert and [VERSION] is optional then I end up with the type Option<Option<String>> which Clippy does not like.

This would then require that whenever any part of the code was processing the full double option to add a line to silence clippy else clippy would complain.

@Pi-Cla Pi-Cla changed the title Add gleam publish --revert Add gleam publish revert May 1, 2024
@inoas
Copy link
Contributor

inoas commented May 3, 2024

I ended up having to make revert a subcommand because if I tried to make it like:

gleam publish --revert [VERSION]

where --revert and [VERSION] is optional then I end up with the type Option<Option<String>> which Clippy does not like.

This would then require that whenever any part of the code was processing the full double option to add a line to silence clippy else clippy would complain.

Thanks for doing this!
Note: The changelog is now not in sync.

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Thank you!

Let's make this gleam hex revert to match gleam hex retire.

compiler-wasm/Cargo.toml Outdated Show resolved Hide resolved
compiler-cli/src/main.rs Outdated Show resolved Hide resolved
@Pi-Cla Pi-Cla force-pushed the publish-revert branch 2 times, most recently from 5562360 to 8f2f9c9 Compare May 4, 2024 09:38
@Pi-Cla Pi-Cla changed the title Add gleam publish revert Add gleam hex revert May 4, 2024
@Pi-Cla
Copy link
Contributor Author

Pi-Cla commented May 4, 2024

Thank you!

Let's make this gleam hex revert to match gleam hex retire.

Oh I missed this comment. Ok now it matches the other gleam hex commands. I also added the option to specify which package to revert

@Pi-Cla Pi-Cla force-pushed the publish-revert branch 3 times, most recently from b812871 to f8c81ce Compare May 4, 2024 22:41
@@ -22,6 +22,7 @@ itertools.workspace = true
serde.workspace = true
termcolor.workspace = true
tracing.workspace = true
getrandom.workspace = true
Copy link
Member

Choose a reason for hiding this comment

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

How come this has been added? This package is unmodified and doesn't use random numbers afaik

Copy link
Contributor Author

@Pi-Cla Pi-Cla May 8, 2024

Choose a reason for hiding this comment

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

This is from the required update to the latest version of hexpm-rust. After the dependencies in hexpm-rust were bumped there was a new indirect dependency added getrandom which required the js flag to be added in order for builds on the wasm32-unknown-unknown target to work. I added comments to the root Cargo.toml to explain this:

gleam/Cargo.toml

Lines 61 to 62 in 218ebb0

# A transitive dependency needed to compile into wasm32-unknown-unknown
# See https://docs.rs/getrandom/latest/getrandom/index.html#webassembly-support

Edit: I need to add a mention to the workspace getrandom to at least one of the crate level Cargo.tomls or else the js flag does not actually get factored into dependency handling and then the wasm32-unknown-unknown build fails. And since the transitive dependencies come fromgleam-wasm I have added it there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also this diff is inaccurate now because the PR that updates the CI got merged which also required this same hexpm-rust bump. So this PR now has no additional effect on this stuff. I have rebased this PR to give an updated diff

A new package can be reverted or updated within 24 hours of it's initial publish,
a new version of an existing package can be reverted or updated within one hour.

Resolves gleam-lang#3019
Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Wonderful! Thank you!!

@lpil lpil merged commit f863f0b into gleam-lang:main May 10, 2024
12 checks passed
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.

gleam publish --revert
3 participants