Skip to contentSkip to conversation

k3s: do not use a go file as patch

PATCH In review Adrian Freihofer 2 participants 5 messages Apr 8, 2022 – Apr 11, 2022 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 k3s: do not use a go file as patch

Compiling k3s failed with:
do_patch: Importing patch 'github.com.andreyvit.diff' with striplevel '1'

The problem is that github.com/andreyvit/diff ends up as github.com.andreyvit.diff in the download folder which than matches the test in patch.py.

Not sure how you create this huge SRC_URI list. Probably it would be the best to add the apply=no to all urls.

---
 recipes-containers/k3s/k3s_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/k3s/k3s_git.bb +1 -1
index e2a3ffc..53a8677 100644
@@ -219,7 +219,7 @@ SRC_URI += "git://github.com/alexflint/go-filemutex;name=go-filemutex;protocol=h
 # github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
 # [1] git ls-remote https://github.com/andreyvit/diff c7f18ee00883bfd3b00e0a2bf7607827e0148ad4 
 SRCREV_diff="c7f18ee00883bfd3b00e0a2bf7607827e0148ad4"
-SRC_URI += "git://github.com/andreyvit/diff;name=diff;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/andreyvit/diff"
+SRC_URI += "git://github.com/andreyvit/diff;name=diff;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/andreyvit/diff;apply=no"
 
 # github.com/andybalholm/cascadia v1.0.0
 # [1] git ls-remote https://github.com/andybalholm/cascadia 901648c87902174f774fac311d7f176f8647bdaa 
Signature · 1 line
2.35.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 13 lines · Bruce Ashfield via lists.yoctoproject.org
Quoted 8 lines · Adrian Freihofer

Compiling k3s failed with:
do_patch: Importing patch 'github.com.andreyvit.diff' with striplevel '1'

The problem is that github.com/andreyvit/diff ends up as github.com.andreyvit.diff
in the download folder which than matches the test in patch.py.

Quoted 6 lines

I've built this K3S hundreds of times, and have never seen this, so I won't apply this until I figure out what is the difference between your environment and mine.

Can you share more details about your build environment, etc.

I am seeing a different fetch issue on a new/fresh machine I brought up this morning, using the -tip of master for all layers. My cached downloads were keeping it working on my other machines.

I'll get past that issue and see if I get the patch issue.

Cheers,

Bruce

Quoted 67 lines
Quoted 7 lines

Not sure how you create this huge SRC_URI list. Probably it would be the best to add the apply=no to all urls.

Eh, no. I'm not going to append that to all the URIs just because of one outlier that matched.

Bruce

Quoted 25 lines
---
 recipes-containers/k3s/k3s_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/k3s/ renamed from recipes-containers/k3s/k3s_git.bb +0 -0

k3s_git.bb
index e2a3ffc..53a8677 100644

recipes-containers/k3s/k3s_git.bb +0 -0
@@ -219,7 +219,7 @@ SRC_URI += "git://

github.com/alexflint/go-filemutex;name=go-filemutex;protocol=h

 # github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
 # [1] git ls-remote https://github.com/andreyvit/diff
c7f18ee00883bfd3b00e0a2bf7607827e0148ad4
 SRCREV_diff="c7f18ee00883bfd3b00e0a2bf7607827e0148ad4"
-SRC_URI += "git://
github.com/andreyvit/diff;name=diff;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/andreyvit/diff
<http://github.com/andreyvit/diff;name=diff;protocol=https;nobranch=1;destsuffix=$%7BWORKDIR%7D/$%7BBP%7D/src/import/vendor.fetch/github.com/andreyvit/diff>
"
+SRC_URI += "git://
github.com/andreyvit/diff;name=diff;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/andreyvit/diff;apply=no
<http://github.com/andreyvit/diff;name=diff;protocol=https;nobranch=1;destsuffix=$%7BWORKDIR%7D/$%7BBP%7D/src/import/vendor.fetch/github.com/andreyvit/diff;apply=no>
"
Quoted 10 lines
 # github.com/andybalholm/cascadia v1.0.0
 # [1] git ls-remote https://github.com/andybalholm/cascadia
901648c87902174f774fac311d7f176f8647bdaa
--
2.35.1

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#7135):
https://lists.yoctoproject.org/g/meta-virtualization/message/7135
Mute This Topic: https://lists.yoctoproject.org/mt/90334188/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 22 lines · Adrian Freihofer

Hi Bruce

Build with empty download folder works:
bitbake k3s -c cleanall
(cd downloads; find -name \*andreyvit\* -delete ) bitbake k3s

My download folder looks like that after building K3S downloads]$ find -name \*andreyvit\* ./git2/github.com.andreyvit.diff ./git2/github.com.andreyvit.diff.done ./gitshallow_github.com.andreyvit.diff_c7f18ee-1.tar.gz ./gitshallow_github.com.andreyvit.diff_c7f18ee-1.tar.gz.done

This does not work:
bitbake k3s -c cleanall

downloads]$ find -name \*andreyvit\* ./gitshallow_github.com.andreyvit.diff_c7f18ee-1.tar.gz ./gitshallow_github.com.andreyvit.diff_c7f18ee-1.tar.gz.done

Quoted 8 lines

bitbake k3s
ERROR: k3s-v1.22.6+k3s1+git4262c6b91a43ef8411870f72ff8b8715949f90e2- r0 do_patch: Importing patch 'github.com.andreyvit.diff' with striplevel '1' FileNotFoundError(2, 'No such file or directory')

Conclusion: After bitbake k3s -c cleanall the error occurs.

I'll see if I see the same behaviour, as i've done a LOT of cleanalls as I battled the uprev of k3s, and didn't see that. But it could have been hidden in a fail -> restart cycle as things moved past the issue.

Quoted 3 lines

I also spent some time to analyze what the function "patch_path" in patch.py does: It matches ".diff" against "github.com.andreyvit.diff".

Indeed, I suppose something could be done to allow that repo to have that name, and not be picked up as a patch, but it isn't a common problem, so the complexity wouldn't really be worth it.

Once i've reproduced the issue, i'll test with your patch, as it is the simplest way to avoid the problem.

Bruce

Quoted 118 lines

Regards,
Adrian

Quoted 110 lines · Bruce Ashfield
Quoted 15 lines · Bruce Ashfield via lists.yoctoproject.org
Quoted 9 lines · Adrian Freihofer

Compiling k3s failed with:
do_patch: Importing patch 'github.com.andreyvit.diff' with striplevel '1'

The problem is that github.com/andreyvit/diff ends up as github.com.andreyvit.diff
in the download folder which than matches the test in patch.py.

Quoted 6 lines

I've built this K3S hundreds of times, and have never seen this, so I won't apply this until I figure out what is the difference between your environment and mine.

Can you share more details about your build environment, etc.

I am seeing a different fetch issue on a new/fresh machine I brought up this morning, using the -tip of master for all layers. My cached downloads were keeping it working on my other machines.

I'll get past that issue and see if I get the patch issue.

Cheers,

Bruce

Quoted 68 lines
Quoted 7 lines

Not sure how you create this huge SRC_URI list. Probably it would be the
best to add the apply=no to all urls.

Eh, no. I'm not going to append that to all the URIs just because of one outlier that matched.

Bruce

Quoted 25 lines
---
 recipes-containers/k3s/k3s_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes- renamed from recipes-containers/k3s/k3s_git.bb +0 -0

containers/k3s/k3s_git.bb
index e2a3ffc..53a8677 100644

recipes-containers/k3s/k3s_git.bb +0 -0
@@ -219,7 +219,7 @@ SRC_URI += "git://github.com/alexflint/go-

filemutex;name=go-filemutex;protocol=h

 # github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
 # [1] git ls-remote https://github.com/andreyvit/diff
c7f18ee00883bfd3b00e0a2bf7607827e0148ad4
 SRCREV_diff="c7f18ee00883bfd3b00e0a2bf7607827e0148ad4"
-SRC_URI +=
"git://github.com/andreyvit/diff;name=diff;protocol=https;nobranc
h=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.co
m/andreyvit/diff"
+SRC_URI +=
"git://github.com/andreyvit/diff;name=diff;protocol=https;nobranc
h=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.co
m/andreyvit/diff;apply=no"
Quoted 9 lines
 # github.com/andybalholm/cascadia v1.0.0
 # [1] git ls-remote https://github.com/andybalholm/cascadia
901648c87902174f774fac311d7f176f8647bdaa
--
2.35.1

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#7135):
https://lists.yoctoproject.org/g/meta-virtualization/message/7135
Mute This Topic: https://lists.yoctoproject.org/mt/90334188/1050810
Group Owner: [email protected] Unsubscribe:
https://lists.yoctoproject.org/g/meta-virtualization/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 32 lines · Bruce Ashfield via lists.yoctoproject.org
Quoted 27 lines · Adrian Freihofer

Hi Bruce

Build with empty download folder works:
bitbake k3s -c cleanall
(cd downloads; find -name \*andreyvit\* -delete ) bitbake k3s

My download folder looks like that after building K3S downloads]$ find -name \*andreyvit\* ./git2/github.com.andreyvit.diff ./git2/github.com.andreyvit.diff.done ./gitshallow_github.com.andreyvit.diff_c7f18ee-1.tar.gz ./gitshallow_github.com.andreyvit.diff_c7f18ee-1.tar.gz.done

This does not work:
bitbake k3s -c cleanall

downloads]$ find -name \*andreyvit\* ./gitshallow_github.com.andreyvit.diff_c7f18ee-1.tar.gz ./gitshallow_github.com.andreyvit.diff_c7f18ee-1.tar.gz.done

bitbake k3s
ERROR: k3s-v1.22.6+k3s1+git4262c6b91a43ef8411870f72ff8b8715949f90e2- r0 do_patch: Importing patch 'github.com.andreyvit.diff' with striplevel '1' FileNotFoundError(2, 'No such file or directory')

Quoted 7 lines
Quoted 3 lines

Conclusion: After bitbake k3s -c cleanall the error occurs.

I'll see if I see the same behaviour, as i've done a LOT of cleanalls as I battled the uprev of k3s, and didn't see that. But it could have been hidden in a fail -> restart cycle as things moved past the issue.

I've done multiple executions of that exact set of steps, and I've never seen the error you are encountering. Clearly there's something different in the various build environments.

We are also getting reports of k3s working in other CI setups and runtime success, so it also isn't happening everywhere.

That being said, the patch is simple enough, and as long as it doesn't break my tests (re-running with it queued now), I'll merge it and just keep an eye out for other similar behaviour popping up.

Bruce

Quoted 144 lines
Quoted 5 lines

I also spent some time to analyze what the function "patch_path" in patch.py does: It matches ".diff" against "github.com.andreyvit.diff".

Indeed, I suppose something could be done to allow that repo to have that name, and not be picked up as a patch, but it isn't a common problem, so the complexity wouldn't really be worth it.

Once i've reproduced the issue, i'll test with your patch, as it is the simplest way to avoid the problem.

Bruce

Quoted 109 lines

Regards,
Adrian

Quoted 101 lines · Bruce Ashfield
Quoted 15 lines · Bruce Ashfield via lists.yoctoproject.org
Quoted 9 lines · Adrian Freihofer

Compiling k3s failed with:
do_patch: Importing patch 'github.com.andreyvit.diff' with striplevel '1'

The problem is that github.com/andreyvit/diff ends up as github.com.andreyvit.diff
in the download folder which than matches the test in patch.py.

Quoted 6 lines

I've built this K3S hundreds of times, and have never seen this, so I won't apply this until I figure out what is the difference between your environment and mine.

Can you share more details about your build environment, etc.

I am seeing a different fetch issue on a new/fresh machine I brought up this morning, using the -tip of master for all layers. My cached downloads were keeping it working on my other machines.

I'll get past that issue and see if I get the patch issue.

Cheers,

Bruce

Quoted 59 lines
Quoted 7 lines

Not sure how you create this huge SRC_URI list. Probably it would be the
best to add the apply=no to all urls.

Eh, no. I'm not going to append that to all the URIs just because of one outlier that matched.

Bruce

Quoted 25 lines
---
 recipes-containers/k3s/k3s_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes- renamed from recipes-containers/k3s/k3s_git.bb +0 -0

containers/k3s/k3s_git.bb
index e2a3ffc..53a8677 100644

recipes-containers/k3s/k3s_git.bb +0 -0
@@ -219,7 +219,7 @@ SRC_URI += "git://github.com/alexflint/go-

filemutex;name=go-filemutex;protocol=h

 # github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
 # [1] git ls-remote https://github.com/andreyvit/diff
c7f18ee00883bfd3b00e0a2bf7607827e0148ad4
 SRCREV_diff="c7f18ee00883bfd3b00e0a2bf7607827e0148ad4"
-SRC_URI +=
"git://github.com/andreyvit/diff;name=diff;protocol=https;nobranc
h=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.co
m/andreyvit/diff"
+SRC_URI +=
"git://github.com/andreyvit/diff;name=diff;protocol=https;nobranc
h=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.co
m/andreyvit/diff;apply=no"
Quoted 9 lines
 # github.com/andybalholm/cascadia v1.0.0
 # [1] git ls-remote https://github.com/andybalholm/cascadia
901648c87902174f774fac311d7f176f8647bdaa
--
2.35.1

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#7141):
https://lists.yoctoproject.org/g/meta-virtualization/message/7141
Mute This Topic: https://lists.yoctoproject.org/mt/90334188/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II
#7 lore raw
In reply to Adrian Freihofer
Quoted 8 lines · Adrian Freihofer

Compiling k3s failed with:
do_patch: Importing patch 'github.com.andreyvit.diff' with striplevel '1'

The problem is that github.com/andreyvit/diff ends up as github.com.andreyvit.diff
in the download folder which than matches the test in patch.py.

I've built this K3S hundreds of times, and have never seen this, so I won't apply this until I figure out what is the difference between your environment and mine.

Can you share more details about your build environment, etc.

Quoted 4 lines

Not sure how you create this huge SRC_URI list. Probably it would be the best to add the apply=no to all urls.

Eh, no. I'm not going to append that to all the URIs just because of one outlier that matched.

Bruce

Quoted 43 lines
---
 recipes-containers/k3s/k3s_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/k3s/ renamed from recipes-containers/k3s/k3s_git.bb +0 -0

k3s_git.bb
index e2a3ffc..53a8677 100644

recipes-containers/k3s/k3s_git.bb +0 -0
@@ -219,7 +219,7 @@ SRC_URI += "git://

github.com/alexflint/go-filemutex;name=go-filemutex;protocol=h

 # github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
 # [1] git ls-remote https://github.com/andreyvit/diff
c7f18ee00883bfd3b00e0a2bf7607827e0148ad4
 SRCREV_diff="c7f18ee00883bfd3b00e0a2bf7607827e0148ad4"
-SRC_URI += "git://
github.com/andreyvit/diff;name=diff;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/andreyvit/diff
<http://github.com/andreyvit/diff;name=diff;protocol=https;nobranch=1;destsuffix=$%7BWORKDIR%7D/$%7BBP%7D/src/import/vendor.fetch/github.com/andreyvit/diff>
"
+SRC_URI += "git://
github.com/andreyvit/diff;name=diff;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/andreyvit/diff;apply=no
<http://github.com/andreyvit/diff;name=diff;protocol=https;nobranch=1;destsuffix=$%7BWORKDIR%7D/$%7BBP%7D/src/import/vendor.fetch/github.com/andreyvit/diff;apply=no>
"
 # github.com/andybalholm/cascadia v1.0.0
 # [1] git ls-remote https://github.com/andybalholm/cascadia
901648c87902174f774fac311d7f176f8647bdaa
--
2.35.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#7134):
https://lists.yoctoproject.org/g/meta-virtualization/message/7134
Mute This Topic: https://lists.yoctoproject.org/mt/90334188/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II