weavejester / lein-ring

Ring plugin for Leiningen
Eclipse Public License 1.0
501 stars 100 forks source link

lein-ring setting readonly attribute to files on windows #167

Open shrayasr opened 9 years ago

shrayasr commented 9 years ago

Hello,

I just finished my first ever production project with Clojure (yay!) and thoroughly loved the experience of using clojure, lein and lein-ring. Thanks much for contributing such a great deal to the ecosystem.

When we started to package the app up for production, we chose the lein uberjar way for which I needed to have a -main function. After I set all of this up and ran lein ring server-headless, I got more output that said compiling ... and so on. It didn't affect me, so I moved on.

After doing this, when I was editing a file, I kept getting the error saying that the file was readonly. I can however force save the file and it all turns out to be ok but then I don't think this is the right way (and it gets troublesome if I have to do it everytime).

Here is a gist of the smallest code set to reproduce this issue.

The steps that I followed to get this were:

  1. Open a cmd window at project location
  2. run lein ring server-headless and this is what I see:

    >lein ring server-headless
    Compiling win-ro-problem-test.handler
    2015-08-21 16:41:36.198:INFO::main: Logging initialized @2486ms
    2015-08-21 16:41:38.596:INFO::main: Logging initialized @1279ms
    2015-08-21 16:41:42.000:INFO:oejs.Server:main: jetty-9.2.10.v20150310
    2015-08-21 16:41:42.032:INFO:oejs.ServerConnector:main: Started ServerConnector@7ca22ff0{HTTP/1.1}{0.0.0.0:3000}
    2015-08-21 16:41:42.032:INFO:oejs.Server:main: Started @4715ms
    Started server on port 3000
  3. I then open up handler.clj in an editor window
  4. Go over to http://localhost:3000/foo and verify that the response is shown
  5. Come back to editor window, change response to something else and save (file still isn't readonly)
  6. Go over to the browser and refresh, verifying that the new response is shown
  7. Come back to the editor, file is now readonly.

If I revert the change I made, then the readonly issue goes away. This means that that change is the one that is causing the problem. Also in the gist, i've added the diff of the changes I made to get to the version where I can generate a jar with lein uberjar.

Do let me know if you need any other details. Many thanks.

dijonkitchen commented 5 years ago

Any updates or should it be closed?