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

[feat] cargo profile support #6255

Closed
flapili opened this issue Feb 13, 2023 · 8 comments
Closed

[feat] cargo profile support #6255

flapili opened this issue Feb 13, 2023 · 8 comments

Comments

@flapili
Copy link

flapili commented Feb 13, 2023

Describe the problem

when we have multiples build variant like dev/stagging/production/beta/alpha/etc... the debug flag is not enough

Describe the solution you'd like

add an option to the cli like tauri build --profile foobar

Alternatives considered

No response

Additional context

for now I have to use a custom py script which take a kind of profile, build tauri via subprocess.run then go to /targets/<triples-target>/release(or debug)/bundle/msi/name-version-arch.zip to a folder according to the given profile.

@amrbashir
Copy link
Member

try tauri build -- --profile foobar

@amrbashir
Copy link
Member

Looks like it will conflict with the --release that we pass internally, gonna open a PR to fix it

@bukowa
Copy link

bukowa commented Jun 26, 2024

Any chance to get it in v1?

@amrbashir
Copy link
Member

this is already fixed in v1 as well

@bukowa
Copy link

bukowa commented Jun 26, 2024

this is already fixed in v1 as well

Right it just needs the --debug flag to work. Also it has other problems;

[profile.testing]
inherits = "dev"
# after removing target dir
$ tauri -- build --debug -- --profile=testing

Finished `testing` profile [unoptimized + debuginfo] target(s) in 49.67s                         
   Error failed to rename `C:\Users\buk\WebstormProjects\ck3oop\target\debug\ck3oop-ui-rs.exe` to
`C:\Users\buk\WebstormProjects\ck3oop\target\debug\ck3oop-ui.exe`: The system cannot find the path specified. (os error 3)

Looks like tauri wants to rename something post building but with different profile it just can't?

[package]
name = "ck3oop-ui-rs"
  "package": {
    "productName": "ck3oop-ui",
  },

@amrbashir
Copy link
Member

this is already fixed in v1 as well

Right it just needs the --debug flag to work. Also it has other problems;

It doesn't need --debug, it should work without it

[profile.testing]
inherits = "dev"
# after removing target dir
$ tauri -- build --debug -- --profile=testing

Finished `testing` profile [unoptimized + debuginfo] target(s) in 49.67s                         
   Error failed to rename `C:\Users\buk\WebstormProjects\ck3oop\target\debug\ck3oop-ui-rs.exe` to
`C:\Users\buk\WebstormProjects\ck3oop\target\debug\ck3oop-ui.exe`: The system cannot find the path specified. (os error 3)

Looks like tauri wants to rename something post building but with different profile it just can't?

[package]
name = "ck3oop-ui-rs"
  "package": {
    "productName": "ck3oop-ui",
  },

It indeed will try to rename your rust binary from ck3oop-ui-rs to your product name which is ck3oop-ui. I tried with the latest release and it successfully renamed, can you check which tauri cli version are you using? tauri -V. Also try tauri build -- --profile testing without the =

@bukowa
Copy link

bukowa commented Jun 27, 2024

It indeed will try to rename your rust binary from ck3oop-ui-rs to your product name which is ck3oop-ui. I tried with the latest release and it successfully renamed, can you check which tauri cli version are you using? tauri -V. Also try tauri build -- --profile testing without the =

tauri-cli 1.5.14

Oh of course, thank you. It's all about = in the arguments.
I guess when they are passed with -- they aren't properly parsed... my bad.

@amrbashir
Copy link
Member

I will open a PR to fix this, we should handle that case

lucasfernog added a commit that referenced this issue Jun 27, 2024
* fix(cli): parse `--profile=<profile>` syntax

ref: #6255 (comment)

* Update tooling/cli/src/interface/rust.rs

* safe check next arg

* add test

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
lucasfernog added a commit that referenced this issue Jun 27, 2024
* fix(cli): parse `--profile=<profile>` syntax

ref: #6255 (comment)

* Update tooling/cli/src/interface/rust.rs

* derive default

* safe check next arg

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
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

3 participants