-
Notifications
You must be signed in to change notification settings - Fork 19
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
Build improvements #680
Build improvements #680
Conversation
b5a9747
to
0ab0aa8
Compare
bd480a7
to
d7e62bb
Compare
We should not remove the ability to specify the compiler version, we should in fact build against all the versions that we support - currently it's We should bump the project to the latest supported version (1.6.18), by bumping In short, the CI should always build against all the supported compilers and we usually do maintain compatibility with at least 2-3 past versions. |
The CI currently does not build against all supported versions. This would be a larger change, and would require us to figure how to make this scale without a build taking hours (which I believe was the reason why we never made the matrix larger than one single version in the original CI script). That said, this PR does allow you to change the version by specifying the |
@@ -9,9 +9,6 @@ inputs: | |||
cpu: | |||
description: "CPU to build for" | |||
default: "amd64" | |||
nim_version: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should not remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I argue in my doc that this is not really achieving much ATM. While I agree that building against a compiler matrix is useful, what this currently does is pin the a CI to a single version, which is the wrong one. :-)
3825e83
to
f69995f
Compare
|
||
- name: Build Nim and Codex dependencies | ||
shell: ${{ inputs.shell }} {0} | ||
run: | | ||
make -j${ncpu} CI_CACHE=NimBinaries ARCH_OVERRIDE=${PLATFORM} QUICK_AND_DIRTY_COMPILER=1 update | ||
./env.sh make -j${ncpu} CI_CACHE=NimBinaries ARCH_OVERRIDE=${PLATFORM} QUICK_AND_DIRTY_COMPILER=1 update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the Makefile already imports the env
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's a different env, though.
One thing keep in ming about possible limitation with GitHub Actions - Usage limits. ![]() Just because running a lot of concurrent jobs, we may block other jobs in same repository or across entire org. And some results from the test we performed detailsjobs:
build:
strategy:
matrix:
nim_version: [v1.6.14, v1.6.16, v1.6.18]
os: [linux, macos, windows]
arch: [amd64]
tests: [unittest, contract, integration, all]
include:
- os: linux
builder: ubuntu-latest
shell: bash --noprofile --norc -e -o pipefail
- os: macos
builder: macos-latest
shell: bash --noprofile --norc -e -o pipefail
- os: windows
builder: windows-latest
shell: msys2
exclude:
- os: linux
tests: unittest
- os: linux
tests: contract
- os: linux
tests: integration
- os: macos
tests: unittest
- os: macos
tests: contract
- os: macos
tests: integration
- os: windows
tests: all ![]() ![]() |
ContextFor now we have 3 separate build flows
As we already discussed we have at lest 2 ways to pass a custom Nim version for builds
It should also be noted that a default version currently is defined as a submodule from in the nimbus-build-system repository. Existing one - use a
|
Projects seem to organize things differently, and tolerate different levels of inconsistencies. Nimbus uses a compiler matrix in CI where they subscribe to release streams (e.g. version-1-6), and not specific versions. They then have a set of Docker images which awkwardly appear to be used to build binary tarballs, and then some hollow images to actually distribute the binaries, in what looks like an emulation of a multistage build. These appear to scoop whatever version of the Nim compiler is defined in the nimbus-build-system by default, and does not allow for configuration. Waku has a much simpler system with no compiler matrix. They just scoop the defaults for nimbus-build-system everywhere, and as far as I can tell cannot experiment with custom compiler versions in CI or Docker images at all. So answering your first question, @veaceslavdoina, there doesn't seem to be a consistent way of overriding Nim versions or keeping those things in sync. This is a bit less of a problem for Nimbus as nimbus-build-system is... well, their build system. But still, creating a branch to test a new compiler version does not appear to be feasible unless you create a branch of nimbus-build-system itself, set it to a different default, and then use that branch as a submodule into your own branch (quite cumbersome). As for your second question: I suppose we can do away with invoking |
I have a better idea on how to do this now, so will close this. |
Edit: I've done some more extensive reasoning on this here.
Currently, our CI file which runs tests allow one to specify a compiler version. I argue this is not desirable, as neither the Dockerfile nor local builds will use that version. Indeed, the version that gets picked up in those other cases is whatever version
nimbus-build-system
uses as its default, which is another thing I'd argue is undesirable. 🙂What would be desirable instead would be if: i) the versions in CI, Dockerfile, and local builds (without overrides) would always agree; and ii) we could decouple those from
nimbus-build-system
defaults, as those may or may not match what we want at any given time.This PR does two changes that try to remedy this:
This will ensure that the compiler version is consistent across tests and the docker image, and also simplifies the CI as a side effect. In addition, a developer can always specify a different version by setting a different value for
NIM_COMMIT
locally.Finally, this PR wipes clean the misleading information contained in the
.nimble
file, which lists neither the correct dependencies, nor their correct version. It also purges all unused/unmaintained lockfiles, including atlas', as those do not reflect the correct versions either (see this spreadsheet for the discrepancies wrt the nimble lockfile, similar issues plague the atlas lockfile).