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

Preconfigure arguments doesn't work #531

Closed
156898293 opened this issue Nov 20, 2023 · 17 comments
Closed

Preconfigure arguments doesn't work #531

156898293 opened this issue Nov 20, 2023 · 17 comments
Labels
bug Something isn't working fixed-pending-release Fix is merged and will be included in the next release.
Milestone

Comments

@156898293
Copy link

when lunching preconfigure script via makfile tools the "preConfigureArgs": [" arg2 "] option seems to be ignored.

makefile_precfg.zip

@156898293
Copy link
Author

156898293 commented Nov 20, 2023

I forget to write how to reproduce:

  1. open the workspace (proj\other\app.code-workspace)
  2. preconfigure script should kick in (the output is there, but I ignore that --> too many text)
  3. go to output->makefile tools; clear the window
  4. run makefile -> preconfigure
  5. in the output window should be something lie this:

Pre-configuring...
Script: "******/kbuild_env.sh"
argc 0
The pre-configure succeeded.
Sending telemetry: eventName = preConfigure
properties: exitCode = "0",triggeredBy = "command pallette (preConfigure)"
measures: preConfigureElapsedTime = "0.025"

The main problem is the argc 0 it should be argc 1

@gcampbell-msft
Copy link
Collaborator

I believe #530 will fix the issue. We were incorrectly not putting space between the first argument and the command file. Feel free to pull down the code for that PR and try it, or wait until the pre-release channel has the fix. Thanks!

@gcampbell-msft gcampbell-msft added bug Something isn't working and removed triage labels Nov 20, 2023
@156898293
Copy link
Author

Ok. I'll wait for next version available in the pre-release channel and report back.

@156898293
Copy link
Author

Just out of curiosity. you mentioned adding a space should solve the problem...
is this the change you had in mind?
"preConfigureArgs": [ "arg1" ],
=>
"preConfigureArgs": [ " arg1" ],
If so it doesn't help for my v0.8.16. I still get no args into my script.

@gcampbell-msft
Copy link
Collaborator

@156898293 Ah, thank you for the follow-up, the suggestion I made definitely fixes a bug, but it might not be the bug you were hitting. I'll pull down your zip file and test right now. Thanks!

@gcampbell-msft
Copy link
Collaborator

@156898293 Could you post a screenshot of your issue? Also, what OS are you running? Is this on Windows? Linux? Thanks.

@156898293
Copy link
Author

The minimal project and description is above. I just pass arguments to my pre-cofigure scripts and in the script I print number of arguments as "argc #"
I run vscode on windows, but use ssh host to virtual-ubuntu.
If you want I can give you access to my PC via teams meeting for debug purpose.

@gcampbell-msft
Copy link
Collaborator

@156898293 OH, I think I found the issue, it was a silly bug on my part (assuming I'm correct).

Could you install this vsix and test for me? You'll need to download it, then rename the download to makefile-tools.vsix. You can then install that vsix directly by doing the following:

image

makefile-tools.zip

@156898293
Copy link
Author

working on it

@156898293
Copy link
Author

It definitelly behavies differently. However it is still not working...

err: /tmp/wrapConfigureScript.sh: line 1: /home/xxxx/proj/preconfig.sh arg2 : No such file or directory

Full log

Pre-configuring...
Script: "/home/xxxx/proj/preconfig.sh"
/tmp/wrapConfigureScript.sh: line 1: /home/xxxx/proj/preconfig.sh arg2 : No such file or directory
The pre-configure script returned success code but somewhere during the preconfigure process there were errors reported. Double check the preconfigure output in the Makefile Tools channel.
Sending telemetry: eventName = preConfigure
properties: exitCode = "-5",triggeredBy = "command pallette (preConfigure)"
measures: preConfigureElapsedTime = "0.014"

@gcampbell-msft
Copy link
Collaborator

@156898293 I appreciate you helping me test this, as I don't currently have a readily available linux machine so it would take more time for me to test. I have one more thing that would be helpful to test:
makefile-tools.zip

Follow the same steps as before.

@156898293
Copy link
Author

It looks the same. I'm gonna remove the extension and make sure I installed the correct one.

Pre-configuring...
Script: "/home/xxxx/proj/preconfig.sh"
/tmp/wrapConfigureScript.sh: line 1: "/home/xxxx/proj/preconfig.sh" arg2 : No such file or directory
The pre-configure script returned success code but somewhere during the preconfigure process there were errors reported. Double check the preconfigure output in the Makefile Tools channel.
Sending telemetry: eventName = preConfigure
properties: exitCode = "-5",triggeredBy = "command pallette (preConfigure)"
measures: preConfigureElapsedTime = "0.

@156898293
Copy link
Author

Ok I made sure I installed the correct .vsix and the output is the same as above...
image

@156898293
Copy link
Author

I just tried to run it natively on Linux (no SSH) and got the same problem.
Then I tried to run it natively on Win (no SSH) and it worked (had to switch from .sh to .bat)

@gcampbell-msft
Copy link
Collaborator

@156898293 Again, thank you for testing so quickly. I have what should definitely be the fix.

Originally the issue was that we weren't handling the script arguments on linux. Then the issue was that I was improperly quoting the items of the script such that it was treating the args as part of the filepath, now, it should be fixed.

makefile-tools.zip

@156898293
Copy link
Author

OK the last .vsix works now! Great job.
I tested both natively and via ssh host.

P.S.
I'll leave the ticket opened for you to close.
P.P.S.
THANKS for the work on Make-File-Tools it helps a lot for me and my team.

@gcampbell-msft gcampbell-msft added the fixed-pending-release Fix is merged and will be included in the next release. label Dec 1, 2023
@gcampbell-msft gcampbell-msft added this to the 0.8.0 milestone Dec 1, 2023
@gcampbell-msft gcampbell-msft added fixed-pending-release Fix is merged and will be included in the next release. and removed fixed-pending-release Fix is merged and will be included in the next release. labels Dec 1, 2023
Copy link

🎉 This issue has now been fixed and is now available in the latest release! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed-pending-release Fix is merged and will be included in the next release.
Projects
None yet
Development

No branches or pull requests

2 participants