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

Fix output directory for globs #129

Merged

Conversation

AnthonyGrondin
Copy link
Contributor

This is a partial fix for #127.

Previously, user specified globs were placed in the root directory of dummy C project, rather than in the created folder.

Partial fix

This is a partial fix, because the glob works with wildcards like certs/*, but doesn't work with wildcards like certs*, the crate globwalk used for finding files doesn't return the right list of files when using certs*.
We have two choices:

  1. Edit the README.md to change mentions of foo* and bar* to foor/* and bar/*
  2. Fix the way embuild, the crate used for copying files, finds files.
    https://github.com/esp-rs/embuild/blob/5e12da302f372c05d20a149b00eca1befde185f6/src/build.rs#L95-L114

Example

ESP_IDF_GLOB_CRT_BASE = { value = ".", relative = true}
ESP_IDF_GLOB_CRT_CERT = "certs/certificate.pem"
.
├── Cargo.lock
├── Cargo.toml
├── certs/
     └── certificate.pem
├── README.md
├── rust-toolchain.toml
├── sdkconfig.defaults
└── src
     └── main.rs

This will put the file certificate.pem in the directory certs at the root of the dummy C project

.
├── bindings.rs
├── build
│   └── ...
├── certs
│   └── certificate.pem
├── CMakeLists.txt
├── esp-idf-build.json
├── gen-sdkconfig.defaults
├── main.c
└── sdkconfig

@N3xed
Copy link
Collaborator

N3xed commented Sep 2, 2022

Thanks for the (partial) fix!

@N3xed N3xed merged commit b21305f into esp-rs:master Sep 2, 2022
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

Successfully merging this pull request may close these issues.

2 participants