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

Update nix pin with make nixpkgs #218

Merged
merged 1 commit into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update nix pin with make nixpkgs
This PR introduce 3 changes:

  - Upgrade Nix stable channel from 20.03 to 20.09.

    NixOS 20.09 released at 2020-10-27, see
    <https://nixos.org/manual/nixos/stable/release-notes.html#sec-release-20.09>
    for more information.

  - Replace `git` with `gitMinimal`.

    All 6 projects (i.e. crun/conmon/skopeo/buildah/podman/cri-o) are
    having `git` as dependency for failsafe during bootstrap. BTW
    <NixOS/nixpkgs#104896> replace `asciidoc`
    with `asciidoctor` so trigger the dependency chain to `glib` and so
    failed (see below). Switching to `gitMinimal` skip this dependency
    chain to `glib`, which also speed up overall build process.

  - Adding `-pthread` for `glib`

    `conmon` couldn't skip the error by replacing `git` with
    `gitMinimal` since it do depend on `glib`. Since `glib` trigger
    error message "undefined reference to 'pthread\_create'", therefore
    adding `pthread` to `CFLAGS` could solve the problem.

Also see:

  - <containers/crun#550>
  - <#218>
  - <containers/skopeo#1120>
  - <containers/buildah#2831>
  - <containers/podman#8526>
  - <cri-o/cri-o#4395>

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
  • Loading branch information
hswong3i committed Dec 20, 2020
commit 58d020a18219501d26c00b54636b06373af8f243
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ endif
# Update nix/nixpkgs.json its latest stable commit
.PHONY: nixpkgs
nixpkgs:
@nix run -f channel:nixos-20.03 nix-prefetch-git -c nix-prefetch-git \
@nix run -f channel:nixos-20.09 nix-prefetch-git -c nix-prefetch-git \
--no-deepClone https://github.com/nixos/nixpkgs > nix/nixpkgs.json

# Build statically linked binary
Expand Down
4 changes: 2 additions & 2 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ let
doCheck = false;
enableParallelBuilding = true;
outputs = [ "out" ];
nativeBuildInputs = [ bash git pcre pkg-config which ];
nativeBuildInputs = [ bash gitMinimal pcre pkg-config which ];
buildInputs = [ glibc glibc.static glib ];
prePatch = ''
export CFLAGS='-static'
export CFLAGS='-static -pthread'
export LDFLAGS='-s -w -static-libgcc -static'
export EXTRA_LDFLAGS='-s -w -linkmode external -extldflags "-static -lm"'
'';
Expand Down
11 changes: 7 additions & 4 deletions nix/nixpkgs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"url": "https://github.com/nixos/nixpkgs",
"rev": "6e089d30148953df7abb3a1167169afc7848499c",
"date": "2020-11-05T09:56:30+01:00",
"sha256": "0ydqjkz7payl16psx445jwh6dc6lgbvj2w11xin1dqvbpcp03jcy",
"fetchSubmodules": false
"rev": "6ea2fd15d881006b41ea5bbed0f76bffcd85f9f9",
"date": "2020-12-20T13:26:58+10:00",
"path": "/nix/store/kyw1ackbp9qh1jzlzwmjvi5i3541ym5z-nixpkgs",
"sha256": "0kgqmw4ki10b37530jh912sn49x3gay5cnmfr8yz2yp8nvkrk236",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}