I have deployed multiple bundles to my Karaf container. The dependency graf may look that way
A-1.0
/ \
/ \
B-1.0 C-1.0
Both B and C bundles are looking for the newest version of bundle A.
After deployment to production I realized that some interface in bundle A has to changed. I would like that only bundle B knows about that change. Bundle C must remain as it is. Graph would be better then my english.
I would like to acheived something like:
A-1.1 A-1.0
| |
B-1.1 C-1.0
I am wondering is there something like external configuration file which could help or something better maybe.
Unless you are using Require-Bundle (which, in general you should not do) bundles don't depend on bundles. It's packages that depend on other packages. So for the remainder of my answer I am going to assume that your bundles B and C import some package from A.
The first question then is, what version range do they import?
If both of them import [1.0, 2) (which is pretty normal if they consume services from A) then you won't achieve the effect you are describing.
You can make C import a strict range, like [1.0, 1.1) and then your scenario will work.
I am really wondering why you would want to do what you describe though. If you are correctly applying semantic versioning (as suggested in the OSGi whitepaper) then an update from 1.0 to 1.1 of bundle A means it should be backward compatible. Therefore B and C can use A version 1.1 without any problem. Can you elaborate a bit more about that?
Related
Julia has a package for binary decision diagrams called CUDD_jll available from JuliaHub. The package is able to install and compile on the Apple M1 architecture. It does appear to install and compile on macOS v13 running Julia v1.82. But the user interface from an older package CUDD does not appear to be compatible with CUDD_jll.
What is needed is a test or examples revealing user commands for initializing cudd, defining logical variables, and the basic operations of AND, OR, NOT.
Does anyone have such information they will share?
_jll packages are generally not meant to be used directly, they're backend dependencies that will be automatically installed when you add a package that uses them.
In this case, CUDD.jl is the package you want to install and work with. That will automatically install CUDD_jll as a dependency and use it. Actually, the current CUDD.jl doesn't yet use CUDD_jll as a backend. It instead does its own download of the CUDD library, from a source that doesn't provide M1-compatible binaries. CUDD_jll is a recent effort to change that. It does provide binaries for the M1 architecture, but is yet to be merged in as a backend.
In the meantime, you can try ] add CUDD#update-to-yggdrasil to directly add the branch that uses CUDA_jll as the backend, and see if that works for you. (Once the PR gets merged, you can remove this branch-specific dependency and ] add CUDD like before.)
The Apple M1 system is not compatible with CUDD. My mistake, sorry.
I am new to Go and trying to create my first program. Following the various getting started & tutorials I create a new module, which for my purpose needs to have a dependency on this module:
github.com/timescale/promscale#0.6.2
My problem is that the module has dependencies that have not "properly adopted" the semantic versioning approach.
go list -e -m all
...
k8s.io/client-go v12.0.0+incompatible
...
reports 37 such modules... so contacting the module author to have them adopt SIV, as I have seen suggested, will not be an option.
Am I missing something, or should I simply completely give up on using modules for this new project?
Are Go modules really usable today given third party "incompatible" modules?
Yes.
Am I missing something
Maybe: This "+incompabtible" is not a sign of failure.
or should I simply completely give up on using modules for this new project?
No, of course not.
Thanks for the answers and comments, it seems that:
New project should use modules, +incompatible dependencies will come up but that is fine
This FAQ entry has it right, just read the first 2 lines and keep "Additional Details" for a rainy day
go list -m all won't behave as described in all the tutorials if +incompatible dependencies exist, it will choke on the first incompatible module instead.
go list -m -e all seems to work as expected.
If you are using Goland, using GOFLAGS=-e seems to make dependency resolution work despite +incompatible modules. This may well have side effects that I am not aware of.
I am having a problem while trying to use two wonderful packages iron-io/laraworker and laracollective/iron-queue at same project.
The prior package requires version (max) 1.5.3 of iron-io/iron_mq whereas the later one (v5.2) requires that the minimum version of iron-io/iron_mq has to be 2.0.0
So this is an non-compatible situation.
Any help on this will be appreciated.
P.S.: I don't want to write my own worker libraries - I would prefer it as a vendor package - but if nothing else is possible I can work with https://github.com/iron-io/iron_worker_php.
There is no real solution for you: Don't use one of the two packages, and it will work.
Also, you can edit any of these packages and send a pull request to update the dependency on iron-io/iron_mq to match the other package, wait for it to be accepted, merged and published.
That's all you can do if you want to avoid maintaining your own code.
I have few bundles with activator in my environment. In just one of the bundle start() method is not getting called. Basically it is not getting activated. The only change this bundle is having is, it is using "DynamicImport-Package: ".
Removing this tag solves the problem with start() not getting called but this is not possible as all the packages are not known upfront in my scenario.
Can somebody help me, as I am quite stuck with this.
I can not figure out whats the problem and how they two are related.
They are not related. Removing DynamicImport-Package will have no effect on whether your bundle starts, so something else must be going on. Do you actually call the Bundle.start() method on the bundle anywhere?
Incidentally, using DynamicImport-Package is a very very bad idea. There is almost certainly a much better way to solve whatever problem you think is solved by using DI-P.
When using DynamicImport-Package especially with * you cannot control where a package is drawn from. So you will have big problems if two bundles export the same package.
For example I had a problem with pax exam that uses this * import for test bundles and there where two versions of the package javax.inject. As their bundle calling the test saw a different version of the package the service imports did not work.
So in your example it could be possible that you have two versions of the package org.osgi.framework where the interface BundleActivator is located.
Do you install the org.osgi.core api bundle? If yes then remove it. Only the framework should provide these packages. It could cause the effect that the framework can not use your activator class.
Preface: This is not much about how to structure code within files. I have that down. This is more of the topic of organization of your source tree. Hopefully someone will just say, "Here's a great link on the topic." However, firsthand opinions on the subject are welcome too.
So I've done a bit of digging on this subject and find tons of material on simple structure. I guess the assumption is that, by the time you need to deal with the problems of the size of your codebase, you'll already know the answer. However, even the IDEs seem to be waging a holy war on how these projects should be structured (which is NOT what I wanted to start in this thread).
Java enforced the package structure in the language. Kudos for that. Eclipse then lets you use projects to have (potentially) independent -- we'll call them 'buckets' in this example -- buckets of related code. Intellij has distinct but similar concepts with 'modules' within a singleton instance of a 'project'. If you want another project, you're essentially starting from scratch.
However, RubyMine offers no such modules in ruby apps, and by default just wants to slam everything into the root directory. It allows Directories, so one could essentially just pick some arbitrary tree structure and run with it. This implies to me their intent was that all classes have access to all other classes within your project. This might have some resolution through the use of Ruby 'modules', or might just be an honor-system pattern of "don't reference that stuff."
So, to put it succinctly, say I were building a 'foo' and a 'bar' concept, and both depend on a 'util' class. maybe I'll deploy them as gems, maybe I won't. I could:
Slam them all into one RubyMine project and just ignore the fact that 'foo' and 'bar' have no reason to be aware of each other.
Put each in its own RubyMine project. This seems like a real pain if there is any concurrent development. First of all, 'util' would have to be packaged separately and then included as an external resource in the other projects.
Neither seems particularly appealing. Thougts?
I'd develop all three independently, then make util a gem. In the Gemfile for each of foo and bar, you can give a path to the gem so that you can develop them all concurrently without the pain of messing with version numbers and so forth (for production, you would then point it to the real gem on Rubygems or at some git repository).
For project structures, check out the Ruby Packaging Standard and Gem Patterns.