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

gitlab:12.8.8 -> 12.8.9 #85623

Merged
5 commits merged into from Apr 27, 2020
Merged

gitlab:12.8.8 -> 12.8.9 #85623

5 commits merged into from Apr 27, 2020

Conversation

flokli
Copy link
Contributor

@flokli flokli commented Apr 20, 2020

Motivation for this change
  • gitaly: 12.8.8 -> 12.8.9
  • gitlab-workhorse: 8.21.1 -> 8.21.2
  • gitlab: 12.8.8 -> 12.8.9
    See
    https://about.gitlab.com/releases/2020/04/14/critical-security-release-gitlab-12-dot-9-dot-3-released/
    for details.
  • gitlab: support passing --rev to the update-all script
    While it's already possible to invoke update-data with the --rev
    argument, one still needs to run all later phases manually.
    Fix this, by having update-all also accept a --rev argument, and
    pass it down to update-data.
    Also, make the help text a bit more usable, by suggesting the usual
    versioning scheme used these times.
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@flokli flokli requested review from talyz and a user April 20, 2020 15:22
@flokli flokli mentioned this pull request Apr 20, 2020
10 tasks
@flokli
Copy link
Contributor Author

flokli commented Apr 20, 2020

Hm, there seems to be some bundler version incompatibilities in our bundlerEnv:

bundler: failed to load command: rake (/nix/store/xkqpm8v228zsk16qprf5hxc3yw2jnr2b-gitlab-env-12.8.9/lib/ruby/gems/2.6.0/bin/rake)
Gem::LoadError: You have already activated bundler 1.17.2, but your Gemfile requires bundler 2.1.4. Since bundler is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports bundler as a default gem.
  /nix/store/hindv16l90d7i4n3hk5l1x73nj068kyp-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:312:in `check_for_activated_spec!'
  /nix/store/hindv16l90d7i4n3hk5l1x73nj068kyp-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:31:in `block in setup'
  /nix/store/hindv16l90d7i4n3hk5l1x73nj068kyp-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/spec_set.rb:147:in `each'
  /nix/store/hindv16l90d7i4n3hk5l1x73nj068kyp-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/spec_set.rb:147:in `each'
  /nix/store/hindv16l90d7i4n3hk5l1x73nj068kyp-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:26:in `map'
  /nix/store/hindv16l90d7i4n3hk5l1x73nj068kyp-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:26:in `setup'
  /nix/store/hindv16l90d7i4n3hk5l1x73nj068kyp-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler.rb:149:in `setup'
  /nix/store/hindv16l90d7i4n3hk5l1x73nj068kyp-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/setup.rb:10:in `block in <top (required)>'
  /nix/store/hindv16l90d7i4n3hk5l1x73nj068kyp-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/ui/shell.rb:136:in `with_level'
  /nix/store/hindv16l90d7i4n3hk5l1x73nj068kyp-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/ui/shell.rb:88:in `silence'
  /nix/store/hindv16l90d7i4n3hk5l1x73nj068kyp-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/setup.rb:10:in `<top (required)>'
builder for '/nix/store/djq9vpdl88p5g6y78kh4r8cfrq3gv1wx-gitlab-assets-12.8.9.drv' failed with exit code 1

@flokli
Copy link
Contributor Author

flokli commented Apr 20, 2020

This seems to be another invocation of nix-community/bundix#63. pinging @manveru.

@manveru
Copy link
Contributor

manveru commented Apr 20, 2020

@flokli is there a specific reason to use bundler 1.x here?

@flokli
Copy link
Contributor Author

flokli commented Apr 20, 2020

@manveru
Copy link
Contributor

manveru commented Apr 20, 2020

It's important that you use bundix from the same nixpkgs version, so bundler won't differ.

@flokli
Copy link
Contributor Author

flokli commented Apr 20, 2020

I did set NIX_PATH=nixpkgs=/path/to/nixpkgs-gitlab, and then invoked update.py, which uses a nix-shell to provide bundix.

This should be correct, shouldn't it?

@manveru
Copy link
Contributor

manveru commented Apr 20, 2020

I changed the update.py to call bundix -l instead, to force writing the lockfile. There's still a problem with Bundix treating the warning that bundler emits about upgrading the lockfile version as an error.
To work around that, I invoke bundle lock separately, and then run a simple bundix afterwards:

diff --git a/pkgs/applications/version-management/gitlab/update.py b/pkgs/applications/version-management/gitlab/update.py
index a2a3a6d05b7..272f6d143c1 100755
--- a/pkgs/applications/version-management/gitlab/update.py
+++ b/pkgs/applications/version-management/gitlab/update.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env nix-shell
-#! nix-shell -i python3 -p bundix common-updater-scripts nix nix-prefetch-git python3 python3Packages.requests python3Packages.lxml python3Packages.click python3Packages.click-log vgo2nix yarn2nix
+#! nix-shell -i python3 -p bundix bundler common-updater-scripts nix nix-prefetch-git python3 python3Packages.requests python3Packages.lxml python3Packages.click python3Packages.click-log vgo2nix yarn2nix
 
 import click
 import click_log
@@ -135,6 +135,7 @@ def update_rubyenv():
         with open(rubyenv_dir / fn, 'w') as f:
             f.write(repo.get_file(fn, rev))
 
+    subprocess.check_output(['bundle', 'lock'], cwd=rubyenv_dir)
     subprocess.check_output(['bundix'], cwd=rubyenv_dir)
 
 
@@ -174,6 +175,7 @@ def update_gitaly():
         with open(gitaly_dir / fn, 'w') as f:
             f.write(repo.get_file(fn, f"v{gitaly_server_version}"))
 
+    subprocess.check_output(['bundle', 'lock'], cwd=gitaly_dir)
     subprocess.check_output(['bundix'], cwd=gitaly_dir)
 
     os.environ['GOROOT'] = ""

There's still an error from vgo2nix, but I think that's out of scope for me :)

flokli and others added 5 commits April 21, 2020 22:22
While it's already possible to invoke `update-data` with the `--rev`
argument, one still needs to run all later phases manually.

Fix this, by having `update-all` also accept a `--rev` argument, and
pass it down to `update-data`.

Also, make the help text a bit more usable, by suggesting the usual
versioning scheme used these times.
`bundix -l` doesn't work, as it treats bundler's warning about upgrading
the lockfile version as an error, so invoke `bundle lock` manually.
@flokli
Copy link
Contributor Author

flokli commented Apr 21, 2020

@manveru thanks for taking a look!

I didn't run into the vgo2nix error, and applied your suggestion as a commit in the (now updated) PR.

I successfully managed to build gitlab with it, currently running the tests the tests succeeded! 🎉

Is there a bug report open about bundix -l misinterpreting the warning as an error?

@flokli
Copy link
Contributor Author

flokli commented Apr 21, 2020

@GrahamcOfBorg test gitlab

@ghost ghost merged commit 81c34ec into NixOS:master Apr 27, 2020
@flokli flokli deleted the gitlab-12.8.9 branch April 27, 2020 13:07
@flokli
Copy link
Contributor Author

flokli commented Apr 27, 2020

Thanks @petabyteboy for merging this! Did you also backport to 20.03?

@ghost
Copy link

ghost commented Apr 28, 2020

I just did so in 9153c23157a

@flokli
Copy link
Contributor Author

flokli commented Apr 28, 2020

The backport was missing the other commits in here.

Backported in c69934e, 0364b92, e265095 and e97d89f.

Will do 19.09 shortly.

@flokli
Copy link
Contributor Author

flokli commented Apr 28, 2020

Backported to 19.09 in 7b9f3c8, 57df0aa, 767ca36, 68169a7 and a7ceb25.

@ghost
Copy link

ghost commented Apr 28, 2020

Thanks for fixing my mistake with the other commits.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants