Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@spirsch
Copy link
Collaborator

@spirsch spirsch commented Jun 24, 2022

This PR's primary goal is to keep side effects that might occur during preprocessing which is triggered by -MD and related flags with their many resulting edge cases:

  • find_dependencies and Arguments.dependency_finding were reworked such that if the execution of arguments leads to the creation of an explicit dependency file, that dependencies will be read from that file (rather than executing the preprocessor again and reading dependencies from stdout)
  • creation of the dependency set was improved by handling the edge case of multiple specified preprocessor output targets via -MT
  • silent failure of the preprocessor (result is empty without failure) is now handled via falling back to local compilation

Additional changes:

  • fix semaphore double unlock & deletion
  • repetitive skipif checks for tests whether a specific tool (g++, clang++, schroot) is installed were refactored to their respective @pytest.mark.tool markers
  • improved e2e tests by providing client and server subprocess wrapper classes

@spirsch spirsch marked this pull request as ready for review July 8, 2022 15:48
@spirsch spirsch requested review from OliLay and wmann-celonis July 8, 2022 15:48
logger.debug("Exiting semaphore '%s' with value '%i'", self._semaphore.name, self._semaphore.value)

if self._semaphore is not None:
self._semaphore.__exit__(*exc) # releases the semaphore
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we manually call __exit__? Shouldn't be close enough?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need either release or __exit__ (implicit release via provided context manager) here.
My thoughts here were, that if in newer versions of the posix_ipc library __exit__ implies more work or better exception handling that we already support it with this implementation. However, since we currently have to use a fixed version of the library we can cross-check with that particular implementation. Basically, I don't mind either approach.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay, I think its fine. Was just wondering if it has any particular reasoning, but I guess relying on the context manager behavior is fine

try:
cfg: ConfigParser = parse_configs(filenames or default_locations(HOMCC_CONFIG_FILENAME))
except Error as err:
print(f"{err}; using default configuration instead")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have to use print here because we have not initialized logging yet?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Exactly, yes!

@OliLay OliLay self-requested a review July 11, 2022 07:54
@spirsch spirsch merged commit 8df29d8 into main Jul 12, 2022
@spirsch spirsch deleted the Preprocessor-Target-Fix branch July 12, 2022 07:59
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.

4 participants