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

minio: support building on darwin #94873

Merged
merged 1 commit into from Sep 25, 2020

Conversation

afontaine
Copy link
Contributor

@afontaine afontaine commented Aug 7, 2020

Motivation for this change

Modified build command and flags to allow successful build on Darwin
systems. Based on flags in GitHub issue from minio project

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.

@ludovicc
Copy link

ludovicc commented Aug 9, 2020

Reviewed points
  • package name fits guidelines
  • package version fits guidelines
  • package build on Darwin
  • executables tested on Darwin
  • all depending packages build
Possible improvements
> minio
NAME:
  minio - High Performance Object Storage

DESCRIPTION:
  Build high performance data infrastructure for machine learning, analytics and application data workloads with MinIO

USAGE:
  minio [FLAGS] COMMAND [ARGS...]

COMMANDS:
  server   start object storage server
  gateway  start object storage gateway

FLAGS:
  --certs-dir value, -S value  path to certs directory (default: "/Users/lclaude/.minio/certs")
  --quiet                      disable startup information
  --anonymous                  hide sensitive information from logging
  --json                       output server logs and startup information in json format
  --help, -h                   show help
  --version, -v                print the version

VERSION:
  DEVELOPMENT.GOGET

Can you try to provide a better version message?

Comments

@afontaine
Copy link
Contributor Author

@ludovicc unfortunately, the version issue seems to be pre-existing and I don't know enough about how go works to get what seems to be some linker flags passed in properly. Do you have any advice here?

@bachp
Copy link
Member

bachp commented Aug 10, 2020

Could it be that buildFlags overrides buildFlagsArray? If yes addig your flags to buildFlagsArray should still keep the version

@afontaine
Copy link
Contributor Author

@bachp I mean to say that building minio from nixpkgs on master still results in a DEVELOPMENT.GOGET version it seems, this change doesn't impact that.

@bachp
Copy link
Member

bachp commented Aug 10, 2020

@afontaine You are right. I will fix this in another MR. @ludovicc We should not block this change because of an unrelated issue.

@ludovicc
Copy link

yes, please don't block this MR because of this minor issue. @bachp a separate MR would be great, thanks.

@ludovicc
Copy link

I'm sorry, one last remark: @afontaine you added the flag -tags=kqueue, but I can see also -trimpath being used. Is that relevant to this build? Those flags also seem to be used for all architectures if I understand well goreleaser config.

https://github.com/minio/minio/blob/73890f31af5f1247c1f5b8131f136d1045d6b5f6/.goreleaser.yml#L67
https://github.com/minio/minio/blob/36d36fab0bfeb0e91099e852408d0e1ac2e06440/Makefile#L61

@afontaine
Copy link
Contributor Author

@ludovicc you seem correct, and it looks like all these flags seem to be used across all architectures, so I removed the darwin check for -tags kqueue as well.

@afontaine
Copy link
Contributor Author

and a little more playing around and things now all fit into the buildFlagsArray properly 🎉

@afontaine
Copy link
Contributor Author

it looks like CGO is disabled on linux builds as well, so I might as well just keep it consistent.

@ludovicc
Copy link

I reviewed the latest update and it works well on Darwin. Version is still DEVELOPMENT.GOGET but it's a very minor annoyance.

@afontaine
Copy link
Contributor Author

Ah I just noticed the merge conflicts, they are all fixed up now 🚀

Modified build command and flags to allow successful build on Darwin
systems. Based on flags in GitHub issue from minio project [0]

[0]: minio/minio#10188 (comment)
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/239

@AndersonTorres AndersonTorres merged commit 67d2fd6 into NixOS:master Sep 25, 2020
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

5 participants