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

dev-lang/fpc: added new revision which is usable under prefix #5495

Closed
wants to merge 1 commit into from
Closed

Conversation

TheChymera
Copy link
Contributor

@TheChymera TheChymera commented Aug 21, 2017

Package-Manager: Portage-2.3.8, Repoman-2.3.3

The current fpc package would not work properly on RAP/prefix systems, because:

  • no prefix was added to the compiler unit file paths in the autogenerated fpc.cfg file.
  • the fpc binary hard-coded the compiler configfile path as /etc/fpc.cfg.

Here is an example of these two issues arising:

hioanas@servetus ~/gentoo/var/tmp/portage/sci-biology/bru2nii-9999/work/bru2nii-9999 $ fpc -Tlinux -vut main.pas
 Bru2.lpr                                                                                                       
Configfile search: /home/hioanas/.fpc.cfg 
Configfile search: /home/hioanas/gentoo/usr/lib64/fpc/etc/fpc.cfg
Configfile search: /etc/fpc.cfg
Path "/usr/lib/fpc/3.0.2/units/x86_64-linux/rtl/" not found
Searching file /lib64/ld-linux-x86-64.so.2... found
Path "/usr/X11R6/lib64/" not found
Path "/usr/lib64/" not found
Compiler: /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/ppcx64
Using executable path: /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/
Using unit path: /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/
Using library path: /usr/lib/x86_64-linux-gnu/
Using library path: /lib64/
Using library path: /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/
Using object path: /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/
Searching file Bru2.lpr... found
(BRU2)     Registering new unit SYSTEM
(BRU2)     Load from BRU2 (implementation) unit SYSTEM
(SYSTEM)   Loading unit SYSTEM
Unitsearch: system.ppu
Searching file system.ppu... not found
Searching file SYSTEM.PPU... not found
Unitsearch: system.pp
Searching file system.pp... not found
Searching file SYSTEM.PP... not found
Unitsearch: system.pas
Searching file system.pas... not found
Searching file SYSTEM.PAS... not found
Unitsearch: /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/system.ppu
Searching file /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/system.ppu... not found
Searching file /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/SYSTEM.PPU... not found
Unitsearch: /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/system.pp
Searching file /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/system.pp... not found
Searching file /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/SYSTEM.PP... not found
Unitsearch: /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/system.pas
Searching file /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/system.pas... not found
Searching file /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/SYSTEM.PAS... not found
Unitsearch: system.pp
Searching file system.pp... not found
Searching file SYSTEM.PP... not found
Unitsearch: system.pas
Searching file system.pas... not found
Searching file SYSTEM.PAS... not found
Unitsearch: /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/system.pp
Searching file /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/system.pp... not found
Searching file /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/SYSTEM.PP... not found
Unitsearch: /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/system.pas
Searching file /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/system.pas... not found
Searching file /home/hioanas/gentoo/usr/lib64/fpc/3.0.2/SYSTEM.PAS... not found
Fatal: Can't find unit system used by Bru2
Fatal: Compilation aborted
Error: /home/hioanas/gentoo/usr/bin/ppcx64 returned an error exitcode
hioanas@servetus ~/gentoo/var/tmp/portage/sci-biology/bru2nii-9999/work/bru2nii-9999 $  equery f fpc | ag "fpc.cfg"
!!! Section 'gentoo_prefix' in repos.conf has name different from repository name 'gentoo' set inside repository
!!! Section 'gentoo_prefix' in repos.conf has name different from repository name 'gentoo' set inside repository
!!! Section 'gentoo_prefix' in repos.conf has name different from repository name 'gentoo' set inside repository
/home/hioanas/gentoo/etc/fpc.cfg
/home/hioanas/gentoo/usr/share/man/man5/fpc.cfg.5.bz2

@gentoo-repo-qa-bot gentoo-repo-qa-bot added the assigned PR successfully assigned to the package maintainer(s). label Aug 21, 2017
@gentoo-repo-qa-bot
Copy link
Collaborator

Pull Request assignment

Areas affected: ebuilds
Packages affected: dev-lang/fpc

dev-lang/fpc: @Amynka

@heroxbd heroxbd requested review from heroxbd and Amynka August 22, 2017 12:02
Copy link
Contributor

@heroxbd heroxbd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your fix of free pascal for Prefix. Your changes are feasible, though they could be simplified.

sed -i "s|if CfgFileExists('/etc/'+fn) then|if CfgFileExists('${EPREFIX}/etc/'+fn) then|g" "${WORKDIR}"/fpcbuild-${PV}/fpcsrc/compiler/options.pas || die
sed -i "s|foundfn:='/etc/'+fn|foundfn:='${EPREFIX}/etc/'+fn|g" "${WORKDIR}"/fpcbuild-${PV}/fpcsrc/compiler/options.pas || die
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be simplified by hprefixify from prefix.eclass, to hprefixify "${WORKDIR}"/fpcbuild-${PV}/fpcsrc/compiler/options.pas.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sadly, that doesn't perform the required edit:

    ag "if CfgFileExists" "${WORKDIR}"/fpcbuild-${PV}/fpcsrc/compiler/options.pas -A 10
    # make the compiled binary check for fpc.cfg under the prefixed /etc/ path
    hprefixify "${WORKDIR}"/fpcbuild-${PV}/fpcsrc/compiler/options.pas
    ag "if CfgFileExists" "${WORKDIR}"/fpcbuild-${PV}/fpcsrc/compiler/options.pas -A 10

gives me:

3119:      if CfgFileExists(configpath+fn) then                                                                 
3120-       foundfn:=configpath+fn                                                                              
3121-     else                                                                                                  
3122-{$ifdef WINDOWS}                                                                                           
3123-       if (GetEnvironmentVariable('USERPROFILE')<>'') and CfgFileExists(FixPath(GetEnvironmentVariable('USE
RPROFILE'),false)+fn) then                                                                                      
3124-         foundfn:=FixPath(GetEnvironmentVariable('USERPROFILE'),false)+fn                                  
3131:      if CfgFileExists(exepath+fn) then                                                                    
3132-       foundfn:=exepath+fn                                                                                 
3133-     else                                                                                                  
3134-{$else}                                                                                                    
3135:      if CfgFileExists('/etc/'+fn) then                                                                    
3136-       foundfn:='/etc/'+fn                                                                                 
3137-     else                                                                                                  
3138-{$endif}                                                                                                   
3139-      check_configfile:=false;                                                                             
3140-   end;                                                                                                    
/home/hioanas/gentoo/var/tmp/portage/dev-lang/fpc-3.0.2-r1/temp/environment: line 850: hprefixify: command not f
ound                                                                                                            
3119:      if CfgFileExists(configpath+fn) then                                                                 
3120-       foundfn:=configpath+fn                                                                              
3121-     else                                                                                                  
3122-{$ifdef WINDOWS}                                                                                           
3123-       if (GetEnvironmentVariable('USERPROFILE')<>'') and CfgFileExists(FixPath(GetEnvironmentVariable('USE
RPROFILE'),false)+fn) then                                                                                      
3124-         foundfn:=FixPath(GetEnvironmentVariable('USERPROFILE'),false)+fn                                  
3131:      if CfgFileExists(exepath+fn) then                                                                    
3132-       foundfn:=exepath+fn                         
3133-     else              
3134-{$else}                
3135:      if CfgFileExists('/etc/'+fn) then            
3136-       foundfn:='/etc/'+fn                         
3137-     else              
3138-{$endif}               
3139-      check_configfile:=false;                     
3140-   end; 

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be fine with the sed solution you provided..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@heroxbd so we can leave it at that?

Copy link
Contributor

@heroxbd heroxbd Aug 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3119:      if CfgFileExists(configpath+fn) then
3120-       foundfn:=configpath+fn
3121-     else
3122-{$ifdef WINDOWS}
3123-       if (GetEnvironmentVariable('USERPROFILE')<>'') and CfgFileExists(FixPath(GetEnvironmentVariable('USERPROFILE'),false)+fn) then
3124-         foundfn:=FixPath(GetEnvironmentVariable('USERPROFILE'),false)+fn
3125-     else
3126-       if (GetEnvironmentVariable('ALLUSERSPROFILE')<>'') and CfgFileExists(FixPath(GetEnvironmentVariable('ALLUSERSPROFILE'),false)+fn) then
3127-         foundfn:=FixPath(GetEnvironmentVariable('ALLUSERSPROFILE'),false)+fn
3128-     else
3129-{$endif WINDOWS}
3131:      if CfgFileExists(exepath+fn) then
3132-       foundfn:=exepath+fn
3133-     else
3134-{$else}
3135:      if CfgFileExists('/etc/'+fn) then
3136-       foundfn:='/etc/'+fn
3137-     else
3138-{$endif}
3139-      check_configfile:=false;
3140-   end;
3141-end;
3142-
3143-
3144-procedure read_arguments(cmd:TCmdStr);
3145-var
 * Adjusting to prefix /fefs/disk/usr100/gentoo
 *   options.pas ...                                                                                                                                                                                         [ ok ]
3119:      if CfgFileExists(configpath+fn) then
3120-       foundfn:=configpath+fn
3121-     else
3122-{$ifdef WINDOWS}
3123-       if (GetEnvironmentVariable('USERPROFILE')<>'') and CfgFileExists(FixPath(GetEnvironmentVariable('USERPROFILE'),false)+fn) then
3124-         foundfn:=FixPath(GetEnvironmentVariable('USERPROFILE'),false)+fn
3125-     else
3126-       if (GetEnvironmentVariable('ALLUSERSPROFILE')<>'') and CfgFileExists(FixPath(GetEnvironmentVariable('ALLUSERSPROFILE'),false)+fn) then
3127-         foundfn:=FixPath(GetEnvironmentVariable('ALLUSERSPROFILE'),false)+fn
3128-     else
3129-{$endif WINDOWS}
3131:      if CfgFileExists(exepath+fn) then
3132-       foundfn:=exepath+fn
3133-     else
3134-{$else}
3135:      if CfgFileExists('/fefs/disk/usr100/gentoo/etc/'+fn) then
3136-       foundfn:='/fefs/disk/usr100/gentoo/etc/'+fn
3137-     else
3138-{$endif}
3139-      check_configfile:=false;
3140-   end;
3141-end;
3142-
3143-
3144-procedure read_arguments(cmd:TCmdStr);
3145-var
>>> Source prepared.

It works for me. Are you testing it on Prefix? Is EPREFIX defined?

Copy link
Contributor

@heroxbd heroxbd Aug 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, looking closer to your code snippet,

/home/hioanas/gentoo/var/tmp/portage/dev-lang/fpc-3.0.2-r1/temp/environment: line 850: hprefixify: command not found

you need to inherit prefix at the top of the ebuild to call hprefixify.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@heroxbd whoops :)

Works now!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets merge it then? Can I ? :) (works for me though I don't have prefix :) )


SLOT="0"
LICENSE="GPL-2 LGPL-2.1-with-linking-exception"
KEYWORDS="~amd64 ~arm ~ppc ~x86"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add back ppc and arm keywords here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test it on ~arm and ~ppc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, and I have corrected the ebuild to exclude them. Still, I think it is very weird that repoman warned me about this - and specifically for this version and revision, not =fpc-3.0.0, where they were historically dropped:

dev-lang/fpc: removed arm and ppc keywords  
  
# Please enter the commit message for your changes.
# (Comment lines starting with '#' will not be included)
#
#  KEYWORDS.dropped              1
#   dev-lang/fpc/fpc-3.0.2-r1.ebuild: arm ppc
#  upstream.workaround           40
#   dev-lang/fpc/fpc-2.6.4.ebuild: Upstream parallel compilation bug (ebuild calls emake -j1 on line: 91)
#   dev-lang/fpc/fpc-2.6.4.ebuild: Upstream parallel compilation bug (ebuild calls emake -j1 on line: 97)
#   dev-lang/fpc/fpc-2.6.4.ebuild: Upstream parallel compilation bug (ebuild calls emake -j1 on line: 105)
#   dev-lang/fpc/fpc-2.6.4.ebuild: Upstream parallel compilation bug (ebuild calls emake -j1 on line: 107)
#   dev-lang/fpc/fpc-2.6.4.ebuild: Upstream parallel compilation bug (ebuild calls emake -j1 on line: 111)
#   dev-lang/fpc/fpc-2.6.4.ebuild: Upstream parallel compilation bug (ebuild calls emake -j1 on line: 125)
#   dev-lang/fpc/fpc-2.6.4.ebuild: Upstream parallel compilation bug (ebuild calls emake -j1 on line: 130)
#   dev-lang/fpc/fpc-2.6.4.ebuild: Upstream parallel compilation bug (ebuild calls emake -j1 on line: 133)
#   dev-lang/fpc/fpc-2.6.4.ebuild: Upstream parallel compilation bug (ebuild calls emake -j1 on line: 144)
#   dev-lang/fpc/fpc-2.6.4.ebuild: Upstream parallel compilation bug (ebuild calls emake -j1 on line: 150)
#   dev-lang/fpc/fpc-3.0.0.ebuild: Upstream parallel compilation bug (ebuild calls emake -j1 on line: 78)
#   dev-lang/fpc/fpc-3.0.0.ebuild: Upstream parallel compilation bug (ebuild calls emake -j1 on line: 84)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not weird it is normal behaviour :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so it keeps on warning you forever if at any point in the package's history KEYWORDS were dropped? o.0

Package-Manager: Portage-2.3.8, Repoman-2.3.3
@gentoo-repo-qa-bot
Copy link
Collaborator

😞 The QA check for this pull request has found the following issues:

Issues inherited from Gentoo (may be modified by PR):
https://qa-reports.gentoo.org/output/gentoo-ci/e32b4edf0/output.html#media-sound/snd
https://qa-reports.gentoo.org/output/gentoo-ci/e32b4edf0/output.html#sys-devel/binutils-hppa64

Copy link
Contributor

@heroxbd heroxbd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Horea. Sure Amy, please go ahead.

@Amynka
Copy link
Contributor

Amynka commented Aug 25, 2017

Done thanks :)

@Amynka Amynka closed this Aug 25, 2017
@TheChymera TheChymera deleted the fpc branch August 27, 2017 04:54
TheChymera added a commit to TheChymera/overlay that referenced this pull request Sep 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned PR successfully assigned to the package maintainer(s).
Projects
None yet
4 participants