Author Topic: cannot set default compiler  (Read 2953 times)

Offline cbnewbie

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: cannot set default compiler
« Reply #15 on: April 11, 2017, 01:24:28 am »
This is interesting. I am using Mageia Linux and gcc is installed in /usr (see mageia-gcc.txt). But there are some links between /bin, /usr/bin and /etc/alternatives:

$ cd /etc/alternatives
$ ls -l gcc
lrwxrwxrwx 1 root root 18 Mär 29 21:09 gcc -> /usr/bin/gcc-5.4.0*
$ cd /usr/bin/
$ ls -l gcc
lrwxrwxrwx 1 root root 21 Mär 29 21:09 gcc -> /etc/alternatives/gcc*
$ cd /bin
$ ls -l gcc
lrwxrwxrwx 1 root root 21 Mär 29 21:09 gcc -> /etc/alternatives/gcc*
$

Offline cbnewbie

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: cannot set default compiler
« Reply #16 on: April 11, 2017, 01:31:12 am »
I attached two files with the output of strace.

What I did: I started cb, selected the detected compiler as default at start up. When cb was running I tried to auto-detect the compiler because the toolchain path was still empty. After setting the path manually to /usr I closed cb.
« Last Edit: April 11, 2017, 01:38:35 am by cbnewbie »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10551
    • Travis build status
Re: cannot set default compiler
« Reply #17 on: April 11, 2017, 01:59:53 am »
Please - do the following:
1. start cb under strace
2. open settings -> editor
3. change some settings (switch any checkbox)
4. press ok
5. close cb

Then post the log, but first start cb again and check if the settings is saved...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cbnewbie

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: cannot set default compiler
« Reply #18 on: April 11, 2017, 12:12:03 pm »
This time I did the following:

1. start cb under strace
2. open settings -> editor
3. change some settings (switch any checkbox) -> check "Detect indent style" and "Use TAB character"
4. press ok
5. close cb
6. start cb again -> previously checked options have been saved!

I had to split and compress the strace output file into two parts: cb_strace_03.7z and cb_strace_04.7z

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10551
    • Travis build status
Re: cannot set default compiler
« Reply #19 on: April 12, 2017, 12:37:09 am »
Can you please post a single file? Use a paste bin like service if the forum doesn't allow big attachments!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10551
    • Travis build status
Re: cannot set default compiler
« Reply #20 on: April 12, 2017, 12:41:45 am »
It seems that 03 is after 04. Is this the case?
Also it seems that the file is written successfully:
Code: [Select]
stat("/home/mer/.config/codeblocks/default.conf", {st_mode=S_IFREG|0664, st_size=36236, ...}) = 0
lstat("/home/mer/.config/codeblocks/default.conf", {st_mode=S_IFREG|0664, st_size=36236, ...}) = 0
access("/home/mer/.config/codeblocks/default.conf", W_OK) = 0
lstat("/home/mer/.config/codeblocks/default.conf", {st_mode=S_IFREG|0664, st_size=36236, ...}) = 0
open("/home/mer/.config/codeblocks/default.conf.temp", O_WRONLY|O_CREAT|O_TRUNC, 0100664) = 5
write(5, "<?xml version=\"1.0\" encoding=\"UT"..., 47512) = 47512
close(5)                                = 0
rename("/home/mer/.config/codeblocks/default.conf.temp", "/home/mer/.config/codeblocks/default.conf") = 0

Do you have dropbox or something similar setup for your home folder? I've heard complaints of brokenness in such setups.
Does the modification time of the file changes?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cbnewbie

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: cannot set default compiler
« Reply #21 on: April 12, 2017, 02:25:35 pm »
Yes, 04 is first part, 03 is second part. Sorry!

Yes, the file (default.conf) gets a new timestamp and when I open cb again it remebers my choices (selected checkboxes). The only thing which causes problems is that whenever I try to set the toolchain path to a different folder than the "auto-detect folder" cb does not keep that path. It seems to me that cb ignores any valid path and fills in its "auto-detect folder" during start up. As mentioned before gcc is installed in /usr/bin with a link also in /bin. Since /bin is before /usr/bin in my $PATH cb finds /bin/gcc first. Obviously cb accepts the first found gcc as default - which makes sense - but it does not care whether another valid path has already been specified. So, I cannot set another toolchain path for gcc.

No, I do not have dropbox.

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1673
Re: cannot set default compiler
« Reply #22 on: April 12, 2017, 06:06:38 pm »
Do you hit "Auto detect"?

Offline cbnewbie

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: cannot set default compiler
« Reply #23 on: April 12, 2017, 09:00:58 pm »
Yes, I did. But it did not change something. During startup cb always puts the path of the first detected gcc in the edit field of the toolchain path. No matter whether I selected a different valid path or not. Maybe "auto-detect" does always run during startup? Even if it is not neccessary .

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10551
    • Travis build status
Re: cannot set default compiler
« Reply #24 on: April 13, 2017, 08:58:13 am »
Don't know what is going on. :(
You'll have to debug it to find why it opens the dialog every time.

But it is really strange that Mageia devs have decided to place something like gcc in /bin.
Are you really sure it is there? Can you do find /bin -ls?
What happens if you set the path to /usr?
Btw have you seen the note below the path control that states that you have to remove the bin from the path you enter?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cbnewbie

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: cannot set default compiler
« Reply #25 on: April 13, 2017, 12:07:21 pm »
$ ls -l /bin/gcc                                                                                                           
lrwxrwxrwx 1 root root 21 Mär 29 21:09 /bin/gcc -> /etc/alternatives/gcc*                                                                 
$ ls -l /etc/alternatives/gcc                                                                                               
lrwxrwxrwx 1 root root 18 Mär 29 21:09 /etc/alternatives/gcc -> /usr/bin/gcc-5.4.0*                                                       
$ ls -l /usr/bin/gcc-5.4.0                                                                                                 
-rwxr-xr-x 1 root root 895864 Mär 26 22:02 /usr/bin/gcc-5.4.0*                                                                             
$ ls -l /usr/bin/gcc
lrwxrwxrwx 1 root root 21 Mär 29 21:09 /usr/bin/gcc -> /etc/alternatives/gcc*

Yes, I have removed "bin" from the path. But there is already something wrong because "auto-detect" should at least fill in "/" in the toolchain path. However, this field is always empty after startup - even if I select "/usr" and close cb normally.
                         

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10551
    • Travis build status
Re: cannot set default compiler
« Reply #26 on: April 13, 2017, 08:51:03 pm »
Try a night build and if it fails you'll have to debug it yourself or demonstrate how to reproduce it in a more mainstream linux distribution.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]