Comments (11)
I've updated the issue with a stack trace. To aid in troubleshooting, the issue happens if either of these swaps are present: https://github.com/ztellman/byte-streams/blob/master/src/byte_streams.clj#L123
That is to say, commenting out both allows me to do the :reload-all
with no issue.
from byte-streams.
This is almost certainly because Clojure blindly re-creates protocols when a namespace is reloaded, which causes incompatible (but identical) versions. I should be able to fix it by doing a check for whether the protocol already exists. Thank you for the report, and sorry to make you track it down. I'll update once a fix is available.
from byte-streams.
Thanks for the quick response; it looks like this is the same issue: overtone/overtone#70
They fixed it by wrapping it in a defonce
: overtone/overtone@2185920
from byte-streams.
@ztellman I've currently worked around this by requiring byte-streams in a defonce, which basically is the same as wrapping every source file in one. That's not an ideal solution, but it means that I can actually reload my repl in-place.
The PR I have doesn't seem to resolve all of the issues, but it tackles some. Are you interested in resolving this? If not, will you please document the README to warn others to require it in a defonce
?
from byte-streams.
@ztellman To be clear, that PR doesn't fix all issues. I still see some issues with two Type
objects not being able to be compared, since each Type
apparently represents a different type. It doesn't happen on reload, though, it happens when using byte-streams after reload.
from byte-streams.
Sorry, I hit merge too quickly. The best fix for this is to wrap the protocol definition, not the conversions themselves. This approach won't fix any other conversions people have defined in their own code.
I've reverted the merge, and am working on a commit that uses this approach.
from byte-streams.
@ztellman So, my branch/PR fixes the issue of reloading, but it doesn't tackle everything. The best repro steps I have are listed below. Please open up a fresh repl and run each of these, in sequence. Assuming all has been fixed, there should be no errors. I've marked where things currently fail on both your master and my PR branch.
(require 'byte-streams-simple-check)
(require 'pushback-stream-test)
(require 'byte-streams-test)
(require 'clojure.test)
(clojure.test/run-all-tests)
(require 'byte-streams :reload-all) ; This fails on your branch
(clojure.test/run-all-tests) ; This fails on my branch
from byte-streams.
So when I run your example code, I get a spurious failure in one test the first time around, and a deadlock in the second. I'm not really quite sure what's going on in there, but I suspect it isn't related to the original issue. Can you confirm that this unblocks your :reload-all
workflow?
from byte-streams.
Checking now.
from byte-streams.
@ztellman It looks like that does the trick! Naturally, your fix is much more keen than my bumbling around; thanks for putting it in.
With that out of the way, before a new release goes out, are you interested in adding AOT and direct linking? I've made a PR.
from byte-streams.
I'm closing this; please let me know when you deploy a new release!
from byte-streams.
Related Issues (20)
- print-bytes calls .release ByteBuf? HOT 2
- Bytes are read from stream to String incorrectly HOT 8
- cannot compile due to No such var: p/min HOT 9
- lein uberjar fails with type hints in graph.clj HOT 12
- Use InputStream#transferTo? HOT 3
- Can't convert stream of byte arrays to seq of byte arrays HOT 1
- `closeable-seq` may end prematurely after GC? HOT 3
- Undeclared behavior for transfer {:close? true} HOT 2
- Lein javac options break on JDKs >= 12 HOT 1
- Reflection warnings in byte-streams.clj HOT 6
- "Don't know how to convert class manifold.stream.BufferedStream into class java.io.InputStream" HOT 1
- `:tag` metadata can be wrong
- Remove use of clj-tuple
- Deprecation of `byte-streams` namespace is undocumented.
- Late declarations of lower-cost conversions are ineffective HOT 3
- Lazy converter instantiation performance gotcha HOT 1
- Release 0.4.0? HOT 6
- Single-segment and clj-commons namespaces do not share conversion graph HOT 1
- `def-conversion` sometimes breaks when AOT-compiled HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from byte-streams.