10000 Support the application of Conan's BuildEnv/RunEnv by hackenbergstefan · Pull Request #44 · afri-bit/vsconan · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support the application of Conan's BuildEnv/RunEnv #44

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

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

hackenbergstefan
Copy link
Contributor

Closes #36

Copy link
Owner

Choose a reason for hiding this comment

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

@hackenbergstefan I assume this is the conan file to activate the conan environment and retrieve all the environment variables, right?

Copy link
Owner
@afri-bit afri-bit Aug 13, 2024

Choose a reason for hiding this comment

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

@hackenbergstefan I guess we can use a file watcher that watch the installation folder, where the file conanbuildenv.sh or conanrunenv.sh are stored and used to set the variable 😸 With this we have a neutral environment, since the conan python api in version 1 and 2 are different. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@h 8000 ackenbergstefan I assume this is the conan file to activate the conan environment and retrieve all the environment variables, right?

Yes, this is a small script that aggregates the environment variables. I've tried to manage using conan cmdline calls only, but that doesn't work.

Moreover, I've forgot to mention and document that it is working for conan 2 (currently) only. Conan 1 API is more complex... I have to investigate...

Copy link
Contributor Author
@hackenbergstefan hackenbergstefan Aug 14, 2024

Choose a reason for hiding this comment

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

@hackenbergstefan I guess we can use a file watcher that watch the installation folder, where the file conanbuildenv.sh or conanrunenv.sh are stored and used to set the variable 😸 With this we have a neutral environment, since the conan python api in version 1 and 2 are different. What do you think?

Not sure I understood your suggestion... ^^
Do you mean to utilize these two shell scripts to determine the environment changes instead of having this script?
In principle this is a good idea. I see just two topics:

Copy link
Owner
@afri-bit afri-bit left a comment

Choose a reason for hiding this comment

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

There are some minority changes, but overall looks good :) after that we can merge the pull request

jest.mock('vscode', () => ({
workspace: {
workspaceFolders: [{ uri: { fsPath: __dirname } }],
}
Copy link
Owner

Choose a reason for hiding this comment

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

You need to mock the vscode.window.showErrorMessage() otherwise the test will not run, due to mocked vscode module

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm. Actually, this code path is never reached:

  • If Conan is not installed at all, the execSync(cd ${__dirname} && conan new basic --force); fails
  • If Conan < 2 is installed, the same execSync fails as --force is not valid
  • If Conan 2 is installed the test should not fail^^

Did you found a case where showErrorMessage() gets called?

Copy link
Owner
@afri-bit afri-bit Aug 22, 2024

Choose a reason for hiding this comment

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

or maybe it was because the python was not found in my system 🤔 anyway i will check it later during the process

@hackenbergstefan
Copy link
Contributor Author

Sorry for the whitespace changes 🙈
I (hopefully) reverted all of them.

@afri-bit afri-bit merged commit 4cc1bb4 into afri-bit:develop Aug 22, 2024
1 check passed
@hackenbergstefan hackenbergstefan deleted the feature/environment-pr branch August 25, 2024 11:30
@hackenbergstefan
Copy link
Contributor Author

Thanks for merging! :-)

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.

2 participants
0