-
Notifications
You must be signed in to change notification settings - Fork 243
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
build: Use backup file in gen_release_info #4559
base: main
Are you sure you want to change the base?
Conversation
Using `sed -i` cross-platform is problematic as the `-i` flag does not behave the same on macOS and linux (see 5e561ad). The `sed` on macOS currently treat `-e` as a backup extension while on linux it's treated as a flag. This does not seem to make a difference, but it is very magic. This commit specifies a backup extension to `sed -i`, which works for me on macOS and linux. `-e` will be used as a flag on all platforms. Signed-off-by: Christophe Fergeau <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@rohanKanojia do check that on windows this all started #4530 with this. |
@cfergeau @praveenkumar : I performed quick run of I wasn't able to build using
With this change, I'm also seeing that backup files are getting generated again:
|
Is there any documentation about this behaviour/the sed version which is being used? I don't really understand these results (why |
@cfergeau: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
@cfergeau : Hello, I'm using GNU sed Could this be a problem related to underlying shell (PowerShell in my case) ?
|
https://stackoverflow.com/questions/7733922/sed-command-creates-randomly-named-files
|
@cfergeau : Thanks for sharing these links, the type of backup files I see being created do look similar to the ones shared in StackOverflow links.
Sorry I don't understand this clearly. Do you mean somehow arguments to sed command are not getting passed correctly? |
This is a copy and paste from stackoverflow, I am also not 100% sure what they mean. But since we are passing args as variables ( |
@rohanKanojia what if you use the git bash? It provides a unix-like env so if it works fine there we can think it is a problem with the powershell. Or you can check if the git bash/powershell use the same sed version and try it on the powershell as well to exclude it is a problem with your chocolatey sed tool |
@lstocchi : I tried on GitBash, running
Okay, let me try to use a different version of sed |
Using
sed -i
cross-platform is problematic as the-i
flag does notbehave the same on macOS and linux (see 5e561ad).
The
sed
on macOS currently treat-e
as a backup extension while onlinux it's treated as a flag. This does not seem to make a difference,
but it is very magic.
This commit specifies a backup extension to
sed -i
, which works for meon macOS and linux.
-e
will be used as a flag on all platforms.Type of change
test, version modification, documentation, etc.)
Testing
Contribution Checklist
Haven't tested on Windows, but this would be needed as this was initially changed because of windows issues.