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: Environment checks in sanboxed environments #94

Merged
merged 3 commits into from
Aug 14, 2023
Merged

Conversation

OliLay
Copy link
Collaborator

@OliLay OliLay commented Aug 11, 2023

This PR solves an issue that has been there for quite a while now: previously, we would not check if a compiler exists in a sandboxed environment (and e.g. also, if it supports the selected target), leading to weird errors. This made especially setting up cross-compiling harder.
I refactored this now, so that we always know in which context (= shell environment) we are in, by introducing an abstract ShellEnvironment class. Inheriting classes must implement transform_command, which transforms a command so that it is executed inside a sandbox. When executing a command, we must now always pass the context in which we are in and in which the command should be executed.
This makes the code cleaner, and allows us to check all environment related things also in the sandbox.

@OliLay OliLay changed the title fix: Environment checks in containerized environments fix: Environment checks in sanboxed environments Aug 11, 2023
@OliLay OliLay marked this pull request as ready for review August 11, 2023 10:57
homcc/server/environment.py Outdated Show resolved Hide resolved
OliLay and others added 2 commits August 14, 2023 09:17
Co-authored-by: Simon Pirsch <95348275+spirsch@users.noreply.github.com>
@OliLay OliLay merged commit 17bd865 into main Aug 14, 2023
4 checks passed
@OliLay OliLay deleted the layer/fix-env-checks branch August 14, 2023 10:17
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.

3 participants