Why do I have duplicate packages installed by Homebrew - homebrew

A recent update (of cloog, I think) resulted in what look like duplicate entries listed by brew list:
...
gmp
gmp#4
...
isl
isl#0.12
...
What are these and why are they present? Can I get rid of them? Are they likely to cause any issues?

The # prefixed formula is old version formula, or "versioned formula".
For example, llvm on homebrew is 3.9.1, but llvm#3.7 is 3.7.1.
The package like this exists for one who wants to use the old version, or as a dependency for the another
versioned formula.
AFAIK versioned formula won't cause a problem.
You can get rid of one unless it is a dependency of something.

Related

How do I remove openCV

I am trying to remove opencv fully from my system. I was trying to learn ROS, while in tutorials I faced an issue. After creating empty workspace I invoke
catkin_make
It gives an common error, I searched and asked around in answers.ros
here is the link of the question
I think I found out the problem was opencv libraries which I had build before installing ROS-Noetic, creating the error, I searched around how to remove opencv, but non of the answers totally remove opencv without removing my opencv names files.
Is there a common solution on how to remove opencv?
Ubuntu 20.04
ROS Noetic
Best way if you installed opencv from source and still have the build directory, simply go there and call make uninstall. Another solution is to delete all opencv related files as you already know and suggested in many other similar questions like this. You could also try to use synaptic package manager if you installed using a package.
I suggest for the future to install development libraries a custom folder, so it will be just a matter of deleting that folder if something goes wrong. In this way you can also have different opencv versions in your system, this is how I do.

I have a Swift Package and I want to know how to get the current version of this package

Similar to how you get your apps version kCFBundleVersionKey how does one get the version of the package you are working in?
I don't think it's possible at the moment to get the value easily.
You can either read the Package.resolved file or you can set up a public constant where you would define the version of your library.
public let version = "0.0.1"
import MyLibrary
print(MyLibrary.version)
There isn't a standard way how to do this, every package could have a different constant (or not have it at all)
You can check package version rules in project package dependencies tab. Check screenshot below. Propably it would be sufficient for most use cases.
Edit: The context has changed, the question was to get the version of MyPackage I'm working on via code. There isn't any documented or recommended method as of now. Though this can be achieved by a hack through reading the Package.resolved file as mentioned by Malcolm.
I'm not deleting this answer for any future users who are looking for answer on how to get the exact latest version of a Package.
You can give the same major version number and give Update to latest package version option on Xcode. eg: If current version is 2.4.5 you just need to provide 2.0.0 and update. There is also an option to provide the exact version of swift package you need.

What does 'bottle :unneeded' do?

I read Method: Formula.bottle but it's not very clear to me. When writing a home-brew formula, what does the following do?
bottle :unneeded
When a formula you submitted is accepted in one of the official taps, a bot grabs it; builds a pre-compiled version of the formula, and uploads it in some public location. This pre-compiled package is called a bottle and is used to speed-up installation of compiled things.
bottle :unneeded is an indication to the bot that this formula doesn’t need a bottle; e.g. because there’s nothing to compile.
Note that bottle :unneeded was deprecated by homebrew-core in June 2021, and no longer has any meaning to the bottler.

CocoaPods ~> (Optimistic operator) downloading something else

I had two separate CocoaPods, they're named like this,
4.3.1-test
4.3.1-testBeta
Then I created a third one and named it,
4.3.1-testX
When users users write the podfile like this:
pod 'Podname', '~>4.3.1-test'
It ends up downloading '4.3.1-testX'
Why is this happening? Is it because I pushed '4.3.1-testX' after '4.3.1-test'?
How to solve this? Please help!
Just found the answer to my own question,
The optimistic operator (~>) does not care about the string in the version name (x.y.z-string).
Therefore, even if the strings are different, it will download the most recently pushed pod.

Unable to find a suitable version for polymer

I'm installing and configuring Polymer and i get to this:
Unable to find a suitable version for polymer, please choose one:
1) polymer#master which resolved to ced408df76 and is required by core-component-page#a431519835, highlightjs-element#a2c5fc08d0, marked-element#761922b4a2
2) polymer#0.2.4 which resolved to 0.2.4 and is required by core-ajax#0.2.4, core-bind#0.2.4, core-collapse#0.2.4, core-doc-viewer#0.2.4, core-elements#0.2.4, core-firebase#0.2.4, core-icon#0.2.4, core-icons#0.2.4, core-iconset#0.2.4, core-iconset-svg#0.2.4, core-input#0.2.4, core-layout#0.2.4, core-layout-grid#0.2.4, core-layout-trbl#0.2.4, core-list#0.2.4, core-localstorage#0.2.4, core-media-query#0.2.4, core-menu-button#0.2.4, core-meta#0.2.4, core-overlay#0.2.4, core-range#0.2.4, core-selection#0.2.4, core-selector#0.2.4, core-theme-aware#0.2.4, core-tooltip#0.2.4, core-transition#0.2.4
3) polymer#~0.2.4 which resolved to 0.2.4 and is required by project
Prefix the choice with ! to persist it to bower.json
I'm still learning about and i dont know which one i should choose and why this problem happend. Can anyone explain me this tree options?
Thanks..
The recommended way to install Polymer 0.2.4 is through Bower. We’ve
chosen Bower because it removes the hassle of dependency management
when developing or consuming elements.
from http://www.polymer-project.org/docs/start/getting-the-code.html
I'd go with
2) polymer#0.2.4 which resolved to 0.2.4 and is required by
...
This happened because when bower went to install a version of polymer it was presented with three options and didnt know which one to choose from. Many packages have a stable release and a development version, which you want is up to yourself. You can usually check up the packages on github or there websites to find which package might suit you best

Resources