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: create jenkins pipeline and enable build of nim compiler #1076

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

markoburcul
Copy link
Contributor

@markoburcul markoburcul commented Jan 17, 2025

Because of the recent bump of Nim compiler for codex to >2 version, using the system Nim provided by nixpkgs became unusable since the nim-codex couldn't build. Because of this I've adapted the derivation to be similar to the one of nimbus-eth2 where we build Nim compiler using nimbus-build-system.

The pipeline on Jenkins is currently set to build nim-codex through flake, but there is a possibility to run the nix tests in the pipeline with slight modifications of the ci agents(the error when running nix tests).

error: a 'x86_64-linux' with features {kvm, nixos-test} is required to build '/nix/store/9avanzkwb8f25c0az0f3f8jv2mkm4gfq-vm-test-run-nim-codex-test.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, nixos-test, uid-range}

P.S. Unfortunately it is not possible anymore(to my knowledge) to instantiate the nix shell without specifying additionally '.?submodules=1#'. Cause of this is that the callPackage from preBuild phase is being called and all three calls require submodules to be present.

@markoburcul markoburcul requested a review from jakubgs January 17, 2025 15:02
@markoburcul
Copy link
Contributor Author

I've inspected the dependencies of the built derivation both manually with nix derivation show and with nix-tree. There was no hidden Nim compiler or anything similar among the dependecies that would explain the previous failures we had when debugging the build.

When building the package we can see in the output first:

codex> Nim Compiler Version 1.9.1 [Linux: amd64]
codex> Compiled at 2023-01-02
codex> Copyright (c) 2006-2022 by Andreas Rumpf
codex> git hash: 7f6681b4c4ccc0dc43fd256280be4c3ad3c773e5

but afterwards we can see:

codex> Building: build/all
codex> [using Nim version v2.0.14]

which states clearly that we are using the 2.0.14 Nim compiler.

@jakubgs
Copy link

jakubgs commented Jan 20, 2025

The removal of nimble and nim-unwrapped has resolved the issue for me. This branch builds fine:

~/work/nim-codex create-jenkins-pipeline
 > nix build '.?submodules=1#default'

~/work/nim-codex create-jenkins-pipeline 9m 25s
 > ./result/bin/codex --version
Codex version:  0.1.0-6f76abbe
Codex revision: 0.1.0-6f76abbe
Nim Compiler Version 2.0.14 [Linux: amd64]

Copy link

@jakubgs jakubgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly correct. Nice work.

Jenkinsfile Show resolved Hide resolved
Jenkinsfile Outdated Show resolved Hide resolved
.gitignore Show resolved Hide resolved
@markoburcul markoburcul force-pushed the create-jenkins-pipeline branch 2 times, most recently from 01a7cd6 to 1973c85 Compare January 21, 2025 14:38
Referenced issue: #940

Signed-off-by: markoburcul <[email protected]>
Using nimbus build system since the codex now uses version of Nim >2.
Tested with nim versions(>2) in nixpkgs but none of them work thus the
removal of USE_SYSTEM_NIM and its logic.
Signed-off-by: markoburcul <[email protected]>
@markoburcul markoburcul force-pushed the create-jenkins-pipeline branch from 1973c85 to 90edcc7 Compare January 21, 2025 14:40
@markoburcul markoburcul merged commit d114e6e into master Jan 21, 2025
17 checks passed
@markoburcul markoburcul deleted the create-jenkins-pipeline branch January 21, 2025 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants