Code Monkey home page Code Monkey logo

Comments (11)

jeaye avatar jeaye commented on June 3, 2024

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.

ztellman avatar ztellman commented on June 3, 2024

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.

jeaye avatar jeaye commented on June 3, 2024

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.

jeaye avatar jeaye commented on June 3, 2024

@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.

jeaye avatar jeaye commented on June 3, 2024

@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.

ztellman avatar ztellman commented on June 3, 2024

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.

jeaye avatar jeaye commented on June 3, 2024

@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.

ztellman avatar ztellman commented on June 3, 2024

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.

jeaye avatar jeaye commented on June 3, 2024

Checking now.

from byte-streams.

jeaye avatar jeaye commented on June 3, 2024

@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.

jeaye avatar jeaye commented on June 3, 2024

I'm closing this; please let me know when you deploy a new release!

from byte-streams.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.