Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upUpdated library isn't always correctly reloaded #1
Comments
This comment has been minimized.
This comment has been minimized.
|
Hi @t-mw, thanks for the issue. I ran into this doing game development a few months ago and eventually concluded that this regressed for me going from Rust 1.19.0 to 1.20.0, but that the new behavior is the best that can guaranteed by POSIX, so we were just getting lucky earlier. As a first workaround, perhaps see if an older version of Rust behaves like you want? If you want to properly fix it, see the Rust issue rust-lang/rust#44365 for some discussion of their workaround. If you want to contribute, trying to adapt the suggested |
porglezomp
added
enhancement
help wanted
labels
Feb 2, 2018
porglezomp
changed the title
Updated library isn't reloaded on macOS High Sierra (10.13.3)
Updated library isn't always correctly reloaded
Feb 2, 2018
This comment has been minimized.
This comment has been minimized.
|
I believe there might also be some file-locking issues with libraries on Windows that I'm not dealing with, so the fix that builds to a random/hashed/counter library name would also be a great solution to deal with that. |
This comment has been minimized.
This comment has been minimized.
|
Hi, thanks for the links - I'll have a read through the discussion. Confusingly, I'm able to get |
t-mw
added a commit
to t-mw/live-reloading-rs
that referenced
this issue
Feb 2, 2018
This comment has been minimized.
This comment has been minimized.
|
It looks like updating the library name fixes the issue for me. To automate it, I thought that ideally the build script would generate the library name, but it seems that In the end I went with t-mw@4f7be34, which is very hacky in that it relies on modifying the cargo manifest, but otherwise it should be set and forget. Without the build script the library should revert to the old behavior of using a fixed name. |
porglezomp
added
the
bug
label
Feb 3, 2018
This comment has been minimized.
This comment has been minimized.
|
The build script has the disadvantage that it creates a new version of the library for each change, which for whatever reason is slower than compiling to the same target. This shell script works with the changes in the commit above on OS X, but doesn't need the build script changes and avoids compiling to new targets. |
This comment has been minimized.
This comment has been minimized.
|
If I understand correctly, that will copy the library to another path after compiling, then fix it up so it gets loaded. Is Do you know what an alternative to |
This comment has been minimized.
This comment has been minimized.
|
That's right - there's a path embedded in the dylib as The equivalent on Linux might be |
t-mw commentedFeb 2, 2018
•
edited
Thanks for sharing this library.
I'm not sure if this is a bug in
live-reloading-rs,rust_libloadingor OS X, but after triggering a live reload in macOS High Sierra (10.13.3) the old version of the library continues to be used.For example, after updating the demo application to use increments of
5instead of2and recompiling withcargo build --lib, the console output looks like this:The same process on OS X El Capitan (10.11.6) produces the correct output.
Just putting this out there in case other people have the same issue.