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

The link_args attribute has been removed #2

Open
ohmree opened this issue Sep 3, 2021 · 6 comments
Open

The link_args attribute has been removed #2

ohmree opened this issue Sep 3, 2021 · 6 comments

Comments

@ohmree
Copy link
Contributor

ohmree commented Sep 3, 2021

See rust-lang/cargo#9557.

A temporary fix I found was to remove all references to it in the source code and add a build script that prints cargo:rustc-link-arg=-export-dynamic to my app (I'm on Linux).

Could it perhaps be possible to export a helper for users to put in their build scripts that prints the correct cargo:rustc-link-arg directive for their platform and selected feature set?

Or is this only needed for the reloady library and not for the actual projects that use it?
Because in that case I feel like the fix would be easier.

@anirudhb
Copy link
Owner

anirudhb commented Sep 3, 2021

I'll look into having cargo-hot-reload automatically create a .cargo/config file for the project with the appropriate RUSTFLAGS. On that note, 👀 I've noticed some activity of yours around this repo, could I ask what you're using it for?

@ohmree
Copy link
Contributor Author

ohmree commented Sep 3, 2021

I've noticed some activity of yours around this repo, could I ask what you're using it for?

Nothing much, I was just looking to see if rust has a nice hot reloading mechanism a-la modern javascript bundlers (vite, snowpack) in $CURRENT_YEAR.

If reloady gets more versatile hot reloading (which I know must be hard to implement) I'd be very happy and would definitely use it for all of my own rust projects (not that there are that many of those).
Until then I think I'll have to go with the standard edit-compile-run workflow, since hot-reloading functions isn't that helpful to me atm (unless you can hot-reload methods and struct associated functions).

@whyCPPgofast
Copy link

whyCPPgofast commented Feb 7, 2022

Hi, I have a big use case for this but I can't get it to work on windows.

So since link_args is not there anymore i tried going back to nightly build 2021-04-01 and I still get an error when running cargo hot-reload error: serde use of unstable library feature 'btree_retain' i tried adding the #![feature(btree_retain)] to every lib.rs inside your repo file with no success.

Also the clap crate inside cargo-hot-reload needs to be upgraded to 3.0.14 with features = ["derive"] and replace the use clap::Clap with use clap::Parser. The problem with clap was there even on the newest rust version. I cloned the repo and it immediately showed that error.

My use case is loading a 50GB file into memory and that takes usually up to 10 minutes so I desperately need a way to hot reload a function that is reading the loaded file content in a loop.

@anirudhb
Copy link
Owner

anirudhb commented Feb 8, 2022

Unfortunately, there are some big issues with the state of this library. Rust doesn't provide an easy way to export symbols from an executable (pending rust-lang/rust#84161 for -C export-executable-symbols) and the current "hack" doesn't seem to work on newer versions of Rust :(

I plan to open a larger tracking issue in this repository regarding this, but wanted to give a brief summary given the silence on this.

Thanks for your use case @whyCPPgofast :)

@whyCPPgofast
Copy link

whyCPPgofast commented Feb 8, 2022

Can you try running rustup default nightly-2021-04-01 and see why it doesnt compile on that version either? I'm fine with using an older rust version. Or if you know a better rust version to make this run on windows.

Thank you for your response.

@anirudhb
Copy link
Owner

Unfortunately I don't have a windows machine right now so I can't fix and test this :(

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

No branches or pull requests

3 participants