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 empty copy of compiled binaries when --build-path equals to --output-dir #2320

Conversation

alessio-perugini
Copy link
Contributor

@alessio-perugini alessio-perugini commented Sep 14, 2023

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

Skip the copy of compiled binaries when the specified --build-path equals to --output-dir.
By doing so we also avoid useless computation. (This doesn't solve the root of the problem which is underneath the CopyTo function. Another PR will address it to go-paths-helper repo)

What is the current behavior?

When --build-path equals to --output-dir we copy the compiled files but their contet is empty.

What is the new behavior?

When both flags are set we simply skip the copying part.

Does this PR introduce a breaking change, and is titled accordingly?

Other information

Most likely we should address this also in the gopaths library.

@alessio-perugini alessio-perugini self-assigned this Sep 14, 2023
@alessio-perugini alessio-perugini linked an issue Sep 14, 2023 that may be closed by this pull request
3 tasks
@alessio-perugini alessio-perugini changed the base branch from master to bye_bye_legacy September 14, 2023 17:35
@alessio-perugini alessio-perugini changed the title fix conflict build path with output dit when compiling fix conflict --build-path with --output-dir when compiling Sep 14, 2023
@alessio-perugini alessio-perugini added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Sep 14, 2023
@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Patch coverage: 45.45% and no project coverage change.

Comparison is base (55fc5aa) 63.03% compared to head (1b3ef43) 63.04%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2320   +/-   ##
=======================================
  Coverage   63.03%   63.04%           
=======================================
  Files         200      200           
  Lines       19206    19202    -4     
=======================================
- Hits        12106    12105    -1     
+ Misses       6053     6051    -2     
+ Partials     1047     1046    -1     
Flag Coverage Δ
unit 63.04% <45.45%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
commands/compile/compile.go 68.98% <45.45%> (-0.43%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alessio-perugini alessio-perugini force-pushed the fix-conflict--build-path-with--output-dit-when-compiling branch 2 times, most recently from 5079255 to 2093d01 Compare September 15, 2023 08:44
@alessio-perugini alessio-perugini changed the title fix conflict --build-path with --output-dir when compiling Fix empty copy of compiled binaries when --build-path equals to --output-dir Sep 15, 2023
@alessio-perugini alessio-perugini marked this pull request as ready for review September 15, 2023 09:04
@alessio-perugini alessio-perugini force-pushed the bye_bye_legacy branch 2 times, most recently from 9c073c1 to 99ccfb5 Compare September 15, 2023 16:10
Base automatically changed from bye_bye_legacy to master September 15, 2023 17:38
@alessio-perugini alessio-perugini force-pushed the fix-conflict--build-path-with--output-dit-when-compiling branch from 2093d01 to 068deb7 Compare September 15, 2023 19:34
…output-dir

When compiling with --output-dir pointing to the same directory of --build-path do not copy file
@alessio-perugini alessio-perugini force-pushed the fix-conflict--build-path-with--output-dit-when-compiling branch from 068deb7 to 1b3ef43 Compare September 18, 2023 07:30
@alessio-perugini alessio-perugini merged commit 0e6133f into master Sep 20, 2023
185 checks passed
@alessio-perugini alessio-perugini deleted the fix-conflict--build-path-with--output-dit-when-compiling branch September 20, 2023 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conflict between --build-path and --output-dir
2 participants