Replies: 13 comments 8 replies
-
Thanks for the extended explanation. We may have 3-4 such dependencies which may however be updated only 0.2-1x/year: INDI, qxlsx, qtcustomplot (but no more upgrade possible under terms of GPL2). The one library which practically saw no update since the 1990s, TESS, shows most of the tiny nasty glitches nobody was so far willing/able to fix. (Or something is wrong with some calls from our side.) |
Beta Was this translation helpful? Give feedback.
-
Another simple example where this mechanism can be used is when importing user scripts. Let's take as an example this script: http://www.alienbasecamp.com/Stellarium/sun.htm (after #1088) I manage a separate git repository where my own Stellarium scripts live. As an example, here I will add the vendor
Whenever one wants to import an update (this is called a "vendor drop")
This all feels complicated at first: I could simply have unzipped the file and voila, it will run "out of the box". The vendor approach is a matter of healthy code management, training and habit, and it will pay off the day one wants to modify something without having to worry how to deal with external updates. (By the way, this is fundamentally the same mechanism where you can create a custom Stellarium version - the Stellarium code is is fact a vendor for you). (Notice that the vendor includes a file that should be renamed from A vendor source code can also be managed in a separate repository. The pattern is the same: store the vendor code in a separate branch, then merge to the Observe that user scripts published under https://stellarium.org/scripts.html could easily be hosted at https://github.com/Stellarium/stellarium-data or even https://github.com/Stellarium/stellarium.github.io. Then, anyonme wishing to use those scripts could clone that repo and enjoy them. But that's yet another discussion. |
Beta Was this translation helpful? Give feedback.
-
(And this probably belongs in a new discussion category "Development") |
Beta Was this translation helpful? Give feedback.
-
I'll prepare an update so that this recommendation can be moved to the Stellarium sourcecode (eg a section in CONTRIBUTING.md or maybe a separate In general, it is dangerous to keep this kind of information separated from source code, as this tends to become stale and will seldom be read by contributors. |
Beta Was this translation helpful? Give feedback.
-
Thanks for tagging me. There are multiple ways to manage dependencies, and I agree that copypasting (what's done now) has problems. Vendor branching is not a perfect solution either: it requires strong discipline to never touch the source located there in master branch, even accidentally, or when accepting/reviewing someone's PR, but only update the vendor branch from time to time, and it doesn't help downstream distro maintainers. Note that various distros have policies to not use the bundled libraries: Fedora, Gentoo, Debian. Other common ways to handle C++ deps are Conan or Vcpkg, but they require some more overhead from the end user who wants to compile the software... and not all libs are available in vcpkg anyway. In #1295 I had implemented the split between Stellarium code and its deps via CPM, which transparently works inside CMake, which handles these concerns:
The main concern there was that CPM requires CMake 3.14+. At this point it's probably only a problem on ancient systems such as Ubuntu Bionic. But in those cases, user can download a newer cmake manually, and use it instead of cmake from the apt repo. WDYT about bumping the required cmake version from the current 2.8.12? I can rebase that PR for the current master. |
Beta Was this translation helpful? Give feedback.
-
GitHub doesn't seem to link from PR to discussion, so here is the related PR: #1906 |
Beta Was this translation helpful? Give feedback.
-
The vendor branch approach also guarantees that
Because we all know that vendor code can disappear overnight.
|
Beta Was this translation helpful? Give feedback.
-
(related to vendor_branching) |
Beta Was this translation helpful? Give feedback.
-
+1 for vendor branches. |
Beta Was this translation helpful? Give feedback.
-
Also, Stellarium is not complex enough to require sofisticated dependency managers. The vendor branch approach is simple to apply, considering the level of software engineering skills of the average Stellarium developer/contributor. |
Beta Was this translation helpful? Give feedback.
-
CISA recommendation: axd1967@5f33484 |
Beta Was this translation helpful? Give feedback.
-
It might not be the best practice to let software depend on uncertain external sources. One reason is that remote archives come and go. (Re-read CISA #1856 (comment).) For example... take a look at dfcce4d. Notice that the committer (even if it is a reliable and strong developer) is also the author of that zip file. Just imagine https://github.com/10110111/CalcMySky/archive/refs/heads/master.zip (see https://github.com/10110111/CalcMySky) contains a bug or a virus. For a short while (until the tag reference was used), there was a potential danger to inject nasty stuff in any system compiling and then running version dfcce4d of Stellarium. Likewise...
Now, some packages can be trusted; others might be too large to take in. On that note, Stellarium is reaching 1G in source code (of which ~50% are language files! but might require 10G when managing branches); maybe the language component could be split off into a separate entity.... |
Beta Was this translation helpful? Give feedback.
-
The art of hyperbole... Just be careful with that "you" word, as it terminates all discussions... @xalioth Pity we cannot version microcode of all known processors, then we would be totally independent. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
A recurring issue that developers face is how to use external textual information (data, source code, ...). The problem is that long after after importing external information, the external information changes: think of bug fixes and updates to data.
Examples:
The solution that is usually chosen is the following:
The problem with this approach surfaces when the external information is modified too. This is a subtle problem, because until then, everything works fine. Usually no thought is given to long term maintenance ("this works fine, we don't need updates!", but experience learns that errors appear everywhere, that's bread and butter for the software developer.
So when the external information changes, two options present themselve:
The first option will lead to a slow and guaranteed code rot.
The second option can be very difficult to maintain in the long term, and is very prone to bugs. It might sometimes be very difficult to understand what changed in the external information, and manually and flawlessly apply those changes locally.
Also, sometimes there is no record of where the information came from, so there is no possibility to benefit from changes.
In fact, this is an example of the saying "copy-paste is evil".
What is the solution?
The solution is a strategy called "vendor branching".
The idea is quite simple:
vendor/geonames
). Every dataset/tool lives on its own vendor branch.external/<vendor>/<toolname>
)README
explains where the external information can be found. A better suggestion is egVENDOR
, as it is possible that the vendor already includes aREADME
.vendor/geonames/2021-08-21
)master
)So the vendor branch becomes a kind of pristine mirror of the external information (except for a added
VENDOR
text information file).For prolific vendors, it might be necessary to create subfolders and separate branches per product.
Now it becomes easy to update external information. Whenever the external information changes:
master
(or via an intermediate feature/bugfix branch, often in order to update local stuff)The last step might trigger conflicts if the vendor information was modified locally (but never in the vendor branch!). This is usually done in order to provide for local needs or solve small bugs. Note that conflicts are also likely to arise when a locally solved bug is also solved by the vendor, so bug management of vendor information is a critical process that should be coordinated with the vendor whenever possible.
The exception to the rule is the
VENDOR
text file that might need occasional updates (eg when the URL of the vendor iformation changes).Sometimes, the external information is managed in a Git repository. In such case, sometimes it might be possible to manage the external information via git submodules or git subtrees. These approaches are not discussed here because they can lead to other problems.
Some information here:
Beta Was this translation helpful? Give feedback.
All reactions