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

Adds Golang 1.13.1 as a Software definition #1098

Merged
merged 9 commits into from
Oct 1, 2019
Merged

Conversation

afiune
Copy link

@afiune afiune commented Sep 26, 2019

Description

Adds Golang as an Omnibus Software definition.

Related Issue

chef/chef-workstation#497

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

@afiune afiune requested review from a team as code owners September 26, 2019 18:45
@afiune afiune changed the title Adds Golang as a Software definition Adds Golang 1.13.1 as a Software definition Sep 26, 2019
Signed-off-by: Salim Afiune <afiune@chef.io>
Salim Afiune added 2 commits September 27, 2019 15:03
Having the `sync` statement made our omnibus build to complain with the
following error:
```
[Builder: libtool] I | 2019-09-27T06:03:20+00:00 | Build libtool: 0.0011s
RuntimeError: Can not find config.guess. Make sure you add a dependency on 'config_guess' in your software definition
```

By avoiding that sync we "fixed" the problem. (arg workaround it)

Signed-off-by: Salim Afiune <afiune@chef.io>
Signed-off-by: Salim Afiune <afiune@chef.io>
build do
mkdir "#{install_dir}/embedded/bin"
%w{go gofmt}.each do |bin|
link "#{project_dir}/go/bin/#{bin}", "#{install_dir}/embedded/bin/#{bin}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll want to do a copy or sync here - otherwise you'll be linking from the "build" directory to the installation directory, resulting in failed linking when it's packaged up.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @scotthain for the review. As you can see in the commit history, I originally did a sync but it was causing failures (reference: 3fc04fc). Another thing to consider is that we need Go to compile the binaries we will be developing but we don’t need to package it. So probably we will delete these links.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah in that case I don't think it belongs in omnibus-software since your use case is slightly different. Since you'll be deleting the links in (I assume) a separate, private (by that I mean not-in-omnibus-software) "cleanup" definition, this will break if anyone assumes it "installs go". @chef/omnibus-maintainers any thoughts on this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to add that cleanup in this repo, I am not quite done with this PR, I’m still doing compile tests. I added it here because Rust is also here and I thought it would be a good place to add Go, but if this is not the correct repo, where should you recommend I should add it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the rust def and corresponding uninstall is slightly different because it actually does a full install of rust to the install_dir and then does a full uninstall. The way I see it there are 2 options:

  • Do a full install of go in this def and create a go-uninstall def that does a full remove. This allows folks who actually want to include/have a "permanent" go installation work correctly when using this def. (and a corresponding uninstall)
  • Put the def as is (with the linking) in the project that uses it, and remove the links in a cleanup def in the project that uses it.

Happy to use mouthwords to talk more about this if I'm not being clear.

Copy link
Author

@afiune afiune Sep 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, I'll change things to do a full install. Thanks for the review Scott! ❤️ 🎉 🥇

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely! Thanks for being open to the feedback 🚀 🍰

Salim Afiune added 2 commits September 30, 2019 11:38
Signed-off-by: Salim Afiune <afiune@chef.io>
Signed-off-by: Salim Afiune <afiune@chef.io>
@afiune
Copy link
Author

afiune commented Sep 30, 2019

@scotthain I haven't tested this but, does it look better now?

@scotthain
Copy link

@afiune looks great! could you run a quick test (add it to omnibus-harmony for a quicker test if you'd like) to make sure it works as expected?

Salim Afiune added 2 commits September 30, 2019 12:43
Signed-off-by: Salim Afiune <afiune@chef.io>
Signed-off-by: Salim Afiune <afiune@chef.io>
afiune pushed a commit to chef/chef-workstation that referenced this pull request Oct 1, 2019
Depends on chef/omnibus-software#1098

Signed-off-by: Salim Afiune <afiune@chef.io>
Salim Afiune added 2 commits October 1, 2019 09:39
Signed-off-by: Salim Afiune <afiune@chef.io>
@afiune afiune force-pushed the afiune/add-golang branch from e191d0f to 730c5bc Compare October 1, 2019 15:41
@scotthain
Copy link

Awesome looks great now!

@afiune afiune merged commit ab6655d into master Oct 1, 2019
@chef-expeditor chef-expeditor bot deleted the afiune/add-golang branch October 1, 2019 15:44
marcparadise pushed a commit to chef/chef-workstation that referenced this pull request Oct 2, 2019
Depends on chef/omnibus-software#1098

Signed-off-by: Salim Afiune <afiune@chef.io>
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.

3 participants