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

Supress fatal message in CPP example build #1701

Merged

Conversation

aLekSer
Copy link
Collaborator

@aLekSer aLekSer commented Jul 20, 2020

There is no .git folder in Docker when make build on examples/cpp-simple.
variable.
Note that when running next command AGONES_VERSION set as it should:
make run-sdk-command SDK_FOLDER=cpp COMMAND=build

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking
/kind bug

/kind cleanup

What this PR does / Why we need it:

Which issue(s) this PR fixes:

Closes #1091

Special notes for your reviewer:

There is no .git file, so version could be retrieved from environment
variable.
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: eec802ce-0f15-437d-bc34-e6ecab1de36e

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/1701/head:pr_1701 && git checkout pr_1701
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.8.0-e069123

@roberthbailey
Copy link
Member

This looks reasonable to me (since the output is only used if the return code from the child process is 0).

@dsazonoff - you had some thoughts on #1091 so I wanted to see if you had opinions about this solution?

@roberthbailey
Copy link
Member

/assign

@aLekSer
Copy link
Collaborator Author

aLekSer commented Jul 21, 2020

And adding link to my latest comment on the ticket:
#1091 (comment)
This code actually updates agones_VERSION value, when we build CPP SDK itself, not with an example:

set(agones_VERSION 1.7.0)

@dsazonoff
Copy link
Contributor

dsazonoff commented Jul 21, 2020

Original error message was produced because of missing .git folder. It is an output of a git describe --tags --abbrev=0 command, and actually it's not an error, from the build point of view.

@aLekSer solution looks good, I think it can be merged.

Possible improvements is to do next steps to fill the version variable:

  1. Check for an existing environment variable "VERSION" and use it if possible.
  2. Otherwise check if it's a git repo (we need to locate .git folder). If yes - get version from git as in existing code
  3. Otherwise just do not specify a version

Pseudocode:

if (DEFINED $ENV{VERSION)
  set(AGONES_VERSION $ENV{VERSION)
else()
  # keep existing code, but set AGONES_VERSION only for successful git execution
  find_package(git...)
  if (git_FOUND ...)
   ...
  endif()
endif()

set(project_version_param)
if (DEFINED AGONES_VERSION)
  set(project_version_param VERSION ${AGONES_VERSION})
endif()

project( ... ${project_version_param })

P.S. I'll do a new PR if I'll have some free time.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 202fd934-b9e4-48ef-bec8-aeac6a6dde78

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/1701/head:pr_1701 && git checkout pr_1701
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.8.0-f6f3392

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aLekSer, roberthbailey

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

@roberthbailey roberthbailey merged commit e583830 into googleforgames:master Jul 21, 2020
@aLekSer aLekSer deleted the cpp-sdk/supress-error-message branch July 21, 2020 16:33
@markmandel markmandel added this to the 1.8.0 milestone Aug 11, 2020
@markmandel markmandel added area/examples Examples. Usually found in the `examples` directory kind/cleanup Refactoring code, fixing up documentation, etc labels Aug 11, 2020
ilkercelikyilmaz pushed a commit to ilkercelikyilmaz/agones that referenced this pull request Oct 23, 2020
There is no .git file, so version could be retrieved from environment
variable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/examples Examples. Usually found in the `examples` directory cla: yes kind/cleanup Refactoring code, fixing up documentation, etc lgtm size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Building the cpp-simple example prints a fatal message and hangs for a long time before finishing
7 participants