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

fix integration test #1181

Merged
merged 2 commits into from Jun 23, 2023
Merged

fix integration test #1181

merged 2 commits into from Jun 23, 2023

Conversation

ashmeenkaur
Copy link
Collaborator

@ashmeenkaur ashmeenkaur commented Jun 13, 2023

Description

while running integration tests with go version 1.21.x, we were seeing the following error:

invalid value "$HOME/gcsfuse" for flag -C: -C flag must be first flag on command line
usage: go build [-o output] [build flags] [packages]
Run 'go help build' for details.

Fix: made -C the first flag on command line. These changes are compatible with go version 1.20.x and newer.

Link to the issue in case of a bug fix.

NA

Testing details

  1. Manual - NA
  2. Unit tests - NA
  3. Integration tests - NA

Copy link
Collaborator

@Tulsishah Tulsishah left a comment

Choose a reason for hiding this comment

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

@ashmeenkaur Hope you have tested on GCE VM also. that won't break.

@ashmeenkaur
Copy link
Collaborator Author

ashmeenkaur commented Jun 13, 2023

@ashmeenkaur Hope you have tested on GCE VM also. that won't break.

Running into errors while running this on GCE VM with go version < 1.20.

@vadlakondaswetha
Copy link
Collaborator

@ashmeenkaur Hope you have tested on GCE VM also. that won't break.

Running into errors while running this on GCE VM with go version < 1.20.

Is it saying in the error that issue is with the go version? if not can you add a log line

@ashmeenkaur
Copy link
Collaborator Author

ashmeenkaur commented Jun 21, 2023

@ashmeenkaur Hope you have tested on GCE VM also. that won't break.

Running into errors while running this on GCE VM with go version < 1.20.

Is it saying in the error that issue is with the go version? if not can you add a log line

Yes, Here's the error log while running this with go version 1.19

Output:
17:39:48.572114 Building github.com/googlecloudplatform/gcsfuse to bin/gcsfuse
buildBinaries: /usr/local/go/bin/go build -C /home/ashmeen_google_com/gcsfuse -o /tmp/gcsfuse_readwrite_test_3616979871/bin/gcsfuse -ldflags -X main.gcsfuseVersion=fake_version github.com/googlecloudplatform/gcsfuse: exit status 2
Output:
flag provided but not defined: -C
usage: go build [-o output] [build flags] [packages]
Run 'go help build' for details.

I dont see its mentioning about go version anywhere. Can you add a log line mentioning that go version has to greater than specified version.

@ashmeenkaur
Copy link
Collaborator Author

ashmeenkaur commented Jun 22, 2023

I dont see its mentioning about go version anywhere. Can you add a log line mentioning that go version has to greater than specified version.

It doesn't specifically mentions that the go version has to be greater than some specific version. I came across this while experimenting.

go help build command shows the following documentation.

For go version 1.21.x

The build flags are shared by the build, clean, get, install, list, run,
and test commands:

        -C dir
                Change to dir before running the command.
                Any files named on the command line are interpreted after
                changing directories.
                If used, this flag must be the first one in the command line.

For go version 1.20.x

The build flags are shared by the build, clean, get, install, list, run,
and test commands:

	-C dir
		Change to dir before running the command.
		Any files named on the command line are interpreted after
		changing directories.

Documentation of the flag missing in go version 1.19.x

It would be good to add a log line since we already know the issue, instead of asking users to debug on their own.

@ashmeenkaur ashmeenkaur merged commit 4d4f9fe into master Jun 23, 2023
4 checks passed
@ashmeenkaur ashmeenkaur deleted the fix-integration-test branch August 30, 2023 22:57
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.

None yet

3 participants