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

build: allow to build without cgo on RISC-V #3437

Merged
merged 8 commits into from
Jul 3, 2019

Conversation

giuseppe
Copy link
Member

a few fixes to allow building on platforms where cgo is not available.

The generated podman is not really usable, as it misses the support for shm locking. Should we restore back file locking in this case?

Rootless support is also missing.

These two updates are also required (I'll revendor once they are merged):

containers/storage#375
containers/psgo#53

@carlosedp I could build podman for RISC-V using these commands:

export GO=/path/to/riscv-go/bin/go
export BUILDTAGS_CROSS="containers_image_openpgp containers_image_ostree_stub exclude_graphdriver_btrfs exclude_graphdriver_devicemapper exclude_disk_quota"
make bin/podman.cross.linux.riscv64

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L labels Jun 26, 2019
@mheon
Copy link
Member

mheon commented Jun 26, 2019 via email

pkg/spec/config_linux_cgo.go Outdated Show resolved Hide resolved
pkg/spec/config_linux_nocgo.go Outdated Show resolved Hide resolved
@giuseppe giuseppe changed the title build: allow to build without cgo on RISC-V [WIP] build: allow to build without cgo on RISC-V Jun 27, 2019
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 27, 2019
@giuseppe giuseppe changed the title [WIP] build: allow to build without cgo on RISC-V build: allow to build without cgo on RISC-V Jun 27, 2019
@openshift-ci-robot openshift-ci-robot added size/XL and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L labels Jun 27, 2019
@giuseppe
Copy link
Member Author

I've added a file locking mechanism that can be used instead of the SHM locking, this should unblock us when cgo is not available.

I've also re-vendored containers/storage and containers/psgo, so that they are usable without cgo as well.

@carlosedp I guess it can be used on RISC-V now :-)

@rhatdan
Copy link
Member

rhatdan commented Jun 27, 2019

LGTM

@carlosedp
Copy link

Testing it right now. I'll report back in a few.

@giuseppe giuseppe force-pushed the fix-nocgo branch 2 times, most recently from 96da443 to 7e586d3 Compare June 27, 2019 13:53
@carlosedp
Copy link

carlosedp commented Jun 27, 2019

@giuseppe I've successfully built podman on the SiFive Unleashed board (real hardware)! I also built crun and conmon to support it.

➜ go build -tags "containers_image_openpgp containers_image_ostree_stub exclude_graphdriver_btrfs exclude_graphdriver_devicemapper exclude_disk_quota" ./cmd/podman

➜ ./podman --version
podman version 1.4.4-dev
WARN[0000] unable to find /home/carlosedp/.config/containers/registries.conf. some podman (image shortnames) commands may be limited

➜ sudo cp ../conmon/bin/conmon /usr/local/bin
 
➜ ./podman --runtime=/usr/local/bin/crun
Error: could not get runtime: this function is not supported on this os
WARN[0000] unable to find /home/carlosedp/.config/containers/registries.conf. some podman (image shortnames) commands may be limited

Checking what's required to run the full podman stack.

@giuseppe
Copy link
Member Author

@carlosedp rootless won't work without cgo :/ you'll need to use root

@giuseppe
Copy link
Member Author

also you need to set lock_type ="file" in /etc/containers/libpod.conf

@giuseppe giuseppe force-pushed the fix-nocgo branch 2 times, most recently from e3d5c3b to d39dd6b Compare June 29, 2019 20:32
@rhatdan
Copy link
Member

rhatdan commented Jun 30, 2019

LGTM

@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #3324) made this pull request unmergeable. Please resolve the merge conflicts.

@rhatdan
Copy link
Member

rhatdan commented Jul 1, 2019

@giuseppe Needs a rebase.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 1, 2019
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 2, 2019
@giuseppe
Copy link
Member Author

giuseppe commented Jul 2, 2019

rebased and tests are passing

@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #3469) made this pull request unmergeable. Please resolve the merge conflicts.

@carlosedp
Copy link

Oh gosh, new rebase needed @giuseppe ...

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
move the cgo bits to a separate file to allow building without cgo.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
unfortunately rootless won't work without cgo, as most of the
implementation is in C, but at least allow to build libpod.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
so it can build without cgo since seccomp requires it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
preparation for the next patch.  It currently supports only "shm".

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
it is a wrapper around containers/storage file locking.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@giuseppe
Copy link
Member Author

giuseppe commented Jul 2, 2019

rebased again!

/cc @mheon @baude

@mheon
Copy link
Member

mheon commented Jul 2, 2019

Theoretically the file locks ought to respect the max locks number in the libpod runtime config... But I don't really think that's worth blocking over. LGTM overall.

@rhatdan
Copy link
Member

rhatdan commented Jul 3, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 3, 2019
@openshift-merge-robot openshift-merge-robot merged commit a22a32a into containers:master Jul 3, 2019
@rh-atomic-bot rh-atomic-bot mentioned this pull request Jul 3, 2019
7 tasks
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants