Skip to content

chore(Makefile): add gopath validation and targets to run nodes for a local dev network#3161

Closed
kanishkatn wants to merge 4 commits intodevelopmentfrom
chore/k/makefile
Closed

chore(Makefile): add gopath validation and targets to run nodes for a local dev network#3161
kanishkatn wants to merge 4 commits intodevelopmentfrom
chore/k/makefile

Conversation

@kanishkatn
Copy link
Copy Markdown
Contributor

@kanishkatn kanishkatn commented Mar 16, 2023

Changes

  • Added a validation on install target to make sure GOPATH is set
  • Added targets to run nodes for a local dev network

Primary Reviewer

@timwu20

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 16, 2023

Codecov Report

Merging #3161 (db74962) into development (9cd6f25) will decrease coverage by 0.09%.
The diff coverage is n/a.

Additional details and impacted files
@@               Coverage Diff               @@
##           development    #3161      +/-   ##
===============================================
- Coverage        51.72%   51.63%   -0.09%     
===============================================
  Files              220      220              
  Lines            28285    28285              
===============================================
- Hits             14631    14606      -25     
- Misses           12332    12362      +30     
+ Partials          1322     1317       -5     

@kanishkatn kanishkatn changed the title chore(Makefile): add gopath validation and targets for local dev network chore(Makefile): add gopath validation and targets to run nodes for a local dev network Mar 16, 2023
Copy link
Copy Markdown
Contributor

@kishansagathiya kishansagathiya left a comment

Choose a reason for hiding this comment

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

Not a big fan of using make targets as command short-hands

Comment thread Makefile
Comment on lines +129 to +131
ifndef GOPATH
$(error GOPATH is not set)
endif
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this check needed?
I think documentation precises you need Go installed, and that should set GOPATH right?
As in, if we have this check, we would open the door to add a lot more checks such as, do you have go installed, the right go version, do you have g++ installed for wasmer etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hmm, I tried running it on a new laptop which didn't have the GOPATH set. I hadn't used it for any other Go projects yet.

The error that was thrown didn't say anything about the GOPATH, so thought of adding the check in.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I agree with @qdm12 here, this feels a bit much for me. Im not sure it's within the scope of our code to make sure people set up their go env correctly

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See https://go.dev/doc/gopath_code

The GOPATH environment variable specifies the location of your workspace. It defaults to a directory named go inside your home directory, so $HOME/go on Unix, $home/go on Plan 9, and %USERPROFILE%\go (usually C:\Users\YourName\go) on Windows.

Let's remove it, I think you just had a fluke on your system and GOPATH didn't get set. In all my systems it's set automagically

Comment thread Makefile
Comment on lines +129 to +131
ifndef GOPATH
$(error GOPATH is not set)
endif
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this check needed?
I think documentation precises you need Go installed, and that should set GOPATH right?
As in, if we have this check, we would open the door to add a lot more checks such as, do you have go installed, the right go version, do you have g++ installed for wasmer etc.

Comment thread Makefile
Comment thread README.md
Comment on lines +183 to +193
```
make init-alice
```

```
make init-bob
```

```
make init-charlie
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit maybe merge these in a single code block?

Comment thread README.md
Comment on lines +198 to +208
```
make run-alice
```

```
make run-bob
```

```
make run-charlie
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit maybe merge these in a single code block?

Comment thread README.md
Comment on lines +212 to +222
```
make start-alice
```

```
make start-bob
```

```
make start-charlie
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit maybe merge these in a single code block?

Copy link
Copy Markdown
Contributor

@jimjbrettj jimjbrettj left a comment

Choose a reason for hiding this comment

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

Looks good, but some unresolved comments around checking GOPATH

@kanishkatn
Copy link
Copy Markdown
Contributor Author

Closing this as the make targets aren't really helpful in the new cli #3173

@kanishkatn kanishkatn closed this May 11, 2023
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.

5 participants