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

Error finding stub app on macOS when formal name includes a . #2151

Open
freakboy3742 opened this issue Feb 9, 2025 · 1 comment
Open

Error finding stub app on macOS when formal name includes a . #2151

freakboy3742 opened this issue Feb 9, 2025 · 1 comment
Labels
bug A crash or error in behavior. good first issue Is this your first time contributing? This could be a good place to start! macOS The issue relates to Apple macOS support.

Comments

@freakboy3742
Copy link
Member

Describe the bug

If the formal name of an app contains a period, Briefcase will fail to build the app, as the unbuilt_executable_path will contain the "suffix" suggested by the period.

Steps to reproduce

  1. briefcase new --no-input -Q "formal_name=Hello 2.0"
  2. briefcase run
  3. See error:

Traceback (most recent call last):
  File "/Users/rkm/beeware/briefcase/venv3.13/bin/briefcase", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/rkm/beeware/briefcase/src/briefcase/__main__.py", line 27, in main
    command(**options)
    ~~~~~~~^^^^^^^^^^^
  File "/Users/rkm/beeware/briefcase/src/briefcase/commands/run.py", line 309, in __call__
    state = self.build_command(
        app,
    ...<7 lines>...
        **options,
    )
  File "/Users/rkm/beeware/briefcase/src/briefcase/commands/build.py", line 127, in __call__
    state = self._build_app(
        app,
    ...<7 lines>...
        **options,
    )
  File "/Users/rkm/beeware/briefcase/src/briefcase/commands/build.py", line 52, in _build_app
    state = self.create_command(app, test_mode=test_mode, **options)
  File "/Users/rkm/beeware/briefcase/src/briefcase/commands/create.py", line 984, in __call__
    state = self.create_app(app, **options)
  File "/Users/rkm/beeware/briefcase/src/briefcase/commands/create.py", line 938, in create_app
    self.install_stub_binary(app=app)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/rkm/beeware/briefcase/src/briefcase/commands/create.py", line 433, in install_stub_binary
    self.tools.os.chmod(unbuilt_executable_path, 0o755)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/Users/rkm/beeware/briefcase/local/tmp/hello20/build/hello20/macos/app/Hello 2.0.app/Contents/MacOS/Stub.0'
(

Expected behavior

App should build and run successfully.

Screenshots

No response

Environment

  • Operating System: macOS
  • Python version: any (tested on 3.13, 3.12)
  • Software versions:
    • Briefcase: 0.3.21+

Logs


Additional context

Originally reported by @rbrecheisen in this comment on #1729.

@freakboy3742 freakboy3742 added bug A crash or error in behavior. macOS The issue relates to Apple macOS support. good first issue Is this your first time contributing? This could be a good place to start! labels Feb 9, 2025
@freakboy3742
Copy link
Member Author

This is caused by the interaction of Windows and macOS executable handling. The evaluation of unbuilt_executable_path splits the suffix off the binary path so that it can create Stub.exe; but if you're on macOS, the same logic will strip .0 off the name Hello 2.0 as the "suffix".

We need to make the suffix handling platform specific, so that the .suffix handling is only performed on Windows.

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. good first issue Is this your first time contributing? This could be a good place to start! macOS The issue relates to Apple macOS support.
Projects
None yet
Development

No branches or pull requests

1 participant