-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Alternate PR for clojurescript: clojurescript-compiler #21744
Conversation
Just a correction, it is possible to use leiningen as a single-shot build tool. Just add a dependency on the clojurescript compiler, |
Which means typing commands in an interactive environment. That doesn't make it a single-shot build tool, sorry. |
I don't know why you're so obsessed with a 'single-shot' tool. What are your requirements? I mean, do you realize how slow it is to invoke the ClojureScript compiler when you don't already have a JVM running? They even go as far to suggest this. Why do you want this so bad? I just don't get it. In any case, I concede because obviously nothing can be said to convince you that this is silly. If this gets accepted we'll just keep doing the "sigh, please install leiningen and use lein-cljsbuild instead" dance we've been doing for Clojure packages for ages when people inevitably complain that they can't actually use this for anything. |
I appreciate your concern about easing new users into |
system "./script/bootstrap" | ||
prefix.install Dir['*'] | ||
[bin/'cljsc', prefix/'script/repl', prefix/'script/repljs', prefix/'script/browser-repl'].map { | file | set_env(file) } | ||
[prefix/'script/repljs', prefix/'script/browser-repl'].map { | file | bin.install(file) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't install the files to prefix and then move them to bin, do:
bin.install "file1", "file2", "file3"...
I hope this is better. |
I prefer the name |
@@ -0,0 +1,36 @@ | |||
require 'formula' | |||
|
|||
class Clojurescript < Formula |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please always run brew audit
on your formula. The name of the class has to match the filename.
Something like:
clojurescript-compiler.rb
--> class ClojurescriptCompiler
Thank you @samueljohn |
@BrewTestBot test this please |
Approved. |
@swannodette who contributes a great deal to CLJS doesn't think this is a good idea. I and @Raynes concur. I would be most pleased if we could stop perpetuating broken use patterns like this. |
To be clear I am not the creator of ClojureScript, just one of the main devs - Rich Hickey created ClojureScript :) |
@swannodette fixed. |
This formula doesn't promote use patterns. It automates the installation of software, and it does this in accordance to provided guidelines. The opposition that it stirs stems from a worry, namely that the formula will be mistaken by users as the standard way to get started with the software. It isn't. The typical use of this software is as a library, not as a standalone executable. Were new users led to believe otherwise, support costs would increase and confusion reign supreme. Nobody wants that. What we do not want neither, I should think, is that the availability of packages in a system like homebrew becomes a factor of worries, no matter how sincere, no matter from whom. Nobody can change the fact that software has been made available, that guidelines have been provided, that caveats have been enjoined. This constitutes in and of itself the justification for a formula. It is clear that this discussion has brought up a philosophical question regarding the finality of package managers. What are they? Whom interests do they serve? And to what extent do they bestow autonomy upon end-users? I want to see Clojure succeed as much as those who oppose this formula. It is my understanding that the community should tackle the challenges it faces frontally and not via proxy. If this formula is wrong, then something is wrong with the guidelines accompanying the software. Now might be a time as good as any to address the issue at hand. |
What experience are you basing this on? You've got the people who've been hacking on this stuff for years saying this is a bad idea in this thread and the other one. Have you worked on Leiningen or Cake (now defunct in favor of Leiningen) or some other Clojure packaging project before? |
My point is based on reasoned thinking, it is not an argument from authority. https://github.com/clojure/clojurescript/wiki/Quick-Start == formula They are one and the same. |
The ClojureScript repo itself is really not for public consumption and that wiki is for I'm done with this thread, there's not much that's going to more https://github.com/clojure/clojurescript/commits/master says it all. On Fri, Aug 9, 2013 at 12:07 AM, Daniel Szmulewicz <notifications@github.com
|
We all know and respect @swannodette. Have you considered the fact that @swannodette has commits on the quick start guide, which the present formula merely automates? Does his authority on |
If you do a search on github for usages of So it appears that it is being used out there. |
@danielsz Thanks for reminding me of that. Those docs, as noted at the beginning of them, were cribbed more than a year ago from the documentation of the browser-REPL that ships as part of ClojureScript (which, for various nontechnical reasons, does not refer to the widely-used community-supported tooling), and tweaked slightly for use with Piggieback. Piggieback does not use or depend upon That's all to say, please don't look for evidence in my work of practices which I've explicitly said elsewhere are ill-advised. Homebrew contributors can obviously do whatever they think is best, but please don't use me or my work as a citation when you know I disagree with a particular approach. |
@cemerick Duly noted. Thank you for the clarification, and above all thank you for Austin. |
lines.insert(1, "CLOJURESCRIPT_HOME=#{prefix}") | ||
File.open(file, 'w') do |file| | ||
file.puts lines | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand what is going on here; can you explain? As this function is only used once I'd rather see it inline too.
If we get this fixed I'm happy to merge this.
Sure, here's the explanation: before copying the temporary directory tree that results from I hope this explains it. |
Ok, makes sense. Perhaps add a comment explaining the above? Would be good if we could somehow use |
Very cool. I wasn't aware about |
There's some warnings on installation if you set the |
Copying from the build bot:
Since this is JVM-based software (right?), a |
@adamv @MikeMcQuaid |
# from extraneous configuration. | ||
|
||
['bin/cljsc', 'script/repl', 'script/repljs', 'script/browser-repl'].each do |file| | ||
inreplace file, "#!/bin/sh", "#!/bin/sh\nCLOJURESCRIPT_HOME=#{prefix}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list can be passed directly as the first parameter to inreplace. The %w( )
list quoting syntax might look better than the quotes and commas.
ActiveMQ is an example of Java (JVM) based software where we install the package to |
@adamv Does |
Things in |
Oh, I see, that's right. And I can prevent that with |
@adamv libexec installation Thank you. |
end | ||
|
||
test do | ||
system "cljsc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A minor point, we use the full path in tests to make sure we call the right thing (and not something else with the same name on the path): system "#{bin}/cljsc"
@adamv Makes perfect sense. Thank you. |
Thank you @MikeMcQuaid and @adamv. It was a pleasure working with you. |
@adamv
The arguments in #21733 favor the removal of the clojure formula, and I'm in agreement with those. The clojure formula is superfluous:
leiningen
is all you need to get started with clojure. However, those arguments do not carry over to the case ofclojurescript
.clojurescript
is a compiler that can be run independently fromleiningen
. It compiles clojure source files down to javascript.The clojurescript devs refer new users to
leiningen
, but also include instructions on how to installclojurescript
separately. This is useful anytime you want to invoke the compiler outside of a project, in editor extensions, custom tooling, etc. Currently, it is not possible to useleiningen
as a single-shot build tool against arbitrary files.Those instructions are documented in the quick start section of the wiki.
https://github.com/clojure/clojurescript/wiki/Quick-Start
In the resulting installation,
clojurescript
can be run independently. This formula proposes to automate those prescriptions.In addition to caveats, I propose to rename the recipe to
clojurescript-compiler
so as to not to lure beginners. This is a formula similar in spirit as theclosure-compiler
formula.