-
Notifications
You must be signed in to change notification settings - Fork 61
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
preConfigureScript autogen.sh error: 'configure.ac' is required #669
Comments
@sysescool Could you give some more context on how your project is setup? Where is the Any information about how we could most easily reproduce this would be great. Thanks! @Yingzi1234 FYI. |
Yes, I will give you more context: cd $HOME/Music
git clone https://gitlab.freedesktop.org/xorg/driver/xf86-video-dummy.git
cd xf86-video-dummy
tree and the tree show below: .
├── autogen.sh
├── configure.ac
├── COPYING
├── Makefile.am
├── README.md
└── src
├── dummy_cursor.c
├── dummy_driver.c
├── dummy.h
└── Makefile.am still in xf86-video-dumy folder: mkdir .vscode
vim .vscode/settings.json and the settings.json: {
"makefile.preConfigureScript": "${workspaceFolder}/autogen.sh",
} still in xf86-video-dumy foler:
Then Click Makefile in Sidebar -> Click Icon "..." -> Click "Makefile: Pre-Configure".
However, If you I try to debug it in autogen.sh, then I modify it as above. Notice that: the path is different. But I don't know how to fix it. The problem is: when autogen.sh is running, the $0 is different from vscode plugin run and terminal run. autogen.sh: #! /bin/sh
# run in terminal: /home/xxx/xf86-video-dummy
# run in vscode: /home/xxx/xf86-video-dummy
pwd
# run in terminal: ./autogen.sh
# run in vscode: /bin/bash
echo $0
srcdir=`dirname "$0"`
# run in terminal: .
# run in vscode: /bin
echo ${srcdir}
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd "$srcdir"
autoreconf -v --install || exit 1 # error in this line.
cd "$ORIGDIR" || exit $? |
@sysescool I apologize for taking so long to respond to your question. Could you try following the steps below and then check if it solves your problem?
Make sure your Makefile has at least a basic target:
|
Thank your response.
#! /bin/sh
# run in terminal: /home/xxx/xf86-video-dummy
# run in vscode: /home/xxx/xf86-video-dummy
pwd
# run in terminal: ./autogen.sh
# run in vscode: /bin/bash
echo $0
srcdir=`dirname "$0"`
# run in terminal: .
# run in vscode: /bin
echo ${srcdir}
Forgive my frankness. Do not copy from ChatGPT or Other AI, Your answer is very similar to the answer the AI gave me. You can see that:
At the reminder of a colleague: |
seems like there, call the script. But I know typescript and vscode plugin api nothing. |
@sysescool Based on the above steps you provided, we can reproduce your problem, we noticed that you fail after running the Makefile:pre-configure command, the reason for the failure may be that there is no preConfigureScript.sh file in the project, if you follow the steps below to add its path to the setup and then run the command "Makefile: pre-configure", it will succeed.
|
@gcampbell-msft After opening the project we realize that we can't select the values for |
Hi, what you need to test is ${0} not ${1}. echo "PRECONFIGURE" ${0} run PRECONFIGURE ./preConfigureScript.sh run by plugin, have result: PRECONFIGURE /bin/bash |
Hi @sysescool If change {1} to {0}, also can get the following successful result. Has your problem been solved by the above steps? |
Please scroll up, find the output: Then please |
Let me explain below picture. I hope you understand, they are different !!!! The value of $0 run in terminal and run in plugin is different !!!! You should not focus on the "Configure succeeded." All the things preConfigureScript.sh done is just print, or output. No matter how it's always success! Always! Please focus on the value of $0. Why the autogen.sh in the project xf86-video-dummy failed? If you don't understand $0, please read that https://unix.stackexchange.com/questions/280454/what-is-the-meaning-of-0-in-the-bash-shell. We write program in script, and the program in script depends on the $0 as an input. Let the $0 output run in vscode as same as run it in terminal. I hope you could fix this. I Enjoy using your plugin and hope it gets better. |
@gcampbell-msft We can reproduce this issue on latest Makefile tools version v0.12.10(pre-release), you can get the details below. Thank you! Issue: The output of the Platform: Linux Repro steps:
|
@sysescool @Yingzi1234 Thank you both for the in-depth investigation! This is expected, as this is by design in the source code. We create a wrapper around the script so that we can add some scripting that gets the environment after the execution of the users script, and then apply it to the environment so that the preConfigureScript actions actually take effect. However, this seems to be breaking something in this case. Is there a way that you can modify your scripting in order to make this work? Otherwise, we would have to brainstorm how else to get the environment after execution in order to update the Makefile Tools environment. You can see the code starting here: vscode-makefile-tools/src/make.ts Line 1120 in 46aff6c
|
I get a project, and this is my settings.json:
Then, I click Makefile: Pre-Configure, but thes is error:
If I run
cd /home/xxx/xf86-video-dummy && ./autogen.sh
, it indeed works.there is autogen.sh, for test I modify it:
I think this about work path or something about path, but I search a lot, still do not fix it.
The text was updated successfully, but these errors were encountered: