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

*: get MacOS build working #318

Merged
merged 3 commits into from
Jun 22, 2020
Merged

Conversation

cyphar
Copy link
Member

@cyphar cyphar commented May 26, 2020

I don't have a MacOS machine (nor can we currently run the tests on
MacOS) but we can at least do a sanity-check by trying to build the
project on MacOS.

Fixes #98
Signed-off-by: Aleksa Sarai asarai@suse.de

@cyphar cyphar marked this pull request as draft May 26, 2020 23:20
@cyphar cyphar mentioned this pull request May 27, 2020
@cyphar cyphar force-pushed the build-macos branch 11 times, most recently from 21a812d to 8dc24e4 Compare June 20, 2020 14:14
@cyphar
Copy link
Member Author

cyphar commented Jun 20, 2020

Unit tests are working fine under MacOS now. I am a little worried how we'll deal with libpathrs in the future, but we'll cross that bridge when we come to it. Integration tests might take some more work to do (though I think most should be fine, the only major issue is there are a probably a fair few Linux-isms that we'll need to work around).

@cyphar cyphar force-pushed the build-macos branch 4 times, most recently from bb6fe03 to 961ca0f Compare June 20, 2020 18:43
@cyphar cyphar marked this pull request as ready for review June 20, 2020 18:43
@cyphar
Copy link
Member Author

cyphar commented Jun 20, 2020

You can let me know if this works @IronCore864, @huntc.

I don't have a MacOS machine (nor can we currently run the tests on
MacOS) but we can at least do a sanity-check by trying to build the
project on MacOS.

Most of the code changes move Linux-only functions (and tests) to
foo_linux{,_test}.go files, while code that was already usable on "unix"
platforms is moved to foo_unix{,_test}.go files. There was also a mild
refactor of some repeated test code, with it all being moved into
testutils. With these minor changes, umoci now builds.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
This requires a little bit of working around MacOS-specific weirdnesses
(which are fine under POSIX but don't match Linux). The most obvious one
is the lack of 'readlink -f', but there's also the lack of sub-second
granularity of filesystem timesamps, and the default-follow behaviour of
link(2) when trying to hardlink a symlink.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Signed-off-by: Aleksa Sarai <asarai@suse.de>
@cyphar
Copy link
Member Author

cyphar commented Jun 22, 2020

LGTM.

/cc @tych0 @vbatts

@tych0
Copy link
Member

tych0 commented Jun 22, 2020

LGTM.

@cyphar cyphar merged commit 30d1160 into opencontainers:master Jun 22, 2020
@cyphar cyphar deleted the build-macos branch June 22, 2020 13:51
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.

OS X Support
2 participants