-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
clojure formula dependency is wrong #50536
Comments
Homebrew will use brewed dependencies where possible. The fact that other Java versions were previously possible was an unfortunate side-effect of java not being build from source as a formula. The current situation is the intended usage within homebrew. If people want to use a different dependency the best course of action is to maintain it in a tap. |
Just a couple of points to highlight one more time:
|
I guess this is good reason to not use brew ¯_(ツ)_/¯ |
I think we will probably just pull this out into our own tap then. |
90% of the clojure community are known to use either JDK 8 or JDK 11 (https://clojure.org/news/2020/02/20/state-of-clojure-2020) And clojure.org recommends running clojure on JDK8 or JDK11 at this time. It seems very strange to me that brew are packaging clojure against the platforms recomendations. It's also not a purely theoretical issue I have clojure apps which use the clojure command line tools, and don't run on anything other than JDK 8 due to either dependencies on XMLGregorianCalendar; which was removed in JDK9, or now illegal reflective access calls because of the JDK9 module system. |
|
The homepage for homebrew says:
This is clearly incorrect in this instance. The Clojure team has expressed what the correct dependency is, and if this is not what is installed then homebrew is clearly not doing the main thing that it's advertised to do. Homebrew will be installing something that the significant majority of users do not need (and is not sanctioned), and then expecting them to fix it. I find this disappointing and makes me suspicious of how other packages are handled. |
You need Java to use Clojure, we install that dependency. Ergo "Homebrew installs the stuff you need"
The team only indicated that the current dependency is incorrect, not which formula is the correct one. If the correct way is not to depend on any Java formula that breaks the flow for new users and is equally unacceptable. |
Why push users into a default configuration that is neither recommended by clojure's core team or its community of practitioners? It strikes me that establishing the wrong default is going to cause new and existing users of the language problems. |
Yes, people mentioned that. The next person who only says it's wrong without providing an alternative will be billed for the time I spend on this. |
The OP says:
That seems like an alternative to me? |
Please can we keep this civil without criticising volunteers for their work, whether we like it or not. Personally I'd prefer the depedency was left as it was; but if an openjdk release must be forced on people picking a release of either 8 or 11 would I think be preferable to users of this formula. |
I appreciate the homebrew maintainers' work and respect their policies, and I hope others will as well. While I have my own opinions, I accept the decision here and Clojure will move their formula into their own tap, so this does not need to be an area of conflict. We've been contemplating this for a while anyways. |
We will not be removing this formula from homebrew-core until it is no longer widely used. Of course Clojure can create their own tap and recommend that if they prefer. If someone can point out specific, reproducible steps to demonstrate how this configuration is broken (rather than "unsupported", "wrong" or "not recommended") we can consider modifying the formula so that these problems are addressed. Additionally:
I'm not sure how this doesn't address the problem (please clarify if it does not). If you do not wish to use the installed If this is simply "Homebrew installs a dependency it didn't before and I don't like that": that's par for the course with a package manager. |
Note if you're part of this conversation it's not at all helpful to just 👎 comments without actually attempting to answer the several questions that need answering to reach an adequate resolution. |
As a more meta-point I realise language communities operate independently of each other and can't be expected to keep up with what all the others are doing but this is not an issue specific to Clojure or Java. NodeJS and several other languages and applications regularly say "but this formula doesn't depend on X!" when it actually does. It may not depend exclusively on the specific implementation or version we have chosen but that's a wider Homebrew implementation detail. We used to have things that allowed random formulae to depend on any of multiple dependencies to fulfil the dependency ( |
Hey @MikeMcQuaid and others, thanks for engaging productively. Clojure does not actively test against "the latest version of Java", but rather tries to focus on the LTS releases (currently Java 8 or 11, soon 14). We do try to make sure it works on the interim ones, but that's not part of our current test matrix, and not part of what we recommend to users. Also, we try to be JVM-vendor-agnostic so that users on Oracle or other OpenJDK-based distributions should all work. I don't know enough about what is possible or allowed with Homebrew to have a good handle on the space of options. Could we remove the Java dependency entirely and have the tools check and tell you what to do if it's not present? With respect to our own tap, there are other possible benefits there but it would be actively harmful to leave an old formula here without updates and only update in a secondary tap. I am the only person building the tar files and publishing updates to the formula here. If I switch to doing that on a Clojure-specific tap, could we blacklist Clojure here with a pointer to the Clojure tap? Otherwise, this will become the default place to look with an increasingly out of date thing to find. |
While you might be the first person to currently suggest updates that doesn't necessarily mean that the formula will be outdated when you no longer suggest them. If it's consistently outdated we can always consider a deletion though. |
I’m part of the Clojure team, and the one doing 99% of the dev and release work on these tools. I’m going to start pushing updates only to a Clojure tap, so it will be consistently old. For Clojure users, the best and most up to date source for these updates will be the Clojure tap. It seems like it can only be worse for users to get an old version from core without knowing it’s old. I don’t see how it benefits anyone to not point to the Clojure tap from the start? |
@puredanger, to get back to the original issue that the “dependency is wrong”, would depending on the |
I think we are talking past each other. What exactly is the problem? If the issue is that users are getting a copy of The fact that If the issue is that |
@reitermarkus Yes, if brew must fetch openjdk, let it fetch the LTS release (currently 11, soon 14, basically every 3rd release). Although, as mentioned before, some projects have a hard dependency on JDK 8 as well, since Java 9 removed a few capabilities. |
The point of a package manager is that after installing a package, it works, so yes, we must.
That is the reason we still allow overriding |
In my eyes, the problem with that suggestion is, how does one do that universally, on one's machine? How do I ensure that any invocation of
(14 isn't an LTS, btw. It's every 3 years not 3rd release, so the next LTS is Java 17, in Sept 2021.)
In f517591 @SMillerDev also mentioned "This allows us to test tools with updates". I don't understand exactly how much this change is motivated by testing (there are a few mentions of CI troubles in the thread). But would it be acceptable if, as a default, the dependency resulted in the latest being used, but users had the option to satisfy the constraint of "need java" by their own selection of JDK variant/version? Unfortunately, the break-neck speed of JDK releases (every 6 months, with only a 1 month overlap) is quite the imposition on the ecosystem, and honouring the 3 year LTS release cadence is more feasible and seems to have become fairly common. Much like the Clojure community, the Scala community (whom I'm a part of) tries to spend time on the non-LTS releases, but we're more certain of the software on the LTS releases. So, in some way, this isn't about "use the latest version" it's more like "use the latest pre-release". Lastly, much ❤️ to the maintainers of the Homebrew ecosystem. I'm always grateful for all the work that goes in. |
Set it in bashrc or equivalent and configure your IDE to also honor it, that covers all cases AFAIK.
That's the current situation that you can set with |
People will not start looking for the clojure tap by default and will install clojure in weird unexpected ways if it doesn't just work with a default install. Your solution only works if people go through your documents, find your tap and then try installing it. |
Wait, how does that cover all cases? How does it even cover |
Sudo has some options to retain environment variables and you can always set the variable for the target user as well. All of this is something that Linux users have used for years though. It's a proven concept and Homebrew is just joining everyone else here. |
I'm not saying you can't seek and find workarounds at every usage site to try and make it use the right version of Java. But I hope you can see how "Oh, why don't you just set JAVA_HOME instead" isn't so straightforward in truth.
In a sense, so is macOS's |
@dwijnand I'm afraid it's not our job to explain to you how to configure your software and environment so they work how you want.
Additionally: https://formulae.brew.sh and similar tooling does not exist for your tap. People expect
This is still happening. No-one can explain to me why this dependency is "wrong" and provide a test-case demonstrating this. Therefore I'm forced to draw the conclusion that there isn't one and this is an upstream preference and what they "support" rather than a hard requirement. Please prove me wrong. Unless the conversation turns fairly rapidly in this direction this thread is going to get locked; it doesn't seem to be a productive use of anyone's time at this point. |
Hi, for a little context I've given non-trivial economical support to Clojure and Homebrew alike. I see how both parts here are defending a reasonable technical approach, pursuing well-intentioned goals. Also I see some flaws in how this issue was opened, and also in how it was immediately closed. Both facts can skew the whole discussion. So it might be desirable to start a new issue from scratch, trying to stick to the facts and keep it technical. As much as I admire Alex Miller (known within Clojure folks for his expertise in all JVM matters), Likewise, the
This also seems necessary. |
I would rather we continue discussion on the closed issue. This is how Homebrew uses our issue tracker: things that are not immediately/obviously actionable are closed and may be reopened when they converge on a solution (or a new issue opened). Otherwise: I agree completely, thanks @vemv. |
Catching up (thanks @MikeMcQuaid @SMillerDev @reitermarkus). There's really two things going on here and I want to explicitly separate them if I can. 1 - I filed the original issue because the change in dependency was incorrect from the point of view of Clojure. Clojure depends on any Java, >= 1.8 so changing it to be "latest version of adoptopenjdk" was not that. However, I understand better now that the policy in homebrew is "use latest deps built from source", so the dependency change is entirely in keeping with homebrew's policy and is not wrong in that regard. I have not disagreed with that explanation or decision to close this issue on those points. (And indeed, post install, setting JAVA_HOME puts the user in full control of which Java is actually used, so that all works as expected.) I do think it would be helpful to use 2 - The second thing here is that from the Clojure team's point of view someone externally changed our dependency without any input from us. I understand that's how things work here, but it's disconcerting. As the creators of a thing, we want to have some level of control over how these decisions are made and presented to users. Homebrew is providing an incredibly valuable service to us as the favored package manager on our most popular platform, and I have a ton of love and respect for y'all doing that. What I'm trying to figure out is the best way that we can live in the homebrew ecosystem while also doing great by our users. It seems like external taps are one big way that could be done, and it might be useful for a variety of reasons - control over the formula, control over releases (without needing to gate on the homebrew team to approve prs), providing tagged versions (@ etc), and external brew commands. I've done a fair amount of googling and reading of brew docs and looking at what other communities are doing and certainly there seem to be many cases of organizations moving formulas both in and out of core for their own external taps but it's hard to determine the reasons in most of those cases. I would love to have more guidance on what you think about that, how to make that decision and how to work cooperatively so that our users have a clear path to getting the best possible version, with the minimum of confusion. (And I also understand if the answer is, "not our problem". I'm not asking you to solve it, just looking for best guidance.) Thanks. |
Thanks for the detailed response @puredanger ❤️.
Glad to hear it 👍
I would rather we left it as-is unless there is known breakage.
From our perspective: once something is in Homebrew/core unless it breaks or we're unable to run CI on it for some other reason (e.g. depends on some systemwide change we're unwilling or unable to make to our CI system) we will keep it there indefinitely. We have the technical ability to migrate formulae to taps but this is not something we're willing to do for Homebrew/core essentially for security reasons. The best way for upstream to ensure that the software is packaged the way they would like is to have the In this case, if there were issues with the latest Java, changing the dependency and changing the
As a more meta-point: this isn't something Homebrew does but something most systemwide package managers do. We're responsible not just for packaging your software but ensuring that all software package operates as sensibly and well-integrated as possible. This results in us making decisions for our users on e.g. dependencies to minimise the amount of dependencies they need to install and generally be in keeping with the ethos of our package manager. If it would be good to have explicit documentation "homebrew for upstreams" or similar then I can look at writing it in the nearish future. |
@MikeMcQuaid we really want someone to manage their Java installation independently from Clojure. Could we remove the Java dependency entirely? |
No, that would make the default install unusable.
They can and will by setting |
What @SMillerDev said. Clojure does depend on Java (hence the dependency as it cannot run without it) but there's nothing to stop users from ignoring the |
Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.
brew update
and can still reproduce the problem?brew doctor
, fixed all issues and can still reproduce the problem?brew gist-logs <formula>
(where<formula>
is the name of the formula that failed) and included the output link? https://gist.github.com/puredanger/bf1597cf60ed911fd70348b9953c18f9brew gist-logs
didn't work: ranbrew config
andbrew doctor
and included their output with your issue?What you were trying to do (and why)
Install Clojure and use my existing Java installation.
What happened (include command output)
brew install clojure
Command output
What you expected to happen
Clojure formula should be installed but I already have a valid Java set up and I did not want openjdk installed. The clojure formula was recently changed incorrectly from Java >= 1.8 to adoptopenjdk.
I am on the Clojure core team and wrote the clojure brew formula and installer.
Clojure does not require adoptopenjdk. Some users use it with the Oracle JDK or other vendor JDKs. The requirement from a language perspective is any valid Java, >= 1.8, so the previous dependency was correct. Many Clojure users prefer to have control over their JDK version and most users are still using Java 8 as the module system introduced in Java 9 may require changes before migration.
Without the opportunity to do that migration, auto-installing adoptopenjdk at the latest version can cause their application to throw warnings or fail (due to modules that have been broken out of the JDK and are no longer automatically provided). Here is an example issue of how this can manifest to users: clojure-emacs/orchard#20 (this particular issue was not caused by this brew change, but is exactly the experience users with a forced Java update may encounter).
This commit should be reverted.
Step-by-step reproduction instructions (by running
brew install
commands)brew install clojure
The text was updated successfully, but these errors were encountered: