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

[bug] sidecar: No such file or directory (os error 2) #4780

Closed
trevorparscal opened this issue Jul 27, 2022 · 5 comments
Closed

[bug] sidecar: No such file or directory (os error 2) #4780

trevorparscal opened this issue Jul 27, 2022 · 5 comments
Labels
status: in progress Implementation is proceeding smoothly type: bug

Comments

@trevorparscal
Copy link

trevorparscal commented Jul 27, 2022

Describe the bug

Appears to be similar to issue #3612.

Works in build, but not in dev.

Moving app-* (app-aarch64-apple-darwin in this case) to the src-tauri directory and changing "bin/app" to "app" did not work.

Reproduction

  1. Add a sidecar app

Relevant sections of my tauri.conf.json

{
    "tauri": {
        "allowlist": {
            "shell": {
                "sidecar": true,
                "scope": [
                    {
                        "name": "bin/app",
                        "sidecar": true
                    }
                ]
            },
            ...
        },
        "bundle": {
            "externalBin": [
                "bin/app"
            ],
            ...
        }
        ...
    }
}

And of the JavaScript...

const command = Command.sidecar( 'bin/app' );
console.log( await command.execute() );
  1. Use tauri dev
  2. See "No such file or directory (os error 2)" error in console when running command
  3. See that it works with tauri build

Expected behavior

Dev and build should behave the same.

Platform and versions

macOS 12.4 (21F79), M1 chip

tauri = { version = "1.0.5", features = ["api-all"] }

tauri-build = { version = "1.0.4", features = [] }

Stack trace

No response

Additional context

The example sidecar app only has one line, logging a string to the console.

@trevorparscal trevorparscal added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jul 27, 2022
@trevorparscal
Copy link
Author

I solved this by changing the name of the sidecar to something other than app, something I discovered as a possible fix by finding 3663 was resolved this way as well.

However, even though the documentation uses an example of "my_sidecar", the example uses "app", which is how I found my way down this path.

Maybe there could be some sort of error message forbidding this, or some fix to ensure tauri isn't confused by it?

@trevorparscal
Copy link
Author

Perhaps I should leave this open, assuming this is a bug in tauri.

@trevorparscal trevorparscal reopened this Jul 28, 2022
@FabianLars
Copy link
Member

i thought that this is a known limitation, in which case we'd need to change the example, but maybe it indeed is just a bug 🤔

@lucasfernog
Copy link
Member

Happens because the CLI renames the app executable (from Cargo.toml to the product name defined in the config file), so you lose the sidecar binary in that process. I'll add a validation for it.

@lucasfernog lucasfernog added status: in progress Implementation is proceeding smoothly and removed status: needs triage This issue needs to triage, applied to new issues labels Aug 1, 2022
@HerrHansen
Copy link

i thought that this is a known limitation, in which case we'd need to change the example, but maybe it indeed is just a bug 🤔

+1 For changing the example. Spent hours until I found my way to this thread 🙃.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in progress Implementation is proceeding smoothly type: bug
Projects
None yet
Development

No branches or pull requests

4 participants