geany_run_script.sh not given execute permission [SOLVED]

Please post any bugs you have found
Message
Author
jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

geany_run_script.sh not given execute permission [SOLVED]

#1 Post by jafadmin »

4.2

when I try to execute a compiled program from geany using F5 it fails to execute and the window hangs. It turns out that the permissions that are set on the geany_run_script.sh file are everything but execute. WT :?

Can someone please tell me how to fix this? I have no idea how geany sets the permissions on that file.
Last edited by jafadmin on Sun 10 May 2009, 16:31, edited 1 time in total.

Bruce B

#2 Post by Bruce B »

It doesn't need to be executable

Proof make a little text file and write the command
echo hello world as the file's text

Then

. filename
source filename
sh filename
bash filename


See for yourself if it runs the command echo hello world

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#3 Post by jafadmin »

We're talking 4.2 here.

1. Only "sh filename" and "bash filename" work as you say.
2. Geany automatically generates the script file
3. It don't work.

The topic isn't about how you or I can make a script execute, it is about what we can do to make geany's script work right.

In 4.12 the generated script has execute permissions and works properly. you can invoke the script from the command line using the ./ method and it works.

In the 4.2 distro the geany_run_script.sh doesn't execute. It fails with a "permission denied" I know how to make a script execute. We all do. Geany in 4.2 doesn't. That's my point. It's a bug.

Can someone please point me in the right direction on how to patch this in geany?

User avatar
WhoDo
Posts: 4428
Joined: Wed 12 Jul 2006, 01:58
Location: Lake Macquarie NSW Australia

#4 Post by WhoDo »

jafadmin wrote:The topic isn't about how you or I can make a script execute, it is about what we can do to make geany's script work right.

In 4.12 the generated script has execute permissions and works properly. you can invoke the script from the command line using the ./ method and it works.

In the 4.2 distro the geany_run_script.sh doesn't execute. It fails with a "permission denied" I know how to make a script execute. We all do. Geany in 4.2 doesn't. That's my point. It's a bug.

Can someone please point me in the right direction on how to patch this in geany?
The version of Geany in Puppy-4.2 was compiled for Puppy by one of our packagers - don't remember which one. The only way to fix this would be to patch the relevant Geany source file to have it apply execute permissions to the generated script at build time, and then recompile again from the patched tarball. Not very helpful, I know, jafa.
[i]Actions speak louder than words ... and they usually work when words don't![/i]
SIP:whodo@proxy01.sipphone.com; whodo@realsip.com

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#5 Post by jafadmin »

Ok. I was afraid of that.

Thanks.

[SOLVED] in this thread: http://www.murga-linux.com/puppy/viewtopic.php?t=40666

Bruce B

#6 Post by Bruce B »

I compiled my own Geany. What I noted was the
default location came later in the path than the
Puppy version. So I deleted the Puppy version.

As far as this not working . . .

. filename
source filename

It always work in a terminal emulator - until ???,
if a change? May be installing Pizzasgood's GTK did it.

Not important, if I note anything significant I'll be back.
I've not looked into it. I was surprised to read it didn't
work.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#7 Post by technosaurus »

I have ID'd a couple things on this in the new bug tracker here:
http://code.google.com/p/puppy-developm ... etail?id=4
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

r__hughes
Posts: 359
Joined: Thu 13 Apr 2006, 04:14
Location: Montreal, Canada

#8 Post by r__hughes »

In pup4.2+ geany has a problem being a c-runtime-environment.
It will compile & build but NOT run a c-program

In the meantime the solution is to edit the geany preferences
edit/preferences/Tools/Terminal/ to read

Code: Select all

/usr/X11R7/bin/xterm -e bash -c
--- quad booting Slacko57NPAE, Slacko56NPAE, Slacko55PAE (with OO4, devx, Gimp) & WXP on DELL Dimension 2400 PC & DELL Latitude 630 Laptop using grub.
---USB-Flash booting same on Samsung N110 WXP Netbook and Lenovo q100 WXP netPC.

User avatar
sfoster
Posts: 42
Joined: Sat 12 Jun 2010, 17:12
Location: Southern California, USA

#9 Post by sfoster »

Hi,
I'm having a problem executing code in Genie using the Freebasic compiler. I installed the Freebaic.pet package from the repository, but instead of sitting there, the bash window came up and shut down so fast that I hardly had time to see it. As to the solution r_hughes offered, I couldn't mimicked the file path because there doesn't seem to be anything labeled xterm in the x11R7/bin. I don't think the configuration is the same (I'm running lucid puppy 5.0), but I still tried inserting the line

Code: Select all

xterm -e bash -c

but got the following error message from bash:

Code: Select all

./geany_run_script.sh: line 5 ./hi:  no such file or directory
.
Also, the script won't even compile from inside Geany in my case.
I tried saving the files to the bin directory, but I came up with the same message. Meanwhile, is there an alternate IDE that I can use in place of Geany that does more or less the same thing?
I posted here because the bash script problem mentioned seems to have similar symptoms. I checked both the Genie run script and my own file to make sure they both had execute permission, but changing it didn't seem to help very much.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

geany 0.19 released

#10 Post by don570 »

There's a new version of geany that has been released with
a lot of bug fixes. I made a pet package.
Available at http://www.esnips.com/web/lupu

User avatar
sfoster
Posts: 42
Joined: Sat 12 Jun 2010, 17:12
Location: Southern California, USA

#11 Post by sfoster »

I will definitley try it and let you know how it goes. Thanks in advance. :D
-yours
S

User avatar
sfoster
Posts: 42
Joined: Sat 12 Jun 2010, 17:12
Location: Southern California, USA

Unfortunately still not working

#12 Post by sfoster »

Okay,
I tried installing the new copy of Geany last night, but unfortunately there doesn't seem to be much progress in that area. If you are installing a new copy of Geany, do you have to uninstall the old one first? Another thing I thought of has to do with the code behind the execute command. I noticed a section somewhere in the preferences menu that had to do with setting special options for the execute command and it had what looked like a binary execute command followed by the letters fbc (the compiler name). Could freebasic be requiring some special options needed to execute? Also, the status of the compile button seems to have deteriorated. Before, I could press it, and the compiler window at the bottom of the screen would give me an error message about not finding a necessary file. Now the button is completely ghosted. I'm not sure, but could this have anything to do with trying to install over the old Geany incorrectly? One other thing happened that leads me to this conclusion. When I go to create a new file, there used to be a whole bunch of templates. The templates, it appears, have been shifted into a submenu called old templates, or something like that. :? It kind of looks to me like the program overwrote some things without overwriting others.
If anyone is reading this post before the next couple hours, I will try to get on puppy again and fill in some of the details I might have not clarified very well. Thanks again to don570 for the link.
Yours,
-S

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#13 Post by npierce »

sfoster wrote:As to the solution r_hughes offered, I couldn't mimicked the file path because there doesn't seem to be anything labeled xterm in the x11R7/bin. I don't think the configuration is the same (I'm running lucid puppy 5.0), but I still tried inserting the line

Code: Select all

xterm -e bash -c
Yes, you correctly adapted the solution to work with your configuration. So now you can see the output from bash.
sfoster wrote:but got the following error message from bash:

Code: Select all

./geany_run_script.sh: line 5 ./hi:  no such file or directory
So there is another problem. The reason bash can't find ./hi is this:
sfoster wrote:Also, the script won't even compile from inside Geany in my case.
So geany apparently didn't find a copy of the executable hi in the directory where it expected it.
sfoster wrote:Also, the status of the compile button seems to have deteriorated. Before, I could press it, and the compiler window at the bottom of the screen would give me an error message about not finding a necessary file.
That error message could be the key to getting this working. Do you remember what it was?
sfoster wrote:Now the button is completely ghosted.
When you saved the file did you name it with the .bas extension? If so, I don't know why the button would be grayed-out, unless the new version of geany doesn't recognize .bas files as source code. If that's the case you will obviously need to revert to the version you had before. My guess is that once you fixed the preferences for Terminal, that geany was probably working okay, but you may have had missing dependencies for freebasic.

Have you tested freebasic without geany? If not, open a terminal window, change to the directory where hi.bas lives, and try this:

Code: Select all

fbc -w all hi.bas
./hi

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

pet2tgz

#14 Post by don570 »

If you want to see what code you've installed
and where you've installed it
the command in puppy is

Code: Select all

pet2tgz  package.pet
Then open with archiving program
Be careful because pet2tgz command will destroy original
pet package,so make a copy first!!
By the way , if you uninstall geany .19 the old
geany comes back magically (because it's hidden in filesystem)

User avatar
sfoster
Posts: 42
Joined: Sat 12 Jun 2010, 17:12
Location: Southern California, USA

#15 Post by sfoster »

I ended up busier than I thought I would be (I would have clarified the error message sooner) but I did try compiling code from inside the terminal just to see if the problem was Freebasic's (from earlier), and that worked. It made a binary just fine. Sorry to keep the details waiting.
I should also clarify that I havent tried the -e bash -c command together with the new install of Geany yet. They were separate attempts, so trying the two together might yield new results.
Hang, on Im going to load a copy in ram and repost on the error message details, because due to a very stupid mistake on my part, I forgot to test the new version of Geany in ram before installing it to my pup-save file.
Oh, I should also mention before I sign off that the file was actually named hi.bas. I think bash just didn't print the file extension for some reason when it was relaying the message back to me. I think the new version does recognize .bas files because in one of the lower windows immediately below the editing pane, it says "file type: Freebasic." I will check again just to make sure.

User avatar
sfoster
Posts: 42
Joined: Sat 12 Jun 2010, 17:12
Location: Southern California, USA

the error code

#16 Post by sfoster »

The error message without the -e bash -c option is as follows:

Code: Select all

/usr/share/freebasic/bin/linux/ld: cannot find -lc 
With "-e bash -c"code inserted it is still the same. I didn't get the opportunity to see this code in the new version because of the ghosted button.
I should have the opportunity to experiment with it more this weekend. I'll keep posting.
Yours,
S

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#17 Post by npierce »

sfoster wrote:

Code: Select all

/usr/share/freebasic/bin/linux/ld: cannot find -lc
This error message indicates that the file libc.so cannot be found. Typically that would be in the /usr/lib/ directory, but since it isn't usually needed except for development, it was probably omitted from your Puppy.

Since libc.so is missing, it is likely that others are as well. I don't know for sure which are needed, since it only complains when something is missing, but I do know that it complained about the following missing files when I tried fbc on my Puppy 4.3.1:

-lc (libc.so)
-lm (libm.so)
-lpthread (libpthread.so)
-ldl (libdl.so)
-lncurses (libncurses.so)

My guess is that installing the appropriate *devx*.sfs for your Puppy (lupu_devx_500.sfs if you are still using Puppy 5.0.0) will provide these files -- actually 3 symlinks and 2 GNU ld scripts -- as well as 2 other libraries needed by the GNU ld scripts.

But that is just a guess, since I didn't try this myself. I didn't want to download 90 MB just for 12 KB of stuff.

If you plan on doing other development work, you should go ahead and install the *devx*.sfs file. But if you will only be using freebasic and don't want to download 121 MB (for instance, if you were on dial-up), or if installing it doesn't solve the problem, let me know and I can tell you what I did manually for my Puppy 4.3.1.

Should you decide to try the manual solution, please post the output of the following commands, so we can adapt the procedure to your Puppy:

Code: Select all

find / -xdev  -name libc.so -ls -o -name libm.so -ls -o -name libpthread.so -ls -o -name libdl.so -ls -o -name libncurses.so -ls

find / -xdev  -name libc.so.? -ls -o -name libm.so.? -ls -o -name libpthread.so.? -ls -o -name libdl.so.? -ls -o -name libncurses.so.? -ls
(Note that the two commands are long, and the lines may wrap in your browser window, but they are really only one line each.)

Now, having said all of that, I do see a bit of a mystery here:
sfoster wrote:. . . but I did try compiling code from inside the terminal just to see if the problem was Freebasic's (from earlier), and that worked. It made a binary just fine.
Really? No error messages? Did the binary run okay? Can you think of anything that was different other than you were compiling in the terminal instead of in geany? Perhaps you had the *devx*.sfs file installed?

It surprises me that the loader would give that error when run from geany but not when run from a terminal. But if it does, all that I said about installing the *devx*.sfs file may not help you here. Although it still might be helpful to see the output of the two commands I suggested above.

(Oh, wait, I think maybe I see. You tried geany without your pup-save. So maybe you'll be fine with your pup-save.)

sfoster wrote:Oh, I should also mention before I sign off that the file was actually named hi.bas. I think bash just didn't print the file extension for some reason when it was relaying the message back to me. I think the new version does recognize .bas files because in one of the lower windows immediately below the editing pane, it says "file type: Freebasic."
Ah, thanks for reporting that it was recognized okay. That eliminates one possibile problem.

(By the way, bash didn't print the file extension in the error message because it was looking for the executable, which has no extension.)

I installed the new version of geany and played with it a bit. It appears that for some reason it cannot properly set the source file commands (such as the compile command). If you choose the last entry of the Build menu (can't think of its name at the moment) you will see that the new version leaves the source file commands blank. This seems to be true for other file types as well, not just freebasic. Although you can fill it in yourself (fbc -w all "%f") I would suggest sticking with the old version for now, in case there are similar bugs lurking in the new version (although I was able to get it to work, after filling in the command).

Good luck. Please keep us posted on your progress.

User avatar
sfoster
Posts: 42
Joined: Sat 12 Jun 2010, 17:12
Location: Southern California, USA

partially solved

#18 Post by sfoster »

The devx file turned out to be the missing link. When you mentioned looking for other details, it suddenly occurred to me that I had been working across several different pup-save files. The only things I had thought to check for was the version number of Geany, and to make sure that the Freebaisc PET was installed. I have an up-to-date copy of the developer module that corresponds with my version, but I guess I didn't have it properly installed on all of the saves that I was using. I hope I didn't send you on any wild goose chases as a result of my error. I reinstalled the old Geany and made sure devx was installed this time, and bingo, it compiled and is working properly. Regarding the other problem I had about not being able to execute code inside of Geany, I think you provided the solution for that too. When you mentioned that there were no paths set for the compile command in the new version, I looked at the old version to see if maybe it had a similar problem with the execute path. The old version looked like it had the compile path set, but not the execute path. Neither the command "fbc" in the prompt or the manual seemed to reveal anything useful. I can't seem to find what that path should be. May I ask your help again?
I really apologize if I caused you any trouble.
Yours,
S

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#19 Post by npierce »

No apology necessary. User error is always a possibility when troubleshooting a problem. That's how we all learn. (Heck, much of what I know is a result of my errors!) In this case you were reminded of something that you perhaps already knew but forgot: when troubleshooting a problem, it is usually best, if possible, to change just one factor at a time.

I think what you are looking for in order to execute from geany is "./%e" (including the quotation marks). That is what I have at Build -> Set Includes and Arguments -> Execute: in my geany, and it works for me.

I don't know what version you have, but in Puppy 4.3.1 I have:

Code: Select all

# geany -V    
geany 0.18 (built on Aug 28 2009 with GTK 2.14.7, GLib 2.18.3)
The only thing I needed to do to get this version working was to change the command for Terminal, as you described in your first post.

Anyway, I'm glad you got compiling from geany working, and hope that you get execution for geany to work as well.

Norm

User avatar
sfoster
Posts: 42
Joined: Sat 12 Jun 2010, 17:12
Location: Southern California, USA

execute works now

#20 Post by sfoster »

Oh, I think I see. "Execute" in Geany means that it executes binary files that have already been compiled. Its a bit confusing for people who are migrating over from Qbasic (well, at least it was confusing for me). You could use the run command in Qbasic to execute programs without compiling them. I assume this was so people could check their source code without cluttering their hard drives full of buggy executables. That's how I normally use it anyway. Its not a huge difference, but it was a point of confusion for me because I had only ever used the IDE that came with QBasic before. I thought the execute path was incomplete because in the case of the compile path, there were other statements in front of the quotation marks. I guess I still have a lot to learn about jumping to conclusions.
My sincerest thanks for all your help.
Yours,
S

Post Reply