Skip to content

[hooks_runner] Add Rustup and Cargo environment variables to allowlist - #3545

Merged
dcharkes merged 1 commit into
dart-lang:mainfrom
adil192:feat/rust-vars
Aug 13, 2026
Merged

[hooks_runner] Add Rustup and Cargo environment variables to allowlist#3545
dcharkes merged 1 commit into
dart-lang:mainfrom
adil192:feat/rust-vars

Conversation

@adil192

@adil192 adil192 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Description

Rustup is Rust's official toolchain manager. Cargo is the Rust package manager.
Rustup and cargo use environment variables for a few things:

In particular, my builds are failing since CARGO_HOME is not in the allowlist.
Flatpak builds are done offline, so not being able to access the existing package cache results in a build failure.

This PR adds those environment variables into the whitelist.

Related Issues

TheAppgineer/flatpak-flutter#125

PR Checklist

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.

  • I've run dart tool/ci.dart --all locally and resolved all issues identified. This ensures the PR is formatted, has no lint errors, and ran all code generators. This applies to the packages part of the toplevel pubspec.yaml workspace.

    It threw an error for me but it seems unrelated.

    'stddef.h' file not found [Lexical or Preprocessor Issue]
    ahann@dellpro:~/Documents/GitHub/dart-native$ dart tool/ci.dart --all
    +dart pub get --directory .
    Resolving dependencies... 
    Downloading packages... 
      cli_util 0.4.2 (0.5.2 available)
    ! ffigen 22.0.0-wip from path pkgs/ffigen (overridden)
    Got dependencies!
    1 package has newer versions incompatible with dependency constraints.
    Try `dart pub outdated` for more information.
    +dart pub get --directory pkgs/hooks_runner/test_data/native_add_version_skew/
    Resolving dependencies in `pkgs/hooks_runner/test_data/native_add_version_skew/`... 
    Downloading packages... 
      cli_util 0.4.2 (0.5.2 available)
      ffigen 20.1.1 (21.0.0 available)
      native_assets_cli 0.15.0 (discontinued replaced by hooks)
      native_toolchain_c 0.12.0 (0.19.3 available)
      package_config 2.2.0 (3.0.0 available)
    Got dependencies in `pkgs/hooks_runner/test_data/native_add_version_skew/`!
    1 package is discontinued.
    5 packages have newer versions incompatible with dependency constraints.
    Try `dart pub outdated` for more information.
    +dart pub get --directory pkgs/hooks_runner/test_data/native_add_version_skew_2/
    Resolving dependencies in `pkgs/hooks_runner/test_data/native_add_version_skew_2/`... 
    Downloading packages... 
      cli_util 0.4.2 (0.5.2 available)
      ffigen 20.1.1 (21.0.0 available)
      native_assets_cli 0.6.1 (discontinued replaced by hooks)
      native_toolchain_c 0.5.0 (0.19.3 available)
      package_config 2.2.0 (3.0.0 available)
    Got dependencies in `pkgs/hooks_runner/test_data/native_add_version_skew_2/`!
    1 package is discontinued.
    5 packages have newer versions incompatible with dependency constraints.
    Try `dart pub outdated` for more information.
    +dart pkgs/code_assets/example/host_name/tool/ffigen.dart --set-exit-if-changed
    [INFO]   : Input Headers: [file:///home/ahann/Documents/GitHub/dart-native/pkgs/code_assets/example/host_name/src/unix.h]
    [SEVERE] : Header /home/ahann/Documents/GitHub/dart-native/pkgs/code_assets/example/host_name/src/unix.h: Total errors/warnings: 1.
    [SEVERE] :     /usr/include/unistd.h:226:10: fatal error: 'stddef.h' file not found [Lexical or Preprocessor Issue]
    [WARNING]: The compiler found warnings/errors in source files.
    [WARNING]: This will likely generate invalid bindings.
    [SEVERE] : Skipped generating bindings due to errors in source files. See https://github.com/dart-lang/native/blob/main/pkgs/ffigen/doc/errors.md.
    Unhandled exception:
    HeaderParserException: Skipped generating bindings due to errors in source files.
    #0      parseToBindings (package:ffigen/src/header_parser/parser.dart:141:9)
    #1      parse (package:ffigen/src/header_parser/parser.dart:46:31)
    #2      FfiGenGenerator.generate (package:ffigen/src/ffigen.dart:27:21)
    #3      FfiGenerator.generate (package:ffigen/src/config_provider/config.dart:131:7)
    #4      main (file:///home/ahann/Documents/GitHub/dart-native/pkgs/code_assets/example/host_name/tool/ffigen.dart:54:13)
    #5      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:313:19)
    #6      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
    +dart pkgs/code_assets/example/host_name/tool/ffigen.dart --set-exit-if-changed failed with exitCode 255.
    

    Ignoring that, I've separately made sure that dart format / dart analyze don't show anything.
    dart test fails several tests on my system with this error: /usr/bin/ccache: invalid option -- 'f'. Regardless, the test I added here passes.

  • All existing and new tests are passing. I added new tests to check the change I am making.

  • The PR is actually solving the issue. PRs that don't solve the issue will be closed. Please be respectful of the maintainers' time. If it's not clear what the issue is, feel free to ask questions on the GitHub issue before submitting a PR.

  • I have updated CHANGELOG.md for the relevant packages. (Not needed for small changes such as doc typos).

  • I have updated the pubspec package version if necessary.

@dcharkes
dcharkes merged commit 52e7c54 into dart-lang:main Aug 13, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants