View Issue Details

IDProjectCategoryView StatusLast Update
0004466Slicer4Core: Building (CMake, Superbuild)public2017-10-26 16:47
ReporterlassoanAssigned Tojcfr 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product VersionSlicer 4.9.0 
Target VersionSlicer 4.9.0Fixed in Version 
Summary0004466: Repeated builds keep failing due to python-setuptools local modification
Description

Files are locally modified in python-setuptoold folder, which makes the build fail:

InitializeBuildStatus:

  Touching "x64\Release\python-setuptools\python-s.0687CE27.tlog\unsuccessfulbuild".

CustomBuild:

  Performing update step for 'python-setuptools'

CUSTOMBUILD : error : Your local changes to the following files would be overwritten by checkout: [C:\D\S4R\python-setuptools.vcxproj]

    setup.cfg

  Please, commit your changes or stash them before you can switch branches.

  Aborting

  CMake Error at C:/D/S4R/python-setuptools-prefix/tmp/python-setuptools-gitupdate.cmake:147 (message):

    Failed to checkout tag: '288143264db3f9b867bc479547b44d1167abf160'

Done Building Project "C:\D\S4R\python-setuptools.vcxproj" (default targets) -- FAILED.
TagsNo tags attached.

Activities

jcfr

jcfr

2017-10-23 13:20

administrator   ~0015331

I see. I gonna implement the suggestion I proposed last week

lassoan

lassoan

2017-10-23 13:25

developer   ~0015332

Thank you!

jcfr

jcfr

2017-10-24 23:06

administrator   ~0015333

Out of curiosity, could you share the content of the file having conflict ?

lassoan

lassoan

2017-10-24 23:46

developer   ~0015334

setup.cfg is changed: all line endings were switched from LF to CR/LF.

jcfr

jcfr

2017-10-25 19:04

administrator   ~0015335

Last edited: 2017-10-25 19:12

View 4 revisions

That is helpful. Do you have some global git settings ? If yes, what is the value of core.autocrlf ?

Here is what we have on the windows dashboard:

dashboard@overload MINGW64 ~
$ pwd
/c/Users/dashboard

dashboard@overload MINGW64 ~
$ git config --list
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager

I suspect that the value is not set to true on your build machine.

See https://stackoverflow.com/questions/2825428/why-should-i-use-core-autocrlf-true-in-git#2825829

lassoan

lassoan

2017-10-25 20:49

developer   ~0015336

Yes, the issue is most likely caused by EOL style difference between git and setup tools, but you cannot require developers to use any particular git setting.

Even just touching timestamps is undesirable (as they trigger rebuilding of some code parts), but modifying EOL is a major change of file content. The build system just should not mess with revision-controlled source directories in any way.

jcfr

jcfr

2017-10-25 21:14

administrator   ~0015337

Could you confirm that you deleted the directories python-setuptools* after this commit:
https://github.com/Slicer/Slicer/commit/306c573937ea05c38eb3544f464413bf4b3020d2#diff-b46bf7cc031a1ce22413460b166dac69

If not, I suggest you deleted them and reconfigure.

The build system just should not mess with revision-controlled source directories in any way

For files that have to be LF independently of the platform, the approach is to setup gitattribute. For example, see [1]

Generally speaking, for all the other text files, git is checking them out with the line ending matching the platform. As outline in the enclosed screenshot, git is indeed doing the right thing on the windows dashboard. setup.cfg as CRLF as expected. And when python is updating that file, it is also using the line ending of the platform. [2]

The issue is that I can not reproduce the problem. It seems specific to this build machine where the global setting are most likely improperly set.

If for some reason, core.autocrlf is not set to true on this machine, I suggest to set it.
See https://help.github.com/articles/dealing-with-line-endings/#platform-windows

[1] https://github.com/Slicer/Slicer/commit/ed787ec2054a76d0607d15f4710c8f42d459b797#diff-f42f0d2a3b4eae234bb2fe9a3d44bfb7

[2] The default is to use text mode, which may convert '\n' characters to a platform-specific representation on writing and back on reading.
See
https://docs.python.org/2/glossary.html#term-universal-newlines
https://stackoverflow.com/questions/10785131/line-endings-in-python#10785225



setup-cfg-diff.png (36,516 bytes)
setup-cfg-diff.png (36,516 bytes)
setup-cfg-overload.png (117,824 bytes)
setup-cfg-overload.png (117,824 bytes)
lassoan

lassoan

2017-10-25 22:03

developer   ~0015338

If for some reason, core.autocrlf is not set to true on this machine, I suggest to set it.

We cannot require users to set personal preferences in certain way. Enabling core.autocrlf caused various problems for me in the past, so I would not like to enable it again.

If gitattributes fixes it then it's great! I do a clean build and report back.

jcfr

jcfr

2017-10-25 23:47

administrator   ~0015339

Enabling core.autocrlf caused various problems for me in the past

This is most likely the default now on windows. I don't remember changing anything on this windows machine. If I recall, I accepted the recommendation when installing it bash.

And it is the recommended approach when working on cross platform project: https://www.git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#__code_core_autocrlf_code

If gitattributes fixes it then it's great!

I am curious to see if removing the python-setuptools* directories and reconfiguring address the problem.

Enabling core.autocrlf caused various problems for me in the past,

If autocrlf is indeed set to false, this means that all files checkout from git will have LF and not CRLF.

lassoan

lassoan

2017-10-26 16:45

developer   ~0015357

Last edited: 2017-10-26 16:47

View 2 revisions

I can confirm that gitignore fixed the problem: build does not fail anymore due to the changed file on the latest trunk version.

Thank you @jcfr!

Issue History

Date Modified Username Field Change
2017-10-23 13:04 lassoan New Issue
2017-10-23 13:04 lassoan Status new => assigned
2017-10-23 13:04 lassoan Assigned To => jcfr
2017-10-23 13:04 lassoan Description Updated View Revisions
2017-10-23 13:05 lassoan Description Updated View Revisions
2017-10-23 13:20 jcfr Note Added: 0015331
2017-10-23 13:25 lassoan Note Added: 0015332
2017-10-24 23:06 jcfr Note Added: 0015333
2017-10-24 23:46 lassoan Note Added: 0015334
2017-10-25 19:04 jcfr Note Added: 0015335
2017-10-25 19:08 jcfr Note Edited: 0015335 View Revisions
2017-10-25 19:12 jcfr Note Edited: 0015335 View Revisions
2017-10-25 19:12 jcfr Note Edited: 0015335 View Revisions
2017-10-25 20:49 lassoan Note Added: 0015336
2017-10-25 21:14 jcfr File Added: setup-cfg-diff.png
2017-10-25 21:14 jcfr File Added: setup-cfg-overload.png
2017-10-25 21:14 jcfr Note Added: 0015337
2017-10-25 22:03 lassoan Note Added: 0015338
2017-10-25 23:47 jcfr Note Added: 0015339
2017-10-26 16:45 lassoan Status assigned => closed
2017-10-26 16:45 lassoan Resolution open => fixed
2017-10-26 16:45 lassoan Note Added: 0015357
2017-10-26 16:47 lassoan Note Edited: 0015357 View Revisions