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

Submitted build script is changed in COPR #3252

Closed
majamassarini opened this issue May 10, 2024 · 3 comments · Fixed by #3276
Closed

Submitted build script is changed in COPR #3252

majamassarini opened this issue May 10, 2024 · 3 comments · Fixed by #3276
Assignees

Comments

@majamassarini
Copy link
Contributor

When using the Rebuild button in the Packages view sometimes the COPR build script differs from the submitted one.


When Packit submits this build script the resulting COPR build script is broken:

                 'script': '\n'
                           '#!/bin/sh\n'
                           '\n'
                           'git config --global user.email "[email protected]"\n'
                           'git config --global user.name "Packit"\n'
                           'resultdir=$PWD\n'
                           'packit -d prepare-sources --result-dir "$resultdir" --ref main --job-config-index 4 '
                           "--merged-ref 'c5b1ea8e8ce3298620dad92831c0f53161e98966' --no-create-symlinks "
                           'https://github.com/packit/packit\n'
                           '\n'},

The resulting COPR build script is broken because it does not contain --merged-ref 'c5b1ea8e8ce3298620dad92831c0f53161e98966' --no-create-symlinks :

#!/bin/sh

git config --global user.email "[email protected]"
git config --global user.name "Packit"
resultdir=$PWD
packit -d prepare-sources --result-dir "$resultdir" --ref main --job-config-index 4 https://github.com/packit/packit

When Packit submits this build script everything is OK:

                 'script': '\n'
                           '#!/bin/sh\n'
                           '\n'
                           'git config --global user.email "[email protected]"\n'
                           'git config --global user.name "Packit"\n'
                           'resultdir=$PWD\n'
                           'packit -d prepare-sources --result-dir "$resultdir" --pr-id 2304 --merge-pr '
                           "--target-branch main --job-config-index 2 --merged-ref 'main' --no-create-symlinks "
                           'https://github.com/packit/packit\n'
                           '\n'},

The COPR rebuild script is fine and contains all the needed lines:

#!/bin/sh

git config --global user.email "[email protected]"
git config --global user.name "Packit"
resultdir=$PWD
packit -d prepare-sources --result-dir "$resultdir" --pr-id 2304 --merge-pr --target-branch main --job-config-index 2 --merged-ref 'main' --no-create-symlinks https://github.com/packit/packit

We think there could be something on the COPR side preventing the above script to be parsed correctly.

@github-project-automation github-project-automation bot moved this to Needs triage in CPT Kanban May 10, 2024
@praiskup praiskup self-assigned this May 10, 2024
@praiskup
Copy link
Member

I tried to reproduce with /usr/bin/copr-rpmbuild --verbose --drop-resultdir --srpm --task-url https://copr.fedorainfracloud.org/backend/get-srpm-build-task/7426563

And the script is instantiated as:

$ cat /var/lib/copr-rpmbuild/workspace/workdir-nw0e8qmj/script

#!/bin/sh

git config --global user.email "[email protected]"
git config --global user.name "Packit"
resultdir=$PWD
packit -d prepare-sources --result-dir "$resultdir" --ref main --job-config-index 4 --merged-ref 'c5b1ea8e8ce3298620dad92831c0f53161e98966' --no-create-symlinks https://github.com/packit/packit

The shebang seems broken, but the --merged-ref seems to be there. How have you detected it is missing?

@majamassarini
Copy link
Contributor Author

We analyzed the problem with @praiskup and the problem is on the Packit side. Opened an issue in Packit: packit/packit#2312

@praiskup
Copy link
Member

Thank you for the report anyway. I've opened #3276 to mention that the very first build defines the package's default source method.

praiskup added a commit to praiskup/copr that referenced this issue May 21, 2024
FrostyX pushed a commit that referenced this issue May 21, 2024
@praiskup praiskup moved this from Needs triage to In Progress in CPT Kanban May 21, 2024
@praiskup praiskup self-assigned this May 21, 2024
@FrostyX FrostyX moved this from In Progress to Done in CPT Kanban May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants