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

cyclic package dependency: package ahash v0.7.4 depends on itself #95

Closed
bit-ranger opened this issue Jun 30, 2021 · 33 comments · Fixed by rustwasm/wasm-bindgen#3031
Closed

Comments

@bit-ranger
Copy link

Updating crates.io index
error: cyclic package dependency: package ahash v0.7.4 depends on itself. Cycle:
package ahash v0.7.4
... which is depended on by hashbrown v0.11.2
... which is depended on by indexmap v1.7.0
... which is depended on by serde_json v1.0.64
... which is depended on by wasm-bindgen v0.2.74
... which is depended on by js-sys v0.3.51
... which is depended on by getrandom v0.2.3
... which is depended on by ahash v0.7.4
Error: Process completed with exit code 101.

more detail in github actions:

https://github.com/bit-ranger/chord/runs/2950729626?check_suite_focus=true

@LLBlumire
Copy link

I believe, though am not certain, that indexmap updating its version of hashmap to a more modern one that depends on ahash, is the cause

indexmap-rs/indexmap@8e843a9

@vicky5124
Copy link

vicky5124 commented Jul 5, 2021

A temporal fix for most people will be to force version 1.6 as a dependency by adding indexmap = "=1.6.2" to Cargo.toml's [dependencies] field, this should work even if IndexMap is only a subdependency (such as for example on h2 or serde_json).

@pepoviola
Copy link

A temporal fix for most people will be to force version 1.6 as a dependency by adding indexmap = "=1.6.2" to Cargo.toml's [dependencies] field, this should work even if IndexMap is only a subdependency (such as for example on h2 or serde_json).

Hi @vicky5124, thanks for your comment I just use this workaround and works as expected :)

@tkaitchuck
Copy link
Owner

@bit-ranger I am confused as to why this is happening.
getrandom's toml indicates it depends on js-sys only on wasm32 (which doesn't appear to be the arch in the linked build) additionally, it only depends on it if the js feature is enabled which aHash does not request.

Is the build above cross compiling and it's just not obvious? Is there some other package that is also depending on getrandom and Cargo is turning on the feature for both it and aHash in an effort to avoid duplication of the crate?

@lucacasonato
Copy link

@tkaitchuck Some other crate in the crate tree is enabling the js feature, and ahash is affected through feature unification.

Also crate resolving does not take into account the target arch. When building the crate tree, all crates for all targets are taken into account (not just the ones required for the active target arch).

@tkaitchuck
Copy link
Owner

tkaitchuck commented Jul 16, 2021

The chain works as follows:

  • aHash depends on getrandom for randomness.
  • getrandom depends on wasm-bindgen only if the js feature is enabled. (This is up to the user application, but it may be relevant)
  • wasm-bindgen has an optional dependency on serde_json which is disabled by getrandom. - So to enable this part of the cycle an app would have to also depend on wasm-bindgen and enable the serde feature. If an application does this it provides no value to getrandom other than shrinking the total binary size by unifying the crate with and without the feature.
  • serde_json has a dependency on indexmap only if the preserve_order feature is enabled (it is off by default). So to enable this part of the cycle the app would have to also depend on serde_json and enable preserve_order. Similar to the above this provides no value to wasm-bindgen.
  • indexmap depends on hashbrown but disables the ahash feature. So to complete the cycle an application would have to depend on hashbrown.

This cycle requires enabling 4 non-default features at different points. Of these js may be necessary, but the following 3 are an artifact of unification. Several of these are features are quite common, and are likely to be enabled in many applications. AHash could make getrandom optional, but it wouldn't actually break the cycle, it would just add one more feature required to complete it.

I think the most advantageous place to break the cycle would be as close to below getrandom as possible, because it should not be pulling in a bunch of extra dependencies, and serde support is not providing it any value.

One way to do this would be to refactor some of the wasm-bindgen code into a "core" package which could be depended on directly but which does not itself have the serde feature.

Another option would be to modify getrandom to support the js features without depending on js-sys or wasm-bindgen. I don't see any clear path that looks easy. Perhaps @josephlr or @newpavlov have some thoughts on this.

josephlr added a commit to rust-random/getrandom that referenced this issue Jul 16, 2021
This makes it easier to tell at a glance what parts of `wasm-bindgen`
are needed for `getrandom`.

See: tkaitchuck/aHash#95 (comment)

Signed-off-by: Joe Richey <[email protected]>
josephlr added a commit to rust-random/getrandom that referenced this issue Jul 16, 2021
This makes it easier to tell at a glance what parts of `wasm-bindgen`
are needed for `getrandom`.

See: tkaitchuck/aHash#95 (comment)

Signed-off-by: Joe Richey <[email protected]>
@josephlr
Copy link

josephlr commented Jul 16, 2021

@tkaitchuck thanks for the detailed writeup. As one of the maintainers of getrandom, I agree that this is a problem that should be fixed. Exactly who should fix it is a harder question. Thankfully, this bug is hard to hit.

One way to do this would be to refactor some of the wasm-bindgen code into a "core" package which could be depended on directly but which does not itself have the serde feature.

I like this idea, we could have a wasm-bindgen-core crate that contains only:

js-sys would then only depend on wasm-bindgen-core, the full wasm-bindgen would just reexport wasm-bindgen-core, and getrandom would just depend on wasm-bindgen-core and js-sys.

@alexcrichton would this be feasible?

I think the most advantageous place to break the cycle would be as close to below getrandom as possible, because it should not be pulling in a bunch of extra dependencies, and serde support is not providing it any value.

I completely agree, getrandom aims to have as few dependencies as possible. Other than all the wasm-bindgen stuff, we only depend cfg-if and "System ABI" crates like libc/wasi which just contain extern declarations. All of these are already dependencies of the standard library itself. The end goal is to have the functionality of getrandom in the standard library, but that's a ways off.

Another option would be to modify getrandom to support the js features without depending on js-sys or wasm-bindgen. I don't see any clear path that looks easy.

If this was possible, we would do it. We currently depend on 5 distinct imports:

  • wasm_bindgen_macro::wasm_bindgen
    • Mandatory: required on wasm32-unknown-unknown to bind to JS APIs
    • Similar to extern "C" on other platforms
  • wasm_bindgen::JsValue
    • Mandatory: used to interface with the wasm-bindgen glue code and refer to JS objects
  • js_sys::global()
    • Needed to get the global context (so we can start calling methods)
    • Not Mandatory: Could just copy the relevant code from js_sys into getrandom.
  • wasm_bindgen::JsCast
    • Only needed because we use js_sys::global()
  • js_sys::Uint8Array
    • Similarly, we could just copy the relevant code from js_sys

Also crate resolving does not take into account the target arch. When building the crate tree, all crates for all targets are taken into account (not just the ones required for the active target arch).

@bit-ranger if you use resolver = "2" does this remedy your issue?

@alexcrichton
Copy link

Oh dear this is quite the quandry, and sorry that wasm-bindgen is the cause of this! (I agree that wasm-bindgen is proabably the best place to fix this)

That being said I don't have the energy nowadays to redesign wasm-bindgen and/or implement major changes like refactoring the crates. I would recommend to basically avoid the serde features in wasm-bindgen. The serde features in wasm-bindgen are actually quite small and are probably best done manually through js-sys anyway.

AlexeyVavilin added a commit to everx-labs/ever-sdk that referenced this issue Jul 29, 2021
@StephanSchmidt
Copy link

"Thankfully, this bug is hard to hit."

I've got it in two projects, and only through second-level dependencies except for serde_json.

luckysori added a commit to comit-network/baru that referenced this issue Aug 13, 2021
After adding `proptest` as a dev-dependency to `baru/Cargo.toml`, we
could no longer build `baru` with `wasm32-unknown-unknown` as a
target:
https://github.com/comit-network/baru/runs/3318619052?check_suite_focus=true#step:6:15.

To fix it we had to follow the advice of the compile error and
explicitly enable the `js` feature of our transitive dependency
`getrandom`.

Unfortunately explicitly depending on `getrandom` created a cyclic
dependency explained here:
tkaitchuck/aHash#95. To solve this new
problem we have to depend on fix `indexmap`'s version to `1.6.2`.
@s-panferov
Copy link

Unfortunately reqwest uses those features, which makes it quite hard to avoid.

@sindreij
Copy link

sindreij commented Aug 23, 2021

I also got hit by this in a project, after adding oauth2 (at least I think that was the cause).

Setting resolver = "2" made no difference.

Using indexmap = "~1.6.2" works as a workaround.

@StripedMonkey
Copy link

oauth2 and sqlx together cause this issue. Using indexmap = "~1.6.2" does solve this.

@FylmTM
Copy link

FylmTM commented Sep 23, 2021

Hi,

Managed to run into this error, by having these 4 dependencies (all together):

[dependencies]
load_image = "2.15.1"
mongodb = "2.0.0"
reqwest = "0.11.4"
bevy = "0.5"

If I comment out any of these dependencies, it breaks cycle.

However, I did not managed to understand how exactly these 4 manage to get me into cycle.

Error for reference:

error: cyclic package dependency: package `ahash v0.7.4` depends on itself. Cycle:
package `ahash v0.7.4`
    ... which is depended on by `hashbrown v0.11.2`
    ... which is depended on by `indexmap v1.7.0`
    ... which is depended on by `serde_json v1.0.68`
    ... which is depended on by `wasm-bindgen v0.2.69`
    ... which is depended on by `js-sys v0.3.46`
    ... which is depended on by `getrandom v0.2.3`
    ... which is depended on by `ahash v0.7.4`

@videni
Copy link

videni commented Oct 1, 2021

I also have this issue, anyway to get arround this issue please?

error: cyclic package dependency: package `ahash v0.7.4` depends on itself. Cycle:
package `ahash v0.7.4`
    ... which is depended on by `hashbrown v0.11.2`
    ... which is depended on by `indexmap v1.7.0`
    ... which is depended on by `serde_json v1.0.64`
    ... which is depended on by `wasm-bindgen v0.2.74`
    ... which is depended on by `js-sys v0.3.51`
    ... which is depended on by `getrandom v0.2.3`
    ... which is depended on by `ahash v0.7.4`

@ngryman
Copy link

ngryman commented Oct 18, 2021

For those having sqlx as one of the dependencies, downgrading to 0.5.7 worked for me.
sqlx@^0.5.8 requires indexmap@^1.7.0, which makes it impossible to pin it to ~1.6.2 as suggested above.

@x1qqq
Copy link

x1qqq commented Feb 16, 2023

I am having this issue and pinning indexmap's version isnt solving it
Issue popped up once i added rust-s3 crate to one of my workspace members

@tomasro27
Copy link

For anyone that might find this helpful, and pinning indexmap is not a solution, you can run cargo metadata > metadata.json to generate a file with all the crates/dependencies on your project. Then find all usages of wasm-bindgen with the feature flag serde-serialize (make sure it is not a dev dependency, as that might be okay). After finding which crates depend on wasm-bindgen with the feature flag enabled, you will need to update those packages to the latest version that does not use the serde-serialize feature in their dependencies.

If the packages in question, are still using the feature flag serde-serialize on their latest version, you can fix the crate on a forked repository, and patch your crates in your project to use the custom version from your branch.

kierendavies added a commit to kierendavies/shuttle that referenced this issue Mar 9, 2023
Building the shuttle containers was failing during the `cargo chef cook`
step because of a cyclic dependency introduced by an upstream crate.
This did not happen when building outside of a container, because the
versions pinned by `Cargo.lock` did not contain any cycles.

See tkaitchuck/aHash#95
chesedo pushed a commit to shuttle-hq/shuttle that referenced this issue Mar 10, 2023
Building the shuttle containers was failing during the `cargo chef cook`
step because of a cyclic dependency introduced by an upstream crate.
This did not happen when building outside of a container, because the
versions pinned by `Cargo.lock` did not contain any cycles.

See tkaitchuck/aHash#95
chesedo added a commit to shuttle-hq/shuttle that referenced this issue Mar 20, 2023
* feat: shuttle-serenity initial commit poc (#429)

* feat: shuttle-serenity initial commit poc

* remove shuttle-service

* refactor: drop more shuttle_service stuff

* refactor: drop default serenity framework

* misc: add wasm32-wasi to nix shell

* refactor: cargo sort

* refactor: cargo fmt

Co-authored-by: chesedo <[email protected]>

* shuttle next wrapper POC (#431)

* feat: runtime skeleton

* feat: cleanup

* feat: update cargo.lock, sort deps

* fix: typo

* refactor: create runtimes workspace (#432)

* refactor: rename plugins to runtimes

* refactor: drop serenity folder

* refactor: rename runtime to shuttle-next

* refactor: prepare shuttle-legacy runtime

* feat: add   --provisioner-address arg to both runtimes (#433)

* refactor: fix up dependencies

* feat: add --provisioner-address to both runtimes

* feat: create a control plane interface (part 1) (#436)

* feat: add proto for runtimes

* refactor: legacy move main to lib

* feat: impl Runtime server for legacy

* feat: impl Runtime server for next

* refactor: combine runtimes into one (#438)

* feat: add --legacy flag

* refactor: merge next and legacy runtimes

* refactor: merge proto crates

* refactor: rename to runtime

* refactor: promote runtime

* refactor: update README.md

* refactor: cargo sort

* feat(deployer): add support for building wasm projects (#437)

* feat: move factory to runtime (#444)

* feat: initial commit of moving factory to runtime

* feat: replace deployer factory with dummy,
clean commented code

* feat: update legacy runtime readme

* WIP feat: start runtime from deployer (#450)

* WIP feat: start runtime from deployer

* feat: attempt to start runtime as a child process

* fix: add current dir

* feat: clean up, update readme

* feat: use cargo manifest dir for runtime path

* refactor: clean up, fmt

* refactor: clippy warnings for Eq

Co-authored-by: chesedo <[email protected]>

* feat: get logs from runtime (#459)

* feat: get logs from runtime

* refactor: trim down deployer

* refactor: start runtime earlier

* refactor: connect to client earlier

* refactor: hook runtime logs to persistence

* bug: associate deployment id with logs

* refactor: cleanup

* feat: make sure grpc connection stays open

* feat(shuttle-next): first edition of axum-wasm router (#472)

* feat(shuttle-next): POC of axum wasm router

* feat: use std mutex

* feat: serialize/deserialize http requests to rmp

this serializes/deserializes http requests across the ffi to the axum-wasm router, using the rust messagepack dataformat. sending the body is still a wip

* feat: serialize the full HTTP req/res to rmp

* fix: comment typo

* feat: start hyper with tonic and serve wasm router

* feat: clone inner router arc

* feat: send request body without serialization

* docs: todo comment

* feat: write response body

* fix: serialize response parts

* feat: deserialize parts directly from reader

this also adds a new fd to separate streaming of body and parts

* feat: add axum-wasm to runtime cli

* refactor: remove unused method

* refactor: typo

Co-authored-by: Pieter <[email protected]>

* refactor: comments, clean up wrappers

* refactor: move axum-wasm utils to shuttle-common

* refactor: fmt

* refactor: clippy

Co-authored-by: Pieter <[email protected]>

* Feat(shuttle-next): stop runtime services (#481)

* feat: add tonic endpoint to stop runtime services

* refactor: use tracing

* feat: implement stop method for serenity bot

* feat: install protoc 21.9 in dockerfile

* refactor: comment

* feat: convert uuid bytes to string then uuid

* docs: update readme

* docs: update readme for serenity bot

* feat: implement stop for axum-wasm and document it

* ci: install newer protoc in CI

* feat: remove axum-wasm feature in runtime for now

we will come back to this later and likely split the runtime by features

* docs: remove feature flags from readme

* fix: clippy

* fix: clippy

* fix: clippy

* feat: send kill signal without spawning task

* feat: return error response on kill_tx err

* feat(next): expand macro into axum routes (#488)

* feat: app codegen model

* refactor: qualify all namespaces

* feat: low-level wasi export fn

* refactor: restrict to supported axum methods

* Feat: parse shuttle::endpoint macro (#490)

* feat: parse params

* feat: parse app

* feat: add test for missing endpoint attribute

* test: invalid args, params and syntax

* feat: check for and test no params

* feat: don't emit error for missing annotation

this way users can create separate functions for their endpoint logic

* fix: remove missing attribute error, not param

* refactor: reword comment

Co-authored-by: Pieter <[email protected]>

* feat: duplicate param test, address review

* feat: only strip endpoint attributes

* feat: check for extra endpoint attributes

* refactor: clearer error span for extra endpoints

* feat: has_err variable to group param errors

* refactor: remove optional hint

Co-authored-by: Pieter <[email protected]>

* docs: add TODO for multiple endpoint attributes

Co-authored-by: Pieter <[email protected]>

* feat: merge main into shuttle-next (#543)

* feat(blog): add missing sqlx migration code to auth blog post (#408)

* feat(blog): add missing sqlx migration code

* fix: nit

* misc: 0.7.0 (#407)

* misc: drop patches

* infra: pin postgres to version 14

* refactor: fix thruster example app name

* infra: db_fqdn fix

* tests: warp hello world

* fix(cargo-shuttle): prevent crash when config owned by root (#409)

* fix: use correct timeout start point (#410)

* fix: use correct timeout start point

* tweak health check frequency

* fmt

* feat(deployer): implement container memory limits (#411)

* feat(deployer): implement container memory limits

* test: fix warp integration test

* bug: `transport error` when trying to connect to provisioner (#416)

* bug: keep provisioner connections alive

* refactor: reduce scope provisioner client is running

* feat: gateway admin revive (#412)

* feat: gateway admin command (revive)

* fmt

* clippy

* refactor: revive deployers using GatewayService

* tests: add ContextArgs

* refactor: simplify passing around of fqdn

* tests: update test archive

* refactor: remove stray exec.rs file

* refactor: unused is_error()

Co-authored-by: chesedo <[email protected]>

* bug: timeout curl health check on deployer (#415)

* Article/beta article (#420)

* updated docs url

* beta article w/ damiens corrections

* Feat(www): shuttle beta signup (#421)

* feat(www): add beta signup form

* feat: add formspree endpoint

* feat: remove socials footer from beta page

* feat: add dummy text above sign up form

* feat: placeholder gif

* feat: align dummy text left

* feat: remove gif, add text

* feat: update beta page text

* feat: update the rest of the site

* bug: Fix thruster postgres example (#414)

* feat: shell completions (#343)

* bug: package Secrets.toml (#422)

* bug: package Secrets.toml

* refactor: clippy suggestion

* bug: big archives being cut off at 32 768 bytes (#423)

* refactor: set chunked header

* refactor: don't send stream across threads

Doing this is causing us to loose everything after 32 768 bytes. Don't
know the reason why 🤷

* refactor: fix health check

* refactor: remove unused use

* chore: v0.7.1 (#424)

* chore: v0.7.1

* chore: resources v0.7.1

* docs: v0.7.1

* tests: v0.7.1

* tests: fix warp test

* tests: fix warp test

* tests: fix secrets e2e test

* ci: remove hard coded DD env

* misc: unintended shell changes

* refactor: cargo check suggestion

* refactor: provide better context for errors (#430)

* refactor: do our own health checks on deployer containers (#427)

* refactor: do our own health checks on deployer containers

We are doing this because the docker health checks eats up 25% of a
single CPU core and we are spinning up many of these containers.

https://www.reddit.com/r/docker/comments/b68r53/healtchecks_add_high_cpu_load/
moby/moby#39102

* refactor: clippy suggestion

* bug: clear build folder before extracting (#428)

* refactor: make sure extract directory is created

* tests: test build folder is cleared

* bug: clear the build directory

* added some images (#435)

* feat(www): beta blog updates (#434)

* feat: add captioned image component (#440)

* feat: add captioned image component

* feat: update images

* feat: add header caption

* fix: quotes in header

* www: post small tweaks (#439)

* a few tweaks to the article

* feat: update gif

Co-authored-by: oddgrd <[email protected]>

* feat: replace cursed gif (#441)

* Feat/update contributing (#426)

* feat(docs): update contributing.md

* feat(e2e): make e2e admin user unique

* feat(e2e): clean up e2e test projects on test complete

* feat(e2e): don't fail on superuser conflict

* feat: add section about contributing to docs

* feat: remove unwrap, add comment to drop impl

* tests: update e2e test key

Co-authored-by: chesedo <[email protected]>

* chore: v0.7.2 (#442)

* chore: v0.7.2

* chore: resources v0.7.2

* docs: v0.7.2

* misc: v0.7.2

* misc: script to deploy all examples

* misc: targets for publishing crates

* misc: remove old scripts

* misc: instructions for next steps

* misc: get Cargo.lock changes

* misc: update .PHONY

* misc: show usage

* feat: link the tracing spans between services (#445)

* ci: DD environments

* refactor: try lowering broadcast channel for quicker feedback

* refactor: propagate tracing across threads in deployer

* refactor: propagate tracing between gateway and deployer

* refactor: trace account name

* refactor: associate project with each container

* feat: trace and propagate proxy in gateway

* feat: gateway record project

* refactor: tracing use 'error' for errors

* refactor: fix comment

* refactor: drop recording unused field

* Add docker-compose extra flags param in Makefile (#446)

* Add docker-compose extra flags param

* rename to avoid confusion

* misc: restructure repo (#453)

* misc: only run e2e on production

* misc: move www to shuttle-hq/www repo

* misc: move examples to shuttle-hq/examples repo

* refactor: update links to examples repo

* ci: remove checking fmt of examples

* ci: checkout submodules

* refactor: tf files have been moved to shuttle-hq/terraform-aws-shuttle

* fix: wrap around common::ProjectName for parsing (#451)

* fix: gateway state drifts, health checks and project recreation (#447)

* misc: add more helpful flags to Makefile

* misc: remove old migrator (#463)

* feat: add account_tier column (#458)

* feat: prefetch shuttle-service crates (#461)

* feat: prefetch shuttle-service crates

* refactor: add comment to prepare.sh files

* Feat: revive via gateway endpoint (#460)

* feat: revive via gateway api initial commit

* feat: cleanup, document gateway testing

* refactor: use post for revive endpoint

Co-authored-by: Damien <[email protected]>

* feat: send task to global queue

Co-authored-by: Damien <[email protected]>

* feat: create a new admin cli binary crate (#462)

* feat: init shuttle-admin

* feat: add args

* feat: simple client

* feat: read api_key

* refactor: hook it all together

* refactor: switch to post

* fix: broken link (#467)

* fix: add timeout to health checks (#468)

* fix: add timeout to health checks

* Parameterise the timeout

* rollback on inadvertent circleci change

* misc: log out a warning when a task has been running for a long time

* longer timeouts

* Address review

* Fmt

* feat(gateway): add custom domains table and routing (#465)

* WIP feat: count recent start events before restart (#469)

* feat: count recent start events before restart

* feat: try_collect and handle error in start counter

* fix: clippy

* refactor: gateway clippy

* feat: make deployer only answer its own project (#466)

* feat: make deployer only answer its own project

* bug: use correct project name

* refactor: make backwards compatible

* Fixed Links in Readme (#477)

* refactor: base client error off response status code (#470)

* refactor: base client error off response status code

* Update common/src/models/error.rs

Co-authored-by: Oddbjørn Grødem <[email protected]>

* refactor: use tracing

Co-authored-by: Oddbjørn Grødem <[email protected]>

* feat: verify project exists before sending destroy task (#474)

* feat: add a custom domains admin route (#473)

Co-authored-by: Alex Krantz <[email protected]>

* bug: deployer freezes (#478)

* bug: reduce spawning to have deployer lock up less

* refactor: don't return cargo logs

* ci: green (#482)

* tests: allow longer time for build

* refactor: trim dependencies on persist

* refactor: clippy suggestion

* feat: TLS acceptor with SNI resolver (#471)

* fix: custom domain routing (#484)

* refactor: more metrics (#475)

* feat: add more metric dimensions to deployer

* feat: add more metric dimensions to gateway

* refactor: common metrics code

* refactor: forward account name

* refactor: add backend feature to deployer

* refactor: standardize naming

* refactor: cargo sort

* misc: configurable deployment tags (#486)

* feat: gateway restores removed containers (#485)

* fix: backend bumps and hot fixes (#487)

* Feature/support actix web (#491)

* Support actix-web: impl Service

* Support actix-web: cli + boilerplate code

* Support actix-web: add framework to doc comment

* Support actix-web: add e2e test

* Support actix-web: fmt

* Support actix-web: sorting toml deps

* Support actix-web: add actix-web to ci

* Support actix-web: formatted boilerplate code for actix-web hello world example

* Support actix-web: formatted boilerplate code for actix-web hello world example
Support actix-web: update cargo lock zstd dep

* Support actix-web: simplify example

* Support actix-web: add test, change example dependency

* fix: e2e test assert, reset example module

Co-authored-by: maksim <[email protected]>
Co-authored-by: oddgrd <[email protected]>

* Doc: Fix command to prime database with docker-compose (#502)

Signed-off-by: Federico Guerinoni <[email protected]>

Signed-off-by: Federico Guerinoni <[email protected]>

* Doc: Improve contributing documentation (#499)

In the doc it mentions to go to subfolder of examples but it was not
there :).

Signed-off-by: Federico Guerinoni <[email protected]>

Signed-off-by: Federico Guerinoni <[email protected]>

* feat: static file support for a single folder (#501)

* feat: static-folder resource

* refactor: make local client work

* refactor: make local deployer work

* feat: storage_manager

* refactor: comments

* refactor: remove unwraps and expects

* refactor: update tests

* refactor: clippy suggestion

* refactor: update version

* refactor: update readme

* refactor: update comment

* refactor: change public to static

* ci: add static-folder

* refactor: code fixes

* refactor: update tests

* refactor: update description

Co-authored-by: Damien <[email protected]>

Co-authored-by: Damien <[email protected]>

* ci: build binary (#483)

* ci: build binary

* ci: make tar archive

* ci: make GH draft release with artifacts

* ci: add aarch64

* ci: get version from tag

* ci: rename to linux builds

* ci: add windows

* ci: add macos

* ci: test all

* ci: put all the artifacts under a command

* ci: only on tagged

* ci: restore old

* ci: fix windows

* ci: put archive in separate folder

* ci: switch to tar

* ci: restore old

* refactor: better `cargo-binstall` support

Co-authored-by: Isaiah Gamble <[email protected]>

* refactor: binary name

Co-authored-by: Isaiah Gamble <[email protected]>

Co-authored-by: Isaiah Gamble <[email protected]>

* feat: bump rust to 1.64, bump dependencies (#495)

* feat: bump rust to 1.64, correct contributing.md bug

* feat: bump service deps, change example branch

* fix: pin chrono to 4.22

* chore: upgrade workspace dependencies

* feat: remove aws-smithy-types

ref: smithy-lang/smithy-rs#1760

* feat: upgrade axum to 0.6 in common

* feat: upgrade to axum 0.6.0 in deployer

* feat: upgrade gateway to axum 0.6.0

* feat: upgrde sqlx to 0.6.2 in gateway

* feat: bump chrono to 0.4.23

* feat: replace deprecated chrono functions in deployer

* feat: bump chrono in common

* feat: ignore actix integration test

* feat: implement new state extractor in gateway

* feat: interactive project initialization (#498)

* feat: bump pinned rust version to 1.65 (#504)

* feat: bump pinned rust version to 1.65

 lockfile update is from binary dist PR #483

* ci: install newer protoc

* fix: special module name warning

* fix: clippy

* feat: install newer protoc in dockerfile as well

* misc: env updates (#509)

* ci: update toolchain for binaries

* misc: update dev environment

* misc: remove patches from Cargo.lock

* feat: make the folder configurable (#508)

* feat: make the folder configurable

* Update resources/static-folder/README.md

Co-authored-by: Damien <[email protected]>

Co-authored-by: Damien <[email protected]>

* feat: implement workspace inheritance (#506)

* refactor: switch away from cargo package (#507)

* feat: add spinner wait for `project new` and `project status --follow` (#503)

Signed-off-by: Federico Guerinoni <[email protected]>
Co-authored-by: oddgrd <[email protected]>

* fix: capitalise correctly (#511)

* fix: make nice (#512)

* feat: find (soon to be) invalid project names (#479)

* feat: find (soon to be) invalid project names

* refactor: move logic to admin client

* refactor: missed axum 0.6 update (#513)

* feat: build tests in release profile, limit build workers (#514)

* feat: build tests in release profile, limit build workers

* fix: typo in manifests

* feat: create `init` project from correct dir (#518)

* misc: interactive init gif (#519)

* Feat/set examples submodule to main (#520)

* feat: revert examples submodule back to main

* feat: un-ignore actix tests

* chore: 0.8.0 (#521)

* chore: bump examples (#522)

* bug: hacking static folders (#524)

* fix: actix integration with state (#523)

* feat(gateway,deployer): add more tracing events (#500)

* feat(deployer): add more tracing events

* feat(gateway): add more tracing events

* feat: canonicalize before trace (#531)

* feat: 'clean' subcommand (#530)

* feat: 'clean' subcommand

* refactor: output cleaning is done

* Feat/set cpu limit (#529)

* feat: remove redundant actix worker limit

* feat: remove redundant build job limit

* feat: set cpu limit for deployer container

* fix: limit actix worker and build jobs to 4

* feat: add panamax for mirroring crates.io (#525)

* feat: build queue (#532)

* feat: per-project parallelism (#533)

* feat: temp validation of project name in gateway (#534)

* fix(deployer): keep Cargo.lock between deployments (#517)

* ci: remove build and push req on build binaries (#535)

* refactor: don't crash when failing to release slot (#536)

* refactor: release build slot parse type correctly (#538)

* refactor: remove prefetch (#539)

* feat: add cron job for syncing mirror (#537)

* chore: bump cargo-shuttle to 0.8.1 (#540)

* chore: bump cargo-shuttle to 0.8.1

* chore: cargo.lock

* refactor: update manifests and lockfile

implement workspace inheritance for runtime, and remove default-features from shuttle-service

* refactor: fmt

* fix: unused imports, add runtime to deploymentmanager

* feat: move storagemanager to common

* fix: storage manager imports

* fix: codegen test with outdated expected error

* fix: service tests after removing service default features

* fix: deployer tests after removing service default features

* fix: typo

* ci: attempt to fix protoc error

* fix: deployer runtime client connection

* refactor: remove redundant feature flags

* refactor: remove storage_manager from deployer crate

Signed-off-by: Federico Guerinoni <[email protected]>
Co-authored-by: Pieter <[email protected]>
Co-authored-by: Alexander Krantz <[email protected]>
Co-authored-by: Damien <[email protected]>
Co-authored-by: Ivan <[email protected]>
Co-authored-by: Peter Mertz <[email protected]>
Co-authored-by: XyLyXyRR <[email protected]>
Co-authored-by: Damien <[email protected]>
Co-authored-by: Nereuxofficial <[email protected]>
Co-authored-by: Maxim <[email protected]>
Co-authored-by: maksim <[email protected]>
Co-authored-by: Federico Guerinoni <[email protected]>
Co-authored-by: Isaiah Gamble <[email protected]>
Co-authored-by: Stijn ("stain") Seghers <[email protected]>

* refactor: one store per request (#510)

* refactor: read from file

* refactor: make store for every request

* refactor: remove the serenity runtime (#549)

* Feat: shuttle next bump deps (#551)

* fix: axum tests

* feat: bump wasmtime crates

* feat: return streaming body from wasm router (#558)

* feat: stream body to and from router

* fix: reader to stream hack didn't work in wasm

I added a post endpoint and test, which proved that my hacky stream from BufReader didn't work on the wasm side

* refactor: test string

* feat: update codegen with axum-wasm changes

* refactor: clean up

* refactor: typo

* feat: guard against large request bodies

* feat: embed runtime into client and deployer (#559)

* refactor: runtime startup code

* feat: hook cli to runtime

* feat: hook up logs

* feat: custom port

* feat: start a next project with the local runner

* feat: embed executable

* refactor: axum update

* refactor: tonic version from workspace

* refactor: kill runtime correctly

* feat: DB resources for local runs

* feat: static folders for local runs

* feat: secrets for local runner

* refactor: cleanup logs and errors

* refactor: rebuild runtime if it changed

* refactor: more comments

* feat: minimal axum logs

* refactor: unneeded default features

* refactor: fix rerun-if for runtime

* bug: codegen handle_request

* refactor: restore db error

* bug: expanded broken merge (#567)

* feat: refactor router and router inner (#566)

* refactor: clean up imports

* refactor: remove RouterInner

* feat: handle wasi errors

* feat: handle_request error handling

* docs: comments

* refactor: make hyper dev-dep, better error message

* fix: axum-wasm missed import and bracket

* feat: hook in runtime logs (#568)

* feat: simple wasm log to send over unix socket

* feat: hook up logs subscription

* refactor: extra comments

* refactor: simpler interface

* refactor: combine JsonVisitors

* refactor: clippy suggestions

* refactor: update tests

* refactor: extra comment

* refactor: increase channel for better performance

* refactor: move off stderr

* misc: merge main (#572)

* Merge remote-tracking branch 'upstream/main' into shuttle-next

* refactor: touch ups

* fix: missing feature flag in common dep (#573)

* feat: change log read to spawn blocking (#574)

* feat: DX (#577)

* feat: shuttle-next crate for better DX

* refactor: trim dependencies

* bug: fix next check

* ci: add shuttle-runtime

* refactor: activating missing features on dependencies

* refactor: update to shuttle_next::endpoint

* feat: get runtime binary from cargo install (#578)

* feat: get runtime binary from cargo install

* refactor: remove build.rs

* refactor: determine environment with debug assertions

* ci: comment out cargo-sort installation

* fix: clippy

* feat: use cargo home dir, install runtime in prepare.sh

* fix: unused import

* refactor: build from local version in prepare.sh

* fix: local debug run installing from incorrect path

* feat: canonicalize path to debug runtime

* feat: set release runtime install branch to prod

* refactor: move secondary protoc install to common stage

* feat: deployer next (#575)

* feat: propagate next runtime

* feat: store is_next in DB

* feat: runtime manager to allow deployer to start up both runtimes

* feat: make sure tests run

* refactor: better migration query

* refactor: handle runtime errors better

* feat: shutdown runtimes

* bug: missing so

* bug: stop services

* bug: ffi and runtime manager not living long enough

* bug: missing so error

* refactor: run cleanups

* refactor: clippy suggestions

* misc: remove unneeded codegen feature (#584)

* refactor: proto fixups (#585)

* refactor: comment

* refactor: restore binding to external address

* Feat: cleanup fds and tmp (#586)

* feat: remove redundant body fd and /tmp

* feat: update codegen

* refactor: remove tmp from workspace exclude

* ci: next patch and wasi target

* refactor: unwraps and mor (#587)

* refactor: better error handling

* refactor: trim mutexes

* refactor: remove abstract factory

* refactor: remove extension todo

* feat: build our images with the release profile (#583)

* feat: build our images with the release profile

Currently our containerfile builds images with the default debug profile, which means when `get_runtime_executable` is called it will try to install from a checked out local version of `shuttle-runtime`.

* feat: add build arg for cargo profile

* refactor: update comment

* fix: broken codegen/axum test

* feat: install wasm32-wasi target in deploy.sh

* feat: build deps in `CARGO_PROFILE`

* feat: use closure to determine shuttle-runtime path

* fix: path to runtime in docker deployer, clippy

* fix: incorrect function for cargo home

* refactor: always use cargo_home for path to runtime in deployer

* Feature/eng 378 axum wasm multiple handlers per endpoint (#588)

* refactor: clean up if let

* feat: move method validation, add test for it

* test: add test for chained endpoint handlers

* feat: chain endpoints with the same address

* feat: duplicate method error, handler chain bug fix

chaining handlers with a full type path caused a bug where a `,` was inserted, I think the reason is that `path` types can't be followed by `.`. Importing all the routing methods in `app` works, but it is not ideal

* refactor: remove some clones

* refactor: remove unwrap

Co-authored-by: Pieter <[email protected]>

* feat: use BTreeMap for building endpoint chains

* fix: only add namespace to first handler in chain

* fix: skip rustfmt for quote in app_to_token test

rustfmt will add a comma to the expected output, which will also be done in the expanded macro output, but not in the stringified output

* refactor: revert btreemap change

* docs: document why we sort the endpoint chains

---------

Co-authored-by: Pieter <[email protected]>

* refactor: find code to wrap legacy runtime (#675)

* refactor: find code to wrap legacy runtime

* misc: update README with test instructions

* feat: remove box self from services, remove syncwrapper from axum service (#677)

* feat: remove box self from all services

* feat: remove syncwrapper from axum integration

* Fix/move docker profiles to dev (#674)

* refactor: move docker profiles to dev.yml

* docs: update comment in makefile

* feat: extract next runtime into separate binary (#679)

* feat: extract next runtime into separate binary

* fix: remove startrequestsservice name

* Feature: remove tokio runtime from all resources (#680)

* feat: remove runtime from resources

* fix: compile errors, comments

* fix: remove comment

* feat: trim the service loader, unpin tokio (#681)

* feat: trim the serviceloader, unpin tokio

* fix: tokio sync is needed

* feat: unpin tokio in runtime as well

* fix: static folder tests need tokio rt

* feat: rename loader, build_crate return bin path

* fix: build_Crate invalid args

* chore(typos): fix typos (#682)

* chore(typos): fix typos

* Fix indentation for poise init example (#687)

* Feature/eng 477 make wasm dependencies optional (#688)

* feat: make wasm runtime dependencies optional

* feat: feature gate next lib, update readme

* ci: rename loader feature in ci

* refactor: hyper with server feature in next features

* Feature: eng 465 update all the codegens (#686)

* feat: initial commit of codegen rewrite

* refactor: wrapper to loader

* tests: update the unit tests

* fix: don't unwrap return type

* feat: setup tracing in loader codegen

* fix: pass inn logger to loader

* feat: mvp of shuttle-next local run

* refactor: move logger to runtime

* refactor: move storagemanager export to runtime

* docs: add note about git tags in contrib (#691)

* bug: idle static folder (#692)

* misc: add more logs

* bug: copy static folder

* bug: extra subdirectory

* chore: v0.11.3 (#695)

* Feature: eng 483 trim and fix the tests in shuttle-service (#693)

* tests: update build_crate tests

* tests: remove loader tests

* feat: cleanup service deps

* feat: setup integration tests in runtime

* feat: expected panic message for not_shuttle

* refactor: simplify dummy provisioner

* feat: re-export main and service from runtime

* fix: Respect `Cargo.lock` when building containers (#700)

Building the shuttle containers was failing during the `cargo chef cook`
step because of a cyclic dependency introduced by an upstream crate.
This did not happen when building outside of a container, because the
versions pinned by `Cargo.lock` did not contain any cycles.

See tkaitchuck/aHash#95

* ci: resolve CI errors in shuttle-next (#580)

* test: compile wasm module in axum runtime test setup

* ci: add next patch override to CI

* ci: include wasm32-wasi target in rust install

* fix: deployer tests where runtime fails to start

* fix: incorrect provisioner address

* feat: log service state changes in runtime

* feat: don't send stop req on startup failure

* refactor: unused imports

* refactor: handling legacy panics

* tests: deadlock less

* refactor: fixups

* refactor: clippy suggestions

* tests: mock provisioner

* refactor: restore capture from 'log' and colors

* refactor: clippy suggestions

* tests: longer wait

* tests: don't panic while holding lock

* tests: don't panic on stream closed

* tests: don't filter out state logs

* tests: bigger timeout

* ci: remove duplicate patch

* refactor: comments

---------

Co-authored-by: chesedo <[email protected]>

* Merge remote-tracking branch 'upstream/main' into shuttle-next

* Feature/eng 486 update deployer with runtime changes (#696)

* feat: update deployer to work with runtime changes

* feat: pass next feature flag to runtime installs

* fix: revert this change, the error is a rust-analyzer bug

* tests: make deployer test resources bins

* ci: add shuttle-runtime patch to CI

* refactor: consistent naming

* fix: redundant clone of runtime manager

* feat: delete rocket bin from runtime

* feat: make storagemanager a trait object

* docs: add comment about why we use arc

* refactor: use &str in storagemanager

* feat: add runtime patch to deployer

* fix: deployer logic bug, add debug logs

* feat: extract service integrations into separate crates (#702)

* feat: draft of extracting service integrations

* refactor: revert codegen changes

* refactor: depend on shuttle_runtime & service integration

* feat: remove rocket bin, comment out version check

* feat: impl from for integration wrapper

* feat: cleanup shuttle-axum docs, remove version check

* feat: actix-web service integration

* feat: extract poem service integration

* feat: extract poise service integration

* feat: extract rocket service integration

* feat: extract salvo service integration

* feat: extract the serenity service integration

* feat: extract the thruster service integration

* feat: extract warp service integration

* feat: extract the tower service integration

* feat: delete persist from service

* feat: extract tide service integration

* feat: update cargo.lock

* feat: make service integration inner pub

* fix: merge fixes

* refactor: rename integrations, remove comment

* ci: run check-standalone on services

* feat: update test resources

* ci: refactor workspace-clippy job

* fix: add tokio dev dep to services

* fix: remaining services tests

* [next] tests: CI go green (#704)

* tests: thread local tracing

* tests: bind panic in runtime

* tests: post create project params

* tests: fix cargo-shuttle

* misc: std missing from tracing

* tests: update main test for shuttle runtime

* ci: merge workspace jobs

* ci: move service to platform tests

* ci: better names

* refactor: trim dependencies

Trim dependencies to minimize the build times of user projects.

* refactor: catch error and panics in main

* tests: trim cargo-shuttle tests

Make sure there is only one main test for each major vector / feature.

* refactor: missing serde derive

* refactor: missing serde std

* ci: balance machines

* tests: give more time

* ci: bump images more

* ci: bump workspace image

* ci: 2xlarge not available '/

* feat: emit error when shuttle::main is named main (#707)

* Feature: eng 484 update init with codegen changes (#706)

* feat: update init boilerplate with shuttle-next changes

* tests: update shuttle_init_tests

* tests: ignore broken integration tests

* feat: refactor init to create bin

* fix: bug when passing path to init

* fix: codegen clippy (#709)

* fix: codegen clippy

* fix: clippy

* misc: v0.12.0-rc1 (#708)

* misc: v0.12.0-rc1

* misc: publish proto

* refactor: remove relative from build.rs

* refactor: add description to proto

* refactor: make runtime publishable

* refactor: make actix publishable

* feat: make shuttle-axum publishable

* feat: make poem publishable

* feat: make poise publishable

* feat: make shuttle-rocket publishable

* refactor: make warp publishable

* refactor: make tower publishable

* refactor: make tide publishable

* refactor: make thruster publishable

* refactor: make serenity publishable

* refactor: make salvo publishable

---------

Co-authored-by: oddgrd <[email protected]>

* [next] refactor: update runtime manager (#711)

* refactor: allow multiple runtimes to run at the same time

This is needed so that a new deployment can enter the loading state
without killing currently running runtimes.

* refactor: extra comment

* Feature: eng 497 update or remove the docs in shuttle (#710)

* docs: update service docs

* docs: move service crate-docs to runtime

* docs: update main readme

* tests: fix init test

* refactor: rename legacy runtime to alpha (#713)

* refactor: rename legacy runtime to alpha

* refactor: move next to services (#714)

* refactor: move next to services

* ci: correct next

* refactor: align folder

* [next] refactor: remove ids from runtime (#712)

* refactor: remove deployment id

* refactor: create proto LogItem directly

* refactor: more tracing for local binary

* misc: add kondo to env

* refactor: clippy suggestion

* tests: update

* feat: embed protoc in shuttle-proto (#715)

* feat: embed protoc in shuttle-proto

* fix: path to shuttle-next in runtime next-resource

* [next] bug: communicating resources (#716)

* refactor: send claim to provisioner

* feat: recording of provisioned resources

This returns provisioned resources from runtime so that they can be
recorded by deployer. Closes #ENG-252.

* refactor: restore resources for idle containers waking up

* tests: next tests using wrong folder

* tests: swap rocket for the more stable poem

* refactor: pass auth_uri to runtime

* misc: update all patches

* feat(local): don't install next-runtime from git (#718)

* fix: static folder local run clearing file contents, add missing tests in cargo-shuttle (#717)

* fix: static folder local run clearing file contents

* fix: clippy

* fix: cargo shuttle init tests not logging in

* fix: bail if non-interactive and --new without api-key

* fix: update codegen tests

* [next] refactor: tracing (#719)

* refactor: use tracing setup helper

* refactor: better trace propagation

* refactor: clippy suggestion

* fix: windows local run path bug (#721)

* refactor: pull out vendored protoc from shuttle-proto (#726)

* feat: use grpcio to avoid needing protoc

* refactor: remove vendored protoc, revert to tonic otlp

* [next] bug: misc fixes (#725)

* bug: thread local logging breaking serenity

* refactor: patch all crates

* refactor: extend tokens to 15 minutes

* bug: next runtime not sending stop signal (#728)

* bug: next runtime not sending stop signal

* refactor: better unwrap

* chore: v0.12.0 (#727)

* chore: v0.12.0

* chore: bump examples

---------

Signed-off-by: Federico Guerinoni <[email protected]>
Co-authored-by: Damien <[email protected]>
Co-authored-by: chesedo <[email protected]>
Co-authored-by: Alexander Krantz <[email protected]>
Co-authored-by: Ivan <[email protected]>
Co-authored-by: Peter Mertz <[email protected]>
Co-authored-by: XyLyXyRR <[email protected]>
Co-authored-by: Damien <[email protected]>
Co-authored-by: Nereuxofficial <[email protected]>
Co-authored-by: Maxim <[email protected]>
Co-authored-by: maksim <[email protected]>
Co-authored-by: Federico Guerinoni <[email protected]>
Co-authored-by: Isaiah Gamble <[email protected]>
Co-authored-by: Stijn ("stain") Seghers <[email protected]>
Co-authored-by: Sara Tavares <[email protected]>
Co-authored-by: HexPandaa <[email protected]>
Co-authored-by: Kieren Davies <[email protected]>
@vladimir-dd
Copy link

vladimir-dd commented Mar 24, 2023

Hope this might be useful for anyone, who is not interested in building wasm targets - one of the easy ways to break this circular dependency is by disabling wasm dependencies of getrandom package. You can fork and update getrandom(example) or simply add the patch below to your Cargo.toml:

[patch.crates-io]
# workaround to break the circular dependency for ahash(https://github.com/tkaitchuck/aHash/issues/95)
getrandom = { git = 'https://github.com/vladimir-dd/getrandom.git'}

@elenakrittik
Copy link

elenakrittik commented Mar 30, 2023

Ran into this when tried to build latest amethyst. Forcing indexmap to =1.6.2 somehow increased dependency count to 300 (from ~180) and also raised a few warnings, but worked. Thanks for the tip!

@newpavlov
Copy link

@vladimir-dd
You do not need to replace getrandom outright. Simply do not enable the js feature and instead use a custom implementation.

@vladimir-dd
Copy link

@vladimir-dd You do not need to replace getrandom outright. Simply do not enable the js feature and instead use a custom implementation.

Agreed, good point. Unfortunately, in our case js feature was required by one of the transitive dependencies.

@tkaitchuck
Copy link
Owner

Can this now be closed, or should some of the feature flags be adjusted?

@tkaitchuck
Copy link
Owner

Closing as fixed via rustwasm/wasm-bindgen#3031
Anyone still experiencing this should read the comments there.

tkmcmaster added a commit to FamilySearch/pewpew that referenced this issue Jun 3, 2024
* Moved deprecated .cargo/config to config.toml

* Ignore clippy warning

* Updated body_reader and channel dependencies

* Updated config-wasm and hdr-histogram dependencies

* Updated additional dependencies

- Held back hyper, http, and yansi due to major changes

* Updated Yansi to latest version

- Converted Paint::disable to Yansi::disable
- Removed Windows specific code. Yansi now will try to enable on Windows and automatically disables if it can't activate.

* Added build test-server to the PR script and workflow

* Fix dependency loop with ahash on itself

- tkaitchuck/aHash#95 (comment)
- rustwasm/wasm-bindgen#3031 (comment)

* Updated yaml-rust to use yaml-rust2 due to deprecation

- chyh1990/yaml-rust#197
- chyh1990/yaml-rust#160 (comment)

* Updated cargo deny to remove deprecated entries

- EmbarkStudios/cargo-deny#611
- https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html#the-clarify-field-optional

* Updated cargo lock file

* Updated code for deprecations

- Added tests for create_date_diff, then updated deprecated calls and confirmed tests still passed

* Added clippy ignore large results and errors

* Fixed tests to validate to UTC

- Since the PR flow runs on UTC, updated the local PR script to also run UTC
- Updated the create_date_diff test to validate UTC and print a warning to run UTC if it fails
tkmcmaster added a commit to FamilySearch/pewpew that referenced this issue Jun 3, 2024
* Moved deprecated .cargo/config to config.toml

* Ignore clippy warning

* Updated body_reader and channel dependencies

* Updated config-wasm and hdr-histogram dependencies

* Updated additional dependencies

- Held back hyper, http, and yansi due to major changes

* Updated Yansi to latest version

- Converted Paint::disable to Yansi::disable
- Removed Windows specific code. Yansi now will try to enable on Windows and automatically disables if it can't activate.

* Added build test-server to the PR script and workflow

* Fix dependency loop with ahash on itself

- tkaitchuck/aHash#95 (comment)
- rustwasm/wasm-bindgen#3031 (comment)

* Updated yaml-rust to use yaml-rust2 due to deprecation

- chyh1990/yaml-rust#197
- chyh1990/yaml-rust#160 (comment)

* Updated cargo deny to remove deprecated entries

- EmbarkStudios/cargo-deny#611
- https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html#the-clarify-field-optional

* Updated cargo lock file

* Updated code for deprecations

- Added tests for create_date_diff, then updated deprecated calls and confirmed tests still passed

* Added clippy ignore large results and errors

* Fixed tests to validate to UTC

- Since the PR flow runs on UTC, updated the local PR script to also run UTC
- Updated the create_date_diff test to validate UTC and print a warning to run UTC if it fails
sxlijin pushed a commit to BoundaryML/baml that referenced this issue Sep 18, 2024
I'm getting this error when loading the Rust project from an external
source that uses wasm

```
package:   /Users/nijaar/shinkai/develop/shinkai-node/shinkai-libs/shinkai-baml/Cargo.toml
workspace: /Users/nijaar/shinkai/develop/shinkai-node/Cargo.toml
    Updating crates.io index
    Updating git repository https://github.com/BoundaryML/baml.git
error: cyclic package dependency: package getrandom v0.2.15 depends on itself. Cycle:
package getrandom v0.2.15
    ... which satisfies dependency getrandom = "^0.2.0" of package const-random-macro v0.1.16
    ... which satisfies dependency const-random-macro = "^0.1.16" of package const-random v0.1.18
    ... which satisfies dependency const-random = "^0.1.17" of package ahash v0.8.11
    ... which satisfies dependency ahash = "^0.8.7" of package hashbrown v0.14.5
    ... which satisfies dependency hashbrown = "^0.14.1" of package indexmap v2.5.0
    ... which satisfies dependency indexmap = "^2.2.3" of package serde_json v1.0.128
    ... which satisfies dependency serde_json = "^1.0" of package wasm-bindgen v0.2.93
    ... which satisfies dependency wasm-bindgen = "^0.2.93" of package js-sys v0.3.70
    ... which satisfies dependency js-sys = "^0.3" of package getrandom v0.2.15
    ... which satisfies dependency getrandom = "^0.2" of package rand_core v0.6.4
    ... which satisfies dependency rand_core = "^0.6" of package crypto-common v0.1.6
    ... which satisfies dependency crypto-common = "^0.1.4" of package aead v0.5.2
```

I created another Rust project that uses baml and it wasn't hitting the
issue, so it seems that for some reason projects that also use wasm
trigger the issue.

it seems to be a very common issue

tkaitchuck/aHash#95
rustwasm/gloo#239


![image](https://github.com/user-attachments/assets/7b268d4d-67f8-48ab-9d03-ef60ebc4f181)

the tldr is that the feature `serde-serializer` seems to be the culprit
(deprecated). it's recommended to move to use `serde_wasm_bindgen` which
baml already uses! so the fix seems to be just removing the feature.

From my limited experience of the project and to try to make sure that
the wasm build still compiles and works, i actually compiled it myself
and tested it in a nodejs project, and it continues to work.

Then I imported this branch to the other project and it worked without
hitting the dependency cycle issue.
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 a pull request may close this issue.