Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Hard-link local sources instead of symlinking them. #622
Conversation
kyrofa
reviewed
Jul 1, 2016
| - raise EnvironmentError('Cannot pull to target {!r}'.format( | ||
| - self.source_dir)) | ||
| + elif os.path.isdir(self.source_dir): | ||
| + shutil.rmtree(self.source_dir) |
kyrofa
Jul 1, 2016
Member
Take particular note here: previously the code was very careful not to overwrite an existing parts/<name>/src directory or file. That logic is essentially impossible now that we're not symlinking, so I decided to assert ownership over parts/<name>/ and just blow it away if it already exists. See any downside to that? Users shouldn't be putting things there...
sergiusens
Jul 1, 2016
Collaborator
ownership was always the case.
We do need to track source changes now though ;-)
kyrofa
Jul 1, 2016
Member
We do need to track source changes now though ;-)
I'm not sure what you mean. Are you saying something needs to happen here?
sergiusens
Jul 1, 2016
Collaborator
El 01/07/16 a las 18:25, Kyle Fazzari escribió:
In snapcraft/internal/sources.py
#622 (comment):os.remove(self.source_dir)
elif (os.path.isdir(self.source_dir) andnot os.listdir(self.source_dir)):os.rmdir(self.source_dir)elif os.path.exists(self.source_dir):raise EnvironmentError('Cannot pull to target {!r}'.format(self.source_dir))elif os.path.isdir(self.source_dir):shutil.rmtree(self.source_dir)We do need to track source changes now though ;-)I'm not sure what you mean. Are you saying something needs to happen here?
Eventually, when we implement tracking of changes to sources that would
affect build results ;)
kyrofa
Jul 1, 2016
•
Member
Ah, yes of course. That will be a wonderful day! This change brings it a step closer
sergiusens
reviewed
Jul 1, 2016
| @@ -144,6 +144,9 @@ def build(self): | ||
| if os.path.exists(self.build_basedir): | ||
| shutil.rmtree(self.build_basedir) | ||
| + # FIXME: It's not necessary to ignore here anymore since it's now done |
sergiusens
Jul 1, 2016
Collaborator
please recreate an integration test with this scenario to confirm this
sergiusens
reviewed
Jul 1, 2016
| + os.makedirs(os.path.join('src', 'prime')) | ||
| + | ||
| + # Make the snapcraft.yaml and a built snap | ||
| + open(os.path.join('src', 'snapcraft.yaml'), 'w').close() |
|
looks good, I am reaching EOD so will let @elopio pay attention to the detail in UTs ;-) |
kyrofa
added some commits
Jun 27, 2016
|
|
|
just that last comment from me :-) |
Done |
|
Huh... now that I merged in master suddenly the coverage is decreasing instead of increasing. Not sure what the deal is there. Also, even VPNd in I can't seem to get to the autopkgtest failure, though judging from previous results it's just ROS. |
|
Huh. Now coverage increased again. Coveralls I think you're full of it. |
|
Failing ROS:
Not really sure what the deal is with autopkgtests... |
|
This is all green. The examples error is in the cleanup, fixed here: ubuntu-core/snappy-jenkins#193 |
kyrofa commentedJul 1, 2016
This PR fixes LP: #1590108 by hard-linking local sources instead of symlinking them. If hard links aren't possible, it copies them instead.