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

go plugin: do not remove install /bin directory before build #2957

Merged
merged 4 commits into from
Mar 4, 2020

Conversation

cjp256
Copy link
Contributor

@cjp256 cjp256 commented Mar 3, 2020

Packages configured in a part's stage-packages are installed prior
to build and installed to $SNAPCRAFT_PART_INSTALL. Cleaning
$SNAPCRAFT_PART_INSTALL/bin will purge any files that may have been
installed there.

Running go build should overwrite any previously installed files,
which will be OK for incremental builds. However, as the go plugin
does not enable out_of_source_build, the entire build directory is
purged on every build anyways.

Add spread test for coverage.

Signed-off-by: Chris Patterson chris.patterson@canonical.com

Reported by @stgraber

Packages configured in a part's stage-packages are installed prior
to build and installed to $SNAPCRAFT_PART_INSTALL.  Cleaning
$SNAPCRAFT_PART_INSTALL/bin will purge any files that may have been
installed there.

Running go build should overwrite any previously installed files,
which will be OK for incremental builds.  However, as the go plugin
does not enable out_of_source_build, the entire build directory is
purged on every build anyways.

Add spread test for coverage.

Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
@stgraber
Copy link
Contributor

stgraber commented Mar 3, 2020

LGTM

Copy link
Collaborator

@sergiusens sergiusens left a comment

Choose a reason for hiding this comment

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

Thanks, we now need an extra parameter for os.makedirs though

snapcraft/plugins/go.py Outdated Show resolved Hide resolved
sergiusens
sergiusens previously approved these changes Mar 4, 2020
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@83e63c3). Click here to learn what that means.
The diff coverage is 90.9%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2957   +/-   ##
=========================================
  Coverage          ?   88.17%           
=========================================
  Files             ?      229           
  Lines             ?    16569           
  Branches          ?     2560           
=========================================
  Hits              ?    14610           
  Misses            ?     1425           
  Partials          ?      534
Impacted Files Coverage Δ
snapcraft/cli/_runner.py 92.59% <100%> (ø)
snapcraft/plugins/dotnet.py 91.48% <88.88%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83e63c3...59ca74e. Read the comment docs.

@sergiusens sergiusens merged commit 1fee618 into master Mar 4, 2020
@sergiusens sergiusens deleted the fix-go branch March 4, 2020 08:00
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.

None yet

4 participants