Replies: 10 comments 10 replies
-
To start the discussion, here something, maybe we can iterate on it
|
Beta Was this translation helpful? Give feedback.
-
Theoretically you can always download a canary build from the latest github actions run: https://github.com/cross-language-cpp/djinni-generator/actions/runs/760704611 Each "CI" workflow creates an artifact with the djinni binary. But it may be hard to get the artifact by using the api, afaik there is no endpoint for the "latest" action/artifact. |
Beta Was this translation helpful? Give feedback.
-
I think we should move that into the discussion part, since it does not seem there will be any action in reasonable time. I think what we actually would need might be something like that not sure if gh action provides something similar |
Beta Was this translation helpful? Give feedback.
-
I'm really struggling to find a solution that solves our problem, apart from moving back to the concept of a mono-repo, at least for the generator and the support-lib... 😞 The core problem I cannot solve is that if I my feature requires changes in both components, both repositories need to reference an arbitrary version of it's counterpart, even from a fork. With this version they would then be able to execute all tests given the exact counterpart that they need. Even if github would support sth comparable to a multi-project pipeline, I cannot imagine how this could work well together with forks... One could create an uber-repo that references both components and executes tests, but at this point i think it would be easier to put both components into one repo again. :( To understand how I came to this conclusion, you may want to read the following proposal for solving the problem. I wrote down my idea while thinking it through, with the result that I understood why it doesn't work: Proposal: Add the support-lib as submodule to the generator and provide a makefile or sth similar that executes both the tests from the generator and the support-lib tests with the current generator binary in Use cases that this solves:
Sry for this wall of text. Hope it helps to understand my problem. Maybe there is sth that I am missing? 🙏 |
Beta Was this translation helpful? Give feedback.
-
Shorter, more concrete version: All generator versions that a support lib would need have already been built and exist as artifact. Use case:
Development happens in parallel. Both, generator_next and generator_stable are available as aritfacts , example for some feature build The question is
I do not see subrepos add any value or helping anything https://github.com/marketplace/actions/download-workflow-artifact |
Beta Was this translation helpful? Give feedback.
-
Today I had an idea for a very radical solution of the problem. Disclaimer: Pls don't take this idea too serious in it's current state. I had fun implementing a proof of concept to check if it could work. While I am quite happy about the outcome, this doesn't mean that I'm fully convinced yet myself. It may be a dumb idea but I'd like to throw it on the table to fuel this discussion! Ok, let's go. 👏 The idea: If there would be only one component (the generator) instead of two, there would be no interlocking problem between interdependent components. So how do we get rid of the concept of a support-lib component? My proposal is to not distribute the support-lib as CMake target, conan dependency or sth. else, but as sources within the generator. I realized that the majority of the logic in the support-lib CMakeLists.txt and in the conan configuration is all about which sources should be distributed for what target-language and where they should be installed. I've implemented a proof-of-concept of this idea here: https://github.com/jothepro/djinni-generator/tree/merge_support_lib_into_generator Without going too much into the details, this is how it works:
Pros:
Cons:
Phew that was a lot of text. Things happen when I'm in flow 🙈 . |
Beta Was this translation helpful? Give feedback.
-
As contributor of both projects (cross and snapchat) i want leave my opinion too. I agree with join the projects into a single repository (generator + support lib). I see this in other projects, like Snapchat (https://github.com/Snapchat/djinni) and it works very well. The release of both things can be in sync if they are together and it is easy to know what work in the current version. I don't know how many users use the conan version of support files. I use djinni and c++ on mobile, desktop and wasm in my job and never use that repository(mainly because it's the only repository that doesn't work well with darwin-toolchain, but this is another problem). I always have a copy of support-lib in all projects to don't depend of external things. To me this can be removed from conan center index, because don't make any difference (in my opinion). In my opinion, separate the projects make our life hard do keep the generator working and well testes with support-lib. For example: In a real example, im trying to add WASM support, but i can't use the support-lib to test it, i can't have examples locally to test it and other things because the djinni parts don't talk with others (generator + support-lib). Sometimes we want to improve or organize something and we end up giving up simplicity and efficiency. I totally agree to keep things together. And if really need keep it separated, keep a copy separated when is stable in main repository only to work with conan cci. The repository with a copy can be a more detailed examples etc to test it and the main repository with all together make things only to check if it is working, without a lot of examples. |
Beta Was this translation helpful? Give feedback.
-
Since my opinion on the the topic is not very clear, what it possible since I never stated it that clear, please let me state it explicit. I do not think a monorepo as the original Dropbox repo was, or the current snapchat repo is, is a viable solution for our use case. But I think the idea of @jothepro he described up here is a good candidate for a solution to the problem. And not just to fix the CI problem, but a general one, see my notes to the python implementation On a first glance I had some concerns, since it introduces quite some change, and I still do not have a fully opinion on all the changes it might introduce, but maybe it's time for a djinni-NG (next generation?) I did not expect a new language landing that triggers the use case that the support lib CI needs the latest staging build from the generator so fast, since so far this happened super rarely. And now I wonder how to distribute the limited available developer time we have.
or
Fixing the CI has the advantage that we can estimate how much it will take to implement, and it will have no side effects to the project in general , the existing deliverables stay unchanged. Also existing developer workflows, but it does not solve some general problems. Johannes solution has the advantages that I think it is a better solution, but since it's a huge change. I am unsure about unexpected side effects we would have to fix, and changing the deliverables. Even if I think this is an improvement. Also the mentioned change that we do not longer transport dependencies via cmake .. but in worst case, that would be a fixed via documentation. How to continue ? Djinni NG or to preserve the current structure and deliverables ? Opinions are welcome! |
Beta Was this translation helpful? Give feedback.
-
2.5 years after the topic has been open, long-time usage has shown: After years we see that this use-case is the absolute exception. This will also be helpful when we add cmake helpers that use cmake's FetchContent to either include one, or both components. |
Beta Was this translation helpful? Give feedback.
-
For the support-lib: Get the generator I want in CI (release, pre-release, or developer snapshot)In a Pull-Request: Some changes might require a specific or new generator to be used in CI. In this case, as a user, I want to be able to get the generator I want in CI. The pull request might also contain changes to the GitHub workflow file. Pre-assumption: The repos stay separate since :
Possible solution: Download a generator as release, pre-release, or from a pull requestTechnically, there is no problem. Example how it could be done. So, it is possible to download the generator as a release, pre-release, or from a pull request since the generator is available as a build artifact. However, there is a limitation from GitHub: Possible solutions:
Work in a branch of the generator's repositoryIt needs to be evaluated, but in theory, there should be no problem. In case a PR generator is required, we open a branch in the djinni-support-lib repository. We can then either:
Use
|
Beta Was this translation helpful? Give feedback.
-
In #43 a big new feature is introduced: Python support for djinni.
Because djinni has been split into components, we do now face a problem while introducing the big new feature that includes big changes in both generator & support-lib:
The changes in the generator need to be released, otherwise it cannot be pulled as dependency in the support-lib to execute the unit tests. Once the generator is released, the unit-tests in the support-lib repository can test if the generated code compiles & works.
If theses test fails because of an error in the generator implementation, a hotfix needs to be made in the generator and the fix has to be released again.
From my point of view this should not be a problem in general, as all things should be tested locally before being pushed to the generator/support-lib repository anyways.The tests in github action should just be there to verify that everything is fine.
But in reality things go wrong, and situations like this may get nasty, if multiple patches need to be made in the generator for some unexpected reason. As a maintainer I think we should discuss options on how to reduce this hard dependency when introducing big features that require changes in both components.
Beta Was this translation helpful? Give feedback.
All reactions