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

Linux system package builds hardcode the app version #1531

Open
Kuna42 opened this issue Nov 12, 2023 · 2 comments
Open

Linux system package builds hardcode the app version #1531

Kuna42 opened this issue Nov 12, 2023 · 2 comments
Labels
bug A crash or error in behavior. linux The issue relates Linux support.

Comments

@Kuna42
Copy link

Kuna42 commented Nov 12, 2023

Describe the bug

Briefcase raise an error when i am trying to build another binary.

The building process creates in the wrong directory the binary.

In my case it creates the actual binary in pr-0.0.3 instead of pr-0.0.4.

Steps to reproduce

  1. Make a new app
  2. Create the first build briefcase build
  3. Update 'pyproject.toml'.version (Any change of the version, e.g. "0.0.1" to "0.0.2")
  4. Try building briefcase build
  5. See error

Expected behavior

Expected:
A successful build of a debian package.

Detailed:
Binary in the right directory.

Screenshots

No response

Environment

  • Operating System: Linux, Ubuntu 22.04.3 LTS
  • Python version: 3.10.12
  • Software versions:
    • Briefcase: 0.3.16
    • Toga: 0.4.0
      also 0.3.1
    • ...

Logs

           [beeware_program] Building application...                                                                                                                   system.py:662
           Build bootstrap binary...                                                                                                                                   system.py:664
                                                                                                                                                                   subprocess.py:711
           >>> Running Command:                                                                                                                                    subprocess.py:712
           >>>     make -C bootstrap install                                                                                                                       subprocess.py:713
           >>> Working Directory:                                                                                                                                  subprocess.py:720
           >>>     /home/user/beeware_project/beeware_program/beeware_program/build/beeware_program/ubuntu/jammy                                                   subprocess.py:721
           make: Verzeichnis „/home/user/beeware_project/beeware_program/beeware_program/build/beeware_program/ubuntu/jammy/bootstrap“ wird                        subprocess.py:685
           betreten                                                                                                                                                                 
 ->        mkdir -p ../beeware_program-0.0.3/usr/bin                                                                                                               subprocess.py:685
           cp beeware_program ../beeware_program-0.0.3/usr/bin                                                                                                     subprocess.py:685
           make: Verzeichnis „/home/user/beeware_project/beeware_program/beeware_program/build/beeware_program/ubuntu/jammy/bootstrap“ wird                        subprocess.py:685
           verlassen                                                                                                                                                                
           >>> Return code: 0                                                                                                                                      subprocess.py:748
           Building bootstrap binary... done                                                                                                                           system.py:665
           Installing license... done                                                                                                                                  system.py:694
           Installing changelog... done                                                                                                                                system.py:708
           Installing man page... done                                                                                                                                 system.py:738
           Update file permissions...                                                                                                                                  system.py:752
           Updating file permissions on beeware_program-0.0.4/usr/share/doc/beeware_program/copyright from 664 to 644                                                  system.py:766
           Updating file permissions... done                                                                                                                           system.py:753
                                                                                                                                                                   subprocess.py:711
           >>> Running Command:                                                                                                                                    subprocess.py:712
           >>>     strip                                                                                                                                           subprocess.py:713
           /home/user/beeware_project/beeware_program/beeware_program/build/beeware_program/ubuntu/jammy/beeware_program-0.0.4/usr/bin/beeware_program                     
           >>> Working Directory:                                                                                                                                  subprocess.py:720
           >>>     /home/user/beeware_project/beeware_program/beeware_program                                                                                      subprocess.py:721
           >>> Command Output:                                                                                                                                     subprocess.py:737
           >>>     strip:                                                                                                                                          subprocess.py:739
           ‚/home/user/beeware_project/beeware_program/beeware_program/build/beeware_program/ubuntu/jammy/beeware_program-0.0.4/usr/bin/beeware_program‛:                  
           Keine solche Datei                                                                                                                                                       
           >>> Return code: 1                                                                                                                                      subprocess.py:748
           Stripping binary...                                                                                                                                         system.py:773

CalledProcessError: Command '['strip', '/home/user/beeware_project/beeware_program/beeware_program/build/beeware_program/ubuntu/jammy/beeware_program-0.0.4/usr/bin/beeware_program']' returned non-zero exit status 1.

Additional context

Work around:
Delete pr/build/pr/ubuntu/ folder, than try building.

@Kuna42 Kuna42 added the bug A crash or error in behavior. label Nov 12, 2023
@rmartin16 rmartin16 added the linux The issue relates Linux support. label Nov 12, 2023
@rmartin16 rmartin16 changed the title Error while building application Linux system package builds hardcode the app version Nov 12, 2023
@rmartin16
Copy link
Member

rmartin16 commented Nov 12, 2023

Thanks for reporting this. Briefcase uses beeware/briefcase-linux-system-template as the template for Linux System package builds. Currently, it hardcodes, for example in briefcase.toml, the version of the app in to the build the first time the app is built.

Therefore, changing the version later requires running briefcase create linux system to be able to build the app's latest version.

Such a dependency on an app's metadata should probably be removed from the Linux system template. Alternatively, this could be considered within the scope of #807 and create should be re-run automatically.

As an additional follow on....it may be worth more closely evaluating which pieces of data being fed in to templates is considered variant or invariant. For instance, I would consider the app's name invariant...while the version certainly is not. With such an evaluation, we could prevent other templating with variant metadata.

@mhsmith
Copy link
Member

mhsmith commented Nov 13, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. linux The issue relates Linux support.
Projects
None yet
Development

No branches or pull requests

3 participants