-
Notifications
You must be signed in to change notification settings - Fork 151
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
Problem using 'lein trampoline' with cljsbuild #204
Comments
Hrm... That is weird, especially the :dev profile part. This is probably a dumb question, but are you using the very latest version of Leiningen? I'm trying to think of some way to determine whether the bug is in lein-cljsbuild or Leiningen itself. The only idea I've come up with is to run some other plugin with :hooks under |
(smacks self on side of head). Looks like I’m running Leiningen 2.0.0, and the latest is 2.1.3. For some reason, I had thought that Leiningen or my config would do an auto version check. I’ll upgrade Leiningen and test again. I should have an answer within an hour or two. Assuming that the issue remains, I’ll try your idea of testing with another plugin. I’m still pretty new to this; do you suggest any plugin in particular? David From: Evan Mezeske [mailto:notifications@github.com] Hrm... That is weird, especially the :dev profile part. This is probably a dumb question, but are you using the very latest version of Leiningen? I'm trying to think of some way to determine whether the bug is in lein-cljsbuild or Leiningen itself. The only idea I've come up with is to run some other plugin with :hooks under lein trampoline, and see if it fails the same way or not. — |
Ok, some updates…
So, revised bug report:
Thanks, |
Thanks for the detailed updates! I will try to debug further sometime soon. Unfortunately it may have to wait until a weekend. (Regarding your lein upgrade sidenote -- I have no idea, very weird!) |
I have the same problem, i.e. "trampoline" doesn't work with ":hooks [leiningen.cljsbuild]'". I think it's the same problem reported in technomancy/leiningen#956 . Could it be that the latest versions of Leiningen fixed the 30 seconds hang that prompted the explicit exit hack ( d836402 )? If so, maybe just removing the hack fixes the issue? |
Please try a working fork that removes the exit hack and therefore allows use of trampoline: [ccfontes/lein-cljsbuild "0.3.2-no-exit"] |
I don't know if it breaks something else, but I can confirm that ccfontes fork fixes the issue with trampoline. I also hope to see this in lein-cljsbuild main repo soon. Thanks Carlos! |
@xavi that's great, thanks! Your links helped me out on this one too. As stated at d836402 - "Without an explicit exit, the in-project subprocess seems to just hang for around 30 seconds before exiting. I don't fully understand why...", but rumored as comment to that commit to be already fixed at technomancy/leiningen@4f2bc32, was my reason to remove the exit hack. |
It happened here that, when deploying to heroku, the process hanged at
hanged, but resumed after some minutes..
|
timed out one time:
but next try it didn't. |
new record: Successfully compiled "target/cljsbuild-main.js" in 312.549677798 seconds. |
For those using trampoline because of the exceeded memory quota on heroku there is the following alternative: |
I also hit this issue. @ccfontes fork apparently fixes it. Any plan to merge it? |
@jeluard I haven't repro'd yet, but would look at a pull request if it were offered. |
I just tried to reproduce and now get an exception when running This is with leinigen 2.3.2 (not sure what else changed). The previous behaviour was to exit after the line |
I can't point at a sample project, haven't seen the problem myself (though I only just saw this issue 10 minutes ago and I generally don't use General Q: why are people using trampoline when using cljsbuild? |
I was referring to a project that works for you so that I can check it does work for me and try to reproduce the issue.
It's mostly for convenience. I use trampoline when I want to run something close to production environment. It's simpler if I can do this without having to change my project.clj (as I have cljsbuild hook defined). |
@cemerick I was using But recently Heroku changed the recommended way to deploy (as @technomancy mentioned, and Heroku updated docs already reflect). Since then I'm following those recommendations to deploy my projects, and this issue has become non-relevant for me. |
Here is a sample repository from which is possible to reproduce the issue: https://github.com/magomimmo/modern-cljs.git
$ lein trampoline ring server-headless
2013-09-13 00:34:50.568:INFO:oejs.Server:jetty-7.6.8.v20121106
2013-09-13 00:34:50.604:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:3000
Started server on port 3000 Seems to be a classpath problem. |
I just wanted to add that this issue also breaks the REPL in the Cursive Intellij plugin, which apparently is using lein trampoline. @cursiveclojure @cemerick |
Looking at this, it's not clear to me why cljsbuild isn't on the classpath (along with e.g. everything else I have in Again, happy to look at a PR on this. In the meantime: don't use |
Cursive uses the underlying trampoline mechanism to start all its REPLs. This is so that the REPL startup script can be created in the Cursive process without having to start another external JVM just to create the script. It does create a few problems due to trampoline use and also the fact that the JVM used to run Cursive may be different to the one used to run the REPL, so some config is sometimes incorrect. However it's nothing that can't be worked around so far, and the alternative would be very slow. |
Please note that this is also a problem when deploying to Heroku as they suggest to use trampoline. |
Looking back at this, I've since developed and deployed an application to heroku that uses cljsbuild without trampoline, with no problems. That's strictly FWIW, just by way of saying I've still not been able to repro. This issue has been open ~18 months, but no PR has been offered. If someone could produce one and have at least one other person vouch for it, I'll be happy to merge, if only to make sure that @cursiveclojure doesn't continue to get bitten. |
When I was cleaning my forks, I accidentally deleted the one where the fix was made, but the source is still in clojars. I think It was a trivial fix though. That being said, I don't even remember anything about the issue anymore. Sorry :( |
ran into this with @cursiveclojure today. :( |
me too. it seems to be one of the things getting in the way of having cursive + cljs repls play together |
This is preventing me from running REPLs in Cursive, sadly. |
Doing battle with this bug again today. I think I've broken it down into two discrete issues. The first has to do with the fact that this git repo actually produces two separate artifacts; the lein plugin artifact The code in I'm not sure that I understand exactly why, but the temporary script that lein generates for the trampoline execution includes this at the top: (require (quote cljsbuild.compiler)
(quote cljsbuild.crossover)
(quote cljsbuild.util)) And the classpath that lein launches that script with does not include any of the lein plugin artifacts, nor their dependencies, so This is easy enough to remedy; just add Which brings us to the second issue, which is the one that @ccfontes mentioned above; in the happy path of the code in I can't find anything in the code that explains why that If I do the two things above (add |
I filed a PR, and also deployed a fork with the fix to clojars: https://clojars.org/cprice404/lein-cljsbuild/versions/1.1.2-noexit |
@cprice404 Awesome, thank you for digging into this! Will have a closer look at your PR and your findings in the next couple of days 😉 |
@mneise ping! just checking to see if this slipped through the cracks. |
@cprice404 Merged your PR for the Regarding the missing |
@mneise thanks! Adding Any idea when you might do the next release? Looking forward to getting off of my fork :) |
@cprice404 Will try to cut a release this weekend 😉 |
yay, thanks. |
I presume this went into the 1.1.3 release? If so, thanks! |
@cprice404 Yes, just released it this morning. Let me know if you experience any issues 😉 |
will do, thanks again. |
Upgraded our project to 1.1.3 today and it seems to be working fine. Thanks! |
There's an open issue with using cljsbuild with `lein trampoline`. See emezeske/lein-cljsbuild#204
Hi is there any update on this? Or are we still using the same workaround of adding the dependency? |
There seems to be a conflict using 'lein trampoline' when my project includes ':hooks [leiningen.cljsbuild]' in the top-level map in project.clj. Operations as simple as 'lein trampoline run' silently exit, with no error message, while 'lein run' works fine.
This bug-report is still half-baked. I'm sending what I've found so far, in the hope that someone will shout back "known bug" or "don't do that", but I can certainly give more detail if this is a real issue I've hit.
What I do know so far:
The text was updated successfully, but these errors were encountered: