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

Does not work in --release builds (anymore?) #25

Open
kungfoo opened this issue Feb 9, 2022 · 2 comments
Open

Does not work in --release builds (anymore?) #25

kungfoo opened this issue Feb 9, 2022 · 2 comments

Comments

@kungfoo
Copy link

kungfoo commented Feb 9, 2022

Running cargo run --release --bin job-runner I get the following error:

Job 36 failed to run: Unknown job type scale_image

Running the debug binary, everything works as expected and the job method is executed. Am I holding this wrong?

jobs::images] scale_image: from: file:///var/swirl-sample/images/c73f6708-5942-4eab-844c-dd00eaa4ff51.jpeg, to: file:///var/swirl-sample/images/scaled/c73f6708-5942-4eab-844c-dd00eaa4ff51.jpeg, dimension: Dimension { width: 400, height: 1200 }

Environment

  • rustc 1.56.1 (59eed8a2a 2021-11-01)
  • cargo 1.56.0 (4ed5d137b 2021-10-04)
  • swirl = { git = "https://github.com/sgrif/swirl.git", branch = "master" }
@kungfoo
Copy link
Author

kungfoo commented Feb 10, 2022

I have tried to create a minimal reproduction case here: https://github.com/kungfoo/swirl-issue-25
Alas, this version (of course) works as expected for now.

What is different about my actual application, is that the code is split into seperate modules and the jobs are submitted by a rocket application via a REST interface, but the job runner sits in the same place as in this one:

jobs
├── Cargo.toml
└── src
    ├── bin
    │   └── job-runner.rs
    ├── images.rs
    └── lib.rs

There is a top-level workspace Cargo.toml one level above, that pulls all the modules together.
I'll try to adjust the repro repo accordingly.

@kungfoo
Copy link
Author

kungfoo commented Feb 10, 2022

The not-working branch now contains code that mirrors the module layout of the problematic code base: https://github.com/kungfoo/swirl-issue-25/tree/not-working

On this branch, the unexpected behaviour can be observed in a reproducible manner by running cargo run --release --bin job-runner

It appears that splitting the code into two separate modules somehow breaks it in release builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant