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

plugins: kbuild: read configs from source directory instead #2202

Merged
merged 2 commits into from
Aug 9, 2018

Conversation

jessesung
Copy link
Contributor

@jessesung jessesung commented Aug 8, 2018

Configs should be read from source directory instead of TOPDIR, in order
to handle a remote git repo properly.

Signed-off-by: Wen-chien Jesse Sung jesse.sung@canonical.com

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on bug reports?
  • If this is a new feature. Have you discussed the design on the forum?
  • Have you successfully run ./runtests.sh static?
  • Have you successfully run ./runtests.sh unit?

@piso77
Copy link
Contributor

piso77 commented Aug 8, 2018

You can incur in a problem if, for example, you have a snapcraft.yaml that points to a remote git tree and branch:

snapcraft.yaml:
...
parts:
kernel:
plugin: kernel
source: https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/xenial
source-branch: raspi2
source-type: git
kconfigflavour: raspi2
...

while you current working directory contains the debian structure with the config files - the kernel plugin won't take in consiresation the remote debian dir, and use the local one:

Traceback (most recent call last):
File "/home/ubuntu/snapcraft/snapcraft/plugins/kbuild.py", line 158, in assemble_ubuntu_config
with open(config_part_path) as config_part:
FileNotFoundError: [Errno 2] No such file or directory: 'debian.master/config/armhf/config.flavour.raspi2'

this patch will fixes that - i replicated it locally, and it does what it says.

@sergiusens
Copy link
Collaborator

thanks for contributing @jessesung
Do you mind fixing the static tests or if I go ahead and do so myself and push to this PR?

Configs should be read from source directory instead of TOPDIR, in order
to handle a remote git repo properly.

Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
@codecov-io
Copy link

codecov-io commented Aug 9, 2018

Codecov Report

Merging #2202 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2202      +/-   ##
==========================================
+ Coverage   91.17%   91.19%   +0.02%     
==========================================
  Files         202      202              
  Lines       12987    12987              
  Branches     1921     1921              
==========================================
+ Hits        11841    11844       +3     
+ Misses        777      776       -1     
+ Partials      369      367       -2
Impacted Files Coverage Δ
snapcraft/plugins/kbuild.py 88.57% <100%> (ø) ⬆️
snapcraft/internal/elf.py 83.17% <0%> (+0.32%) ⬆️
snapcraft/internal/pluginhandler/_plugin_loader.py 93.75% <0%> (+1.78%) ⬆️

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 67d94bd...0eb1086. Read the comment docs.

@sergiusens sergiusens merged commit b6327b0 into canonical:master Aug 9, 2018
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