Skip to content

dist seems to ignore environmnet variables configured in .cargo/config.toml #1571

@jan-ferdinand

Description

@jan-ferdinand

tl;dr: minimally failing example

Description

In a project I'm working on, we're using tokio's unstable features. Those features require opt-in through an environmnent variable. This environment variable can be set in the file .cargo/config.toml, which is what we do. Unfortunately, dist build seems to ignore this configuration. As a result, the compilation step during dist build fails.

What I've tried

  • Running RUSTFLAGS="--cfg tokio_unstable" dist build1 works fine.
  • I cannot find anything applicable to this situation in the dist book.
  • I was unable to identify similar issues here on github.

Questions

  1. Do you consider this a bug or missing feature, or am I miss- or even abusing dist?
  2. Is there a maintainable workaround? I feel uncomfortable monkey-patching the release.yml to jam this environment variable in there every time I run dist init.
  3. Do you need or want any additional information?

Footnotes

  1. as you might expect, RUSTFLAGS="--cfg tokio_unstable" is the environment variable configured in .cargo/config.toml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions