Skip to content
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

CI: Build dependencies in-CI #108

Open
okuoku opened this issue Sep 19, 2022 · 4 comments
Open

CI: Build dependencies in-CI #108

okuoku opened this issue Sep 19, 2022 · 4 comments
Assignees
Labels

Comments

@okuoku
Copy link
Collaborator

okuoku commented Sep 19, 2022

From: #107

Currently, most of our CI is handling dependencies(GMP and Oniguruma in particular) as following:

Approach B) ie. 2-step integration was chosen because:

  • Time: Building dependencies would take 30min
  • Reproducibility: Building dependency for each time would not account any reproducibility
  • Reliability: Built libraries needs to be tested each time

Theoretically we could merge B) process into CI(ie. 1-step integration), it would have huge impact to dev workflow and needs some mitigation.

@okuoku okuoku self-assigned this Sep 19, 2022
@okuoku
Copy link
Collaborator Author

okuoku commented Sep 19, 2022

... so, at this moment, I think dropping GMP and Oniguruma dependency entirely is more viable solution; easier to implement(than implement caching & testing inside CI), future-looking(for portability esp. wasm) and expected to be more stable.

Aside that, taking 30mins more is obviously no-go for me as Windows port maintainer; it affects how many pushes I could do in one night..

Caching built libraries into GHA would be looking promising but my feeling is mixed. Long story short, it kills build reproducibility because we need to establish good caching strategy(cache-key generation etc) and it's relatively harder than 2-step approach(EDIT: because in 2-step approach, we can use Git TAG to refer actual library binary).

@higepon
Copy link
Owner

higepon commented Sep 19, 2022

I agree that less dependencies are valuable. I think Oniguruma may be easier than GMP.
I think our goal is the same, A) have CI as solid foundation and B) Make CI easier to maintenance (less complicated).

  • Caching is not very ideal.
    • (Less concerning) reproducibility because cache expires.
    • This makes the CI complicated. Myself 2 years later may not understand how it works.
  • 2 steps is not very ideal
    • This makes the CI complicated.
    • This introduce external dependency hell over mono repo.

So I think my goal is avoid the 2 above if possible in long run.
I'm totally fine long running CI because we don't push that much and we can test them in local. Also after the CI errors fix is totally acceptable.

@okuoku
Copy link
Collaborator Author

okuoku commented Sep 19, 2022

This introduce external dependency hell over mono repo.

2step-build keeps same level of translucency with other approaches; we can reach which version of the GMP or Oniguruma used from build log.

  1. In tagged revision, we can know which revision of the vcpkg had been used: https://github.com/okuoku/nmosh-build-prerequisites/tree/v0.1.1
  2. We know https://github.com/microsoft/vcpkg/tree/a1737683a6f8ec5d8673890581c2a8c55838d411 was used from the tag, so we can fetch package versions from https://github.com/microsoft/vcpkg/blob/a1737683a6f8ec5d8673890581c2a8c55838d411/ports/oniguruma/portfile.cmake or https://github.com/microsoft/vcpkg/blob/a1737683a6f8ec5d8673890581c2a8c55838d411/ports/gmp/portfile.cmake

Actually, it does what vcpkg recommends.

but generally we recommend using vcpkg as a submodule for CMake projects,

Instead of adding vcpkg as submodule of mosh repository, current CI adds it to nmosh-build-prerequisites repository and refer it with a tag against it.

We can flawlessly move nmosh-build-prerequisites workflow as separate YAML of this repository with manual-triggered workflow. But unfortunately, GitHub does not provide any viable feature to release build prerequisites separately.

I'm totally fine long running CI because we don't push that much and we can test them in local.

Building same version of external project for multiple times are considered harmful because we have to pay attention to more factors. In GitHub, GHA runner images are continuously updated and old images will be removed. Building external project for each time means we have infinite versions of binaries of external projects.

In 2-step integration, when something wrong was happened in v0.1.1 to v0.1.2 change for example, we'd just have to pay attention to just two set of binaries.

Few builds, Few binaries, Few headaches.

@higepon
Copy link
Owner

higepon commented Sep 19, 2022

Thanks I just took a look at https://github.com/okuoku/nmosh-build-prerequisites/blob/v0.1.1/build-windesktop.cmake.
It looks okay to have different package and matching it with tag.

We can flawlessly move nmosh-build-prerequisites workflow as separate YAML of this repository with manual-triggered workflow. But unfortunately, GitHub does not provide any viable feature to release build prerequisites separately.

Can we then move this to here?
I personally think it's totally fine to have build prerequsites in release seperately.

@higepon higepon added the P1 label Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants