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

Set only one env variable for the Toit repository. #154

Merged
merged 2 commits into from
Apr 28, 2022

Conversation

floitsch
Copy link
Member

If the JAG_TOIT_REPO_PATH is set, we

  • Find and build the SDK in it.
  • Use the IDF from that Toit repository.
  • Assume that we are in development mode, and thus find
    the jaguar.snapshot relative to the jag executable.

Also, the Makefile was modified, to only use ?= for variables that we
want to influence with environment variables.

If the `JAG_TOIT_REPO_PATH` is set, we
- Find and build the SDK in it.
- Use the IDF from that Toit repository.
- Assume that we are in development mode, and thus find
  the jaguar.snapshot relative to the jag executable.

Also, the Makefile was modified, to only use `?=` for variables that we
want to influence with environment variables.
@floitsch floitsch requested a review from kasperl April 27, 2022 17:14
Copy link
Member

@kasperl kasperl 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 to me.

@@ -106,9 +118,9 @@ func GetESP32ImageCachePath() (string, error) {
}

func GetESP32ImagePath() (string, error) {
imagePath, ok := os.LookupEnv(Esp32ImageEnv)
toit_repo_path, ok := os.LookupEnv(ToitRepoPathEnv)
Copy link
Member

Choose a reason for hiding this comment

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

toitRepoPath

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@@ -89,6 +86,21 @@ func GetSnapshotsCachePath() (string, error) {
return ensureDirectory(filepath.Join(home, ".cache", "jaguar", "snapshots"), nil)
}

func GetSDKPath() (string, error) {
toit_repo_path, ok := os.LookupEnv(ToitRepoPathEnv)
Copy link
Member

Choose a reason for hiding this comment

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

toitRepoPath

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@@ -122,6 +134,18 @@ func GetESP32ImagePath() (string, error) {
}

func GetJaguarSnapshotPath() (string, error) {
_, ok := os.LookupEnv(ToitRepoPathEnv)
if ok {
// We assume that the jaguar executable is inside the build directory
Copy link
Member

Choose a reason for hiding this comment

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

Terminate comment with .

jaguar -> jag

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

_, ok := os.LookupEnv(ToitRepoPathEnv)
if ok {
// We assume that the jaguar executable is inside the build directory
// of the Jag repository.
Copy link
Member

Choose a reason for hiding this comment

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

Jag -> Jaguar

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@@ -143,9 +167,9 @@ func GetEsptoolCachePath() (string, error) {
}

func GetEsptoolPath() (string, error) {
esptoolPath, ok := os.LookupEnv(EsptoolPathEnv)
toit_repo_path, ok := os.LookupEnv(ToitRepoPathEnv)
Copy link
Member

Choose a reason for hiding this comment

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

toitRepoPath

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@floitsch floitsch enabled auto-merge (squash) April 28, 2022 12:50
@floitsch floitsch merged commit 44ca34b into main Apr 28, 2022
@floitsch floitsch deleted the florian/single_env_variable branch April 28, 2022 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants