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

How can I modify the environment variables which built from other env variables? #520

Closed
umaYnit opened this issue Mar 2, 2021 · 4 comments
Assignees
Milestone

Comments

@umaYnit
Copy link

umaYnit commented Mar 2, 2021

This is My makefile.toml:

[config]
skip_core_tasks = true

[env]
MODE = { value = "release", condition = { env_not_set = ["MODE"] } }
KERNEL_ELF = "target/${MODE}/kernel.bin"

[tasks.print]
script_runner = "@duckscript"
script = '''
echo ${MODE}
echo ${KERNEL_ELF}
'''

[tasks.debug]
command = "cargo"
args = ["make", "print", "--env", "MODE=debug"]
@sagiegurari
Copy link
Owner

not sure what is the question here, your makefile seems to work well:

~/ $ cargo make print
[cargo-make] INFO - cargo make 0.32.12
[cargo-make] INFO - Build File: Makefile.toml
[cargo-make] INFO - Task: print
[cargo-make] INFO - Profile: development
[cargo-make] INFO - Running Task: print
release 
target/release/kernel.bin 
[cargo-make] INFO - Build Done in 0.00 seconds.
~/ $ cargo make debug
[cargo-make] INFO - cargo make 0.32.12
[cargo-make] INFO - Build File: Makefile.toml
[cargo-make] INFO - Task: debug
[cargo-make] INFO - Profile: development
[cargo-make] INFO - Execute Command: "cargo" "make" "print" "--env" "MODE=debug"
[cargo-make][1] INFO - Build File: Makefile.toml
[cargo-make][1] INFO - Task: print
[cargo-make][1] INFO - Profile: development
[cargo-make][1] INFO - Running Task: print
debug 
target/release/kernel.bin 
[cargo-make][1] INFO - Build Done in 0.00 seconds.
[cargo-make] INFO - Build Done in 0.56 seconds.

@umaYnit
Copy link
Author

umaYnit commented Mar 2, 2021

I expect that when the variable MODE is debug, the variable KERNEL_ELF can be "target/debug/kernel.bin"

@sagiegurari
Copy link
Owner

@umaYnit this should now be resolved in dev branch 0.32.13

@umaYnit
Copy link
Author

umaYnit commented Mar 5, 2021

Yes, it's ok, I can test code conveniently and happily again. thanks~ 😆

@umaYnit umaYnit closed this as completed Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants