Coder Social home page Coder Social logo

Comments (7)

mdsteele avatar mdsteele commented on June 2, 2024

Hmm, odd. That does seem like it should work, it it's not clear to me what's causing the error. (Clearly, cargo-bundle's error reporting could use some work; I'll look into that.)

Does your project happen to be available somewhere publicly where I could try bundling it to try to diagnose?

from cargo-bundle.

mdsteele avatar mdsteele commented on June 2, 2024

Alternatively, I believe that if you run cargo-bundle with the environment variable RUST_BACKTRACE=1 set, you should get a backtrace with the error; if you could post that backtrace here, that would be great.

from cargo-bundle.

andrewdavidmackenzie avatar andrewdavidmackenzie commented on June 2, 2024

Here's the backtrace (not so useful I think):

Error: the source path is not an existing regular file
stack backtrace:
0: 0x10c059e6e - backtrace::backtrace::trace::hc8f67935cd0b5b66
1: 0x10c059eac - backtrace::capture::Backtrace::new::h18c3b3b79d22977f
2: 0x10c0594b6 - error_chain::make_backtrace::hdcc4f1aacd973613
3: 0x10c059598 - _$LT$error_chain..State$u20$as$u20$core..default..Default$GT$::default::hda5dc645b6627964
4: 0x10bfce18b - cargo_bundle::bundle::osx_bundle::bundle_project::h0122419e7e2c7dac
5: 0x10bfd9454 - cargo_bundle::main::he1838a35c736bdb0
6: 0x10c1501bc - __rust_maybe_catch_panic
7: 0x10c143c68 - std::rt::lang_start::h7919b8561d5d8bb1

I'll try to reproduce with a simpler case than my project, and if I can't then I'll get back to you to reproduce it using mine.

from cargo-bundle.

andrewdavidmackenzie avatar andrewdavidmackenzie commented on June 2, 2024

In fact, I decided to just push by (broken) project, so you can clone and attempt to bundle it:

https://github.com/andrewdavidmackenzie/flow/

I just realized that the folder/sub-project I am trying to bundle is part of a cargo workspace (see Cargo.toml file in root directory) and maybe that is the source of the problem, as the binary (flowc) is compiled into the target folder under the root (flow) folder - and probably not found by cargo-bundler... I noticed in the code that the binary path is built from the folder plus the name of the package in Cargo.toml.
If that is confirmed, then maybe I can help you make it "workspace aware"...

To reproduce:

  • cd flowc
  • cargo bundle

After downloading and compiling everything, that should give you this output:

Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Bundling flowc.app
Error: the source path is not an existing regular file

leave you with this content:

tree target/
target/
`-- debug
    `-- flowc.app
        `-- Contents
            |-- Info.plist
            |-- MacOS             <--- No binary in here
            `-- Resources
                |-- flowc.icns
                `-- lib
                    `-- test.toml

from cargo-bundle.

mdsteele avatar mdsteele commented on June 2, 2024

Ah, okay, that's the problem then; cargo-bundle currently has no understanding of workspaces.

The place to address that would be in src/bundle/settings.rs. When we parse the project's Cargo.toml, we need to also check for workspaces to determine the correct value for target_dir.

from cargo-bundle.

andrewdavidmackenzie avatar andrewdavidmackenzie commented on June 2, 2024

from cargo-bundle.

andrewdavidmackenzie avatar andrewdavidmackenzie commented on June 2, 2024

BTW: Just to confirm, that via a quick code-hack to make cargo-bundle use the path of the parent Cargo.toml in the workspace I was able to make it package the app OK. Hence, working on #42

from cargo-bundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.