Re: Portfile question for 10.6.8

2023-06-15 Thread raf via macports-users
On Thu, Jun 15, 2023 at 07:00:57PM -0500, Ryan Schmidt 
 wrote:

> On Jun 6, 2023, at 20:16, raf wrote:
> 
> > That still leaves the question of how 10.6.8 hosts can download distfiles
> > from a non-https site (when https sites won't support TLS 1.0). Do distfiles
> > magically end up on http://distfiles.macports.org?
> 
> Yes. Well, it's not magical, but it is automatic. When commits are made to 
> the master branch of macports-ports, a notification is sent by GitHub to our 
> buildbot system. It evaluates each commit and determines which of the ports 
> that were modified need to be built. For each one, it downloads its distfiles 
> (if they haven't already been downloaded) to the distfiles area of a private 
> fileserver, and then it builds it for each compatible macOS version. After a 
> successful build, binary archives are uploaded to the packages area of the 
> private fileserver. On an hourly basis, the contents of the private 
> fileserver are mirrored to the public master fileserver, and within hours 
> after that, the other MacPorts mirror servers synchronize their contents with 
> the master.
> 
> If you like to watch what the buildbot is doing you can visit 
> https://build.macports.org/waterfall
> 
> Each of our mirror servers have different capabilities and requirements when 
> it comes to https. MacPorts is configured to know which mirror server is able 
> to be reached via https on each version of macOS. The code that does that is 
> here for distfiles:
> 
> https://github.com/macports/macports-ports/blob/dbf0d04659eb119cdec6a4c3fef6247345c6/_resources/port1.0/fetch/mirror_sites.tcl#L410-L464
> 
> and here for archives:
> 
> https://github.com/macports/macports-ports/blob/dbf0d04659eb119cdec6a4c3fef6247345c6/_resources/port1.0/fetch/archive_sites.tcl#L3-L55

Hi Ryan,

Thanks for the explanation. It's an amazing setup.

cheers,
raf
.


Re: Portfile question for 10.6.8

2023-06-15 Thread Ryan Schmidt
On Jun 6, 2023, at 20:16, raf wrote:

> That still leaves the question of how 10.6.8 hosts can download distfiles
> from a non-https site (when https sites won't support TLS 1.0). Do distfiles
> magically end up on http://distfiles.macports.org?

Yes. Well, it's not magical, but it is automatic. When commits are made to the 
master branch of macports-ports, a notification is sent by GitHub to our 
buildbot system. It evaluates each commit and determines which of the ports 
that were modified need to be built. For each one, it downloads its distfiles 
(if they haven't already been downloaded) to the distfiles area of a private 
fileserver, and then it builds it for each compatible macOS version. After a 
successful build, binary archives are uploaded to the packages area of the 
private fileserver. On an hourly basis, the contents of the private fileserver 
are mirrored to the public master fileserver, and within hours after that, the 
other MacPorts mirror servers synchronize their contents with the master.

If you like to watch what the buildbot is doing you can visit 
https://build.macports.org/waterfall

Each of our mirror servers have different capabilities and requirements when it 
comes to https. MacPorts is configured to know which mirror server is able to 
be reached via https on each version of macOS. The code that does that is here 
for distfiles:

https://github.com/macports/macports-ports/blob/dbf0d04659eb119cdec6a4c3fef6247345c6/_resources/port1.0/fetch/mirror_sites.tcl#L410-L464

and here for archives:

https://github.com/macports/macports-ports/blob/dbf0d04659eb119cdec6a4c3fef6247345c6/_resources/port1.0/fetch/archive_sites.tcl#L3-L55



Re: Portfile question for 10.6.8

2023-06-08 Thread raf via macports-users
On Wed, Jun 07, 2023 at 04:59:11PM +1000, raf  wrote:

> On Tue, Jun 06, 2023 at 06:49:35PM -0700, Ken Cunningham 
>  wrote:
> 
> > > On Jun 6, 2023, at 6:28 PM, raf via macports-users 
> > >  wrote:
> > > 
> > > On Wed, Jun 07, 2023 at 11:09:13AM +1000, raf via macports-users 
> > >  wrote:
> > > 
> > >> Yay! It worked. Many thanks. I'll fix my Makefile for the upcoming 
> > >> version
> > >> of rawhide and create the Portfile for that.
> > > 
> > > I spoke too soon. The compilation worked, but when I ran the
> > > program to list everything in my home directory, there were
> > > many many "Bad file descriptor" errors for fstatat(). It's
> > > happening for everything immediately below the current
> > > directory. Any ideas?
> > > 
> > > cheers,
> > > raf

> And with debugging on, everything looks correct until
> the error:
> 
>   openat(parent_fd=3, path=.git)
>   openat: dir_fd 4
>   fdopendir(dir_fd=4)
>   dir entry ./.git/branches
>   fstatat(parent_fd=4, path=branches)
>   rh: fstatat ./.git/branches: Bad file descriptor
> 
> The "bad" file descriptor is 4 which was returned by openat.
> That's what it looks like on other systems that work. Mysterious.

Looking at the source for legacysupport, I think I can see the
deliberate use of an invalid file descriptor. There must be a reason
for it, but I don't understand what is intended.

In atcalls.c:

  int fstatat(int dirfd, const char *pathname, struct stat *buf, int flags)
  {
ERR_ON(EINVAL, flags & ~AT_SYMLINK_NOFOLLOW);
if (flags & AT_SYMLINK_NOFOLLOW) {
return ATCALL(dirfd, pathname, lstat(pathname, buf));
} else {
return ATCALL(dirfd, pathname, stat(pathname, buf));
}
  }

In common-priv.h is the _ATCALL macro:

  #define _ATCALL(fd, p, onerr, what) \
({  typeof(what) __result;  \
int oldCWD = -1;\
if (fd != AT_FDCWD && p[0] != '/') {\
oldCWD = open(".", O_RDONLY);   \
if (best_fchdir(-1) < 0 && oldCWD != -1) {  \
close(oldCWD); oldCWD = -1; \
}   \
if (best_fchdir(fd) < 0) {  \
PROTECT_ERRNO(best_fchdir(oldCWD)); \
if (oldCWD != -1) PROTECT_ERRNO(close(oldCWD)); \
return onerr;   \
}   \
}   \
__result = (what);  \
if (fd != AT_FDCWD && p[0] != '/') {\
PROTECT_ERRNO(best_fchdir(oldCWD)); \
if (oldCWD != -1) PROTECT_ERRNO(close(oldCWD)); \
}   \
__result;   \
})

  #define ATCALL(fd, p, what)  _ATCALL(fd, p, -1, what)

The call to best_fchdir(-1) would presumably set errno to "Bad File Descriptor".
But I don't see why best_fchdir(fd) or the stat() would fail, so that shouldn't
matter.

Maybe I need to failover to stat() when fstatat() fails with EBADF? No. I made
fstatat() failover to stat(), but then openat() resulted in Bad File Descriptor.
So I made openat() failover to open(), but then fdopendir() started saying that
a directory was "Not a directory". This approach isn't working.

I think I should give up on getting it working on 10.6.8.

cheers,
raf



Re: Portfile question for 10.6.8

2023-06-07 Thread raf via macports-users
On Tue, Jun 06, 2023 at 06:45:58PM -0700, Ken Cunningham 
 wrote:

> > On Jun 6, 2023, at 6:16 PM, raf via macports-users 
> >  wrote:
> > 
> > On Wed, Jun 07, 2023 at 11:09:13AM +1000, raf via macports-users 
> >  wrote:
> > 
> >> So if I use different macro names (e.g. ALL_CFLAGS and ALL_LDFLAGS), and 
> >> just
> >> add $(CFLAGS) and $(LDFLAGS) from the environment to it, then it should 
> >> work.
> >> I'll try that.
> >> 
> >> Yay! It worked. Many thanks. I'll fix my Makefile for the upcoming version
> >> of rawhide and create the Portfile for that.
> > 
> > That still leaves the question of how 10.6.8 hosts can download distfiles
> > from a non-https site (when https sites won't support TLS 1.0). Do distfiles
> > magically end up on http://distfiles.macports.org?
> > 
> > cheers,
> > raf
> 
> Newer systems download them to distfiles.macports.org
> , and that site supports older TLS so
> older systems can get them from there.

Thanks.

cheers,
raf



Re: Portfile question for 10.6.8

2023-06-07 Thread raf via macports-users
On Tue, Jun 06, 2023 at 06:49:35PM -0700, Ken Cunningham 
 wrote:

> > On Jun 6, 2023, at 6:28 PM, raf via macports-users 
> >  wrote:
> > 
> > On Wed, Jun 07, 2023 at 11:09:13AM +1000, raf via macports-users 
> >  wrote:
> > 
> >> Yay! It worked. Many thanks. I'll fix my Makefile for the upcoming version
> >> of rawhide and create the Portfile for that.
> > 
> > I spoke too soon. The compilation worked, but when I ran the
> > program to list everything in my home directory, there were
> > many many "Bad file descriptor" errors for fstatat(). It's
> > happening for everything immediately below the current
> > directory. Any ideas?
> > 
> > cheers,
> > raf
> 
> is  -I/opt/local/include/LegacySupport making it into your CFLAGS and 
> CXXFLAGS during the build?

It is now.

  CFLAGS='-Os -I/opt/local/include/LegacySupport -arch x86_64'
  LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names 
-lMacportsLegacySupport -arch x86_64'

An example compilation command is:

  cc -Os -I/opt/local/include/LegacySupport -arch
  x86_64 -O3 -g -Wall -pedantic -DETCDIR=\"/etc\"
  -DRAWHIDE_NAME=\"rawhide\" -DRAWHIDE_PROG_NAME=\"rh\"
  -DRAWHIDE_VERSION=\"3.1\" -DRAWHIDE_DATE=\"20221011\"
  -DHAVE_PCRE2=1 -DHAVE_ACL=1 -DHAVE_POSIX_ACL=1
  -DHAVE_MACOS_ACL=1 -DHAVE_EA=1 -DHAVE_MACOS_EA=1
  -DHAVE_FLAGS=1 -DHAVE_MAGIC=1-I/opt/local/include
  -c rhdir.c

And the final link command is:

  cc -Os -I/opt/local/include/LegacySupport -arch
  x86_64 -O3 -g -Wall -pedantic -DETCDIR=\"/etc\"
  -DRAWHIDE_NAME=\"rawhide\" -DRAWHIDE_PROG_NAME=\"rh\"
  -DRAWHIDE_VERSION=\"3.1\" -DRAWHIDE_DATE=\"20221011\"
  -DHAVE_PCRE2=1 -DHAVE_ACL=1 -DHAVE_POSIX_ACL=1
  -DHAVE_MACOS_ACL=1 -DHAVE_EA=1 -DHAVE_MACOS_EA=1
  -DHAVE_FLAGS=1 -DHAVE_MAGIC=1-I/opt/local/include
  -o rh rhcmds.o rh.o rhparse.o rhdir.o rhdata.o
  rhstr.o rherr.o -L/opt/local/lib
  -Wl,-headerpad_max_install_names
  -lMacportsLegacySupport -arch x86_64 -L/opt/local/lib
  -lpcre2-8 -lmagic

And with debugging on, everything looks correct until
the error:

  openat(parent_fd=3, path=.git)
  openat: dir_fd 4
  fdopendir(dir_fd=4)
  dir entry ./.git/branches
  fstatat(parent_fd=4, path=branches)
  rh: fstatat ./.git/branches: Bad file descriptor

The "bad" file descriptor is 4 which was returned by openat.
That what's it looks like on other systems that work. Mysterious.

cheers,
raf



Re: Portfile question for 10.6.8

2023-06-06 Thread Ken Cunningham



> On Jun 6, 2023, at 6:28 PM, raf via macports-users 
>  wrote:
> 
> On Wed, Jun 07, 2023 at 11:09:13AM +1000, raf via macports-users 
>  wrote:
> 
>> Yay! It worked. Many thanks. I'll fix my Makefile for the upcoming version
>> of rawhide and create the Portfile for that.
> 
> I spoke too soon. The compilation worked, but when I ran the
> program to list everything in my home directory, there were
> many many "Bad file descriptor" errors for fstatat(). It's
> happening for everything immediately below the current
> directory. Any ideas?
> 
> cheers,
> raf
> 

is  -I/opt/local/include/LegacySupport making it into your CFLAGS and CXXFLAGS 
during the build?




Re: Portfile question for 10.6.8

2023-06-06 Thread Ken Cunningham


> On Jun 6, 2023, at 6:16 PM, raf via macports-users 
>  wrote:
> 
> On Wed, Jun 07, 2023 at 11:09:13AM +1000, raf via macports-users 
>  wrote:
> 
>> So if I use different macro names (e.g. ALL_CFLAGS and ALL_LDFLAGS), and just
>> add $(CFLAGS) and $(LDFLAGS) from the environment to it, then it should work.
>> I'll try that.
>> 
>> Yay! It worked. Many thanks. I'll fix my Makefile for the upcoming version
>> of rawhide and create the Portfile for that.
> 
> That still leaves the question of how 10.6.8 hosts can download distfiles
> from a non-https site (when https sites won't support TLS 1.0). Do distfiles
> magically end up on http://distfiles.macports.org?
> 
> cheers,
> raf
> 

Newer systems download them to distfiles.macports.org 
, and that site supports older TLS so older 
systems can get them from there.

Re: Portfile question for 10.6.8

2023-06-06 Thread raf via macports-users
On Wed, Jun 07, 2023 at 11:09:13AM +1000, raf via macports-users 
 wrote:

> Yay! It worked. Many thanks. I'll fix my Makefile for the upcoming version
> of rawhide and create the Portfile for that.

I spoke too soon. The compilation worked, but when I ran the
program to list everything in my home directory, there were
many many "Bad file descriptor" errors for fstatat(). It's
happening for everything immediately below the current
directory. Any ideas?

cheers,
raf



Re: Portfile question for 10.6.8

2023-06-06 Thread raf via macports-users
On Wed, Jun 07, 2023 at 11:09:13AM +1000, raf via macports-users 
 wrote:

> So if I use different macro names (e.g. ALL_CFLAGS and ALL_LDFLAGS), and just
> add $(CFLAGS) and $(LDFLAGS) from the environment to it, then it should work.
> I'll try that.
> 
> Yay! It worked. Many thanks. I'll fix my Makefile for the upcoming version
> of rawhide and create the Portfile for that.

That still leaves the question of how 10.6.8 hosts can download distfiles
from a non-https site (when https sites won't support TLS 1.0). Do distfiles
magically end up on http://distfiles.macports.org?

cheers,
raf



Re: Portfile question for 10.6.8

2023-06-06 Thread raf via macports-users
On Tue, Jun 06, 2023 at 08:46:56AM -0700, Ken Cunningham 
 wrote:

> it looks like the legacy support library is not being included in the link.
> 
> This is common when only scripts are used, as there are many flags that might 
> not be considered.
> 
> If you run the build on 10.6 using some extra verbosity flags like
> "-d" it will show you all the ENVVARs and LDFLAGS etc that macports
> sets. You should see the ones your script needs to account for in that
> list to get the proper legacysupport library on the link line.
> 
> K

Thanks. The main.log shows:

  Environment:
  
CC='/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/compwrap/cc/opt/local/bin/clang-mp-11'
  CC_PRINT_OPTIONS='YES'
  
CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/.CC_PRINT_OPTIONS'
  CFLAGS='-Os -I/opt/local/include/LegacySupport -arch x86_64'
  CPATH='/opt/local/include'
  CPLUS_INCLUDE_PATH='/opt/local/include/LegacySupport'
  CPPFLAGS='-I/opt/local/include -I/opt/local/include/LegacySupport'
  
CXX='/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/compwrap/cxx/opt/local/bin/clang++-mp-11'
  CXXFLAGS='-Os -arch x86_64 -stdlib=libc++'
  C_INCLUDE_PATH='/opt/local/include/LegacySupport'
  DEVELOPER_DIR='/Developer'
  F90FLAGS='-Os -m64'
  FCFLAGS='-Os -m64'
  FFLAGS='-Os -m64'
  INSTALL='/usr/bin/install -c'
  LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names 
-lMacportsLegacySupport -arch x86_64'
  LIBRARY_PATH='/opt/local/lib'
  MACOSX_DEPLOYMENT_TARGET='10.6'
  
OBJC='/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/compwrap/objc/opt/local/bin/clang-mp-11'
  OBJCFLAGS='-Os -arch x86_64'
  
OBJCXX='/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/compwrap/objcxx/opt/local/bin/clang++-mp-11'
  OBJCXXFLAGS='-Os -arch x86_64 -arch x86_64 -stdlib=libc++'
  PREFIX='/opt/local'
  Executing:  cd 
"/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/rawhid
  system:  cd 
"/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/rawhide-
  make: Entering directory 
`/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/w
  
/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/compwrap/cc/opt/local/

  :info:build Executing:  cd
  
"/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/rawhide-3.1"
  && /usr/bin/make -j4 -w rh
  
CC="/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/compwrap/cc/opt/local/bin/clang-mp-11"
  
CXX="/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/compwrap/cxx/opt/local/bin/clang++-mp-11"
  
OBJC="/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/compwrap/objc/opt/local/bin/clang-mp-11"
  
OBJCXX="/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/compwrap/objcxx/opt/local/bin/clang++-mp-11"
  INSTALL="/usr/bin/install -c"

  :debug:build system:  cd
  
"/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/rawhide-3.1"
  && /usr/bin/make -j4 -w rh
  
CC="/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/compwrap/cc/opt/local/bin/clang-mp-11"
  
CXX="/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/compwrap/cxx/opt/local/bin/clang++-mp-11"
  
OBJC="/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/compwrap/objc/opt/local/bin/clang-mp-11"
  
OBJCXX="/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/compwrap/objcxx/opt/local/bin/clang++-mp-11"
  INSTALL="/usr/bin/install -c"

  :info:build make: Entering directory
  
`/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/rawhide-3.1'

  :info:build
  
/opt/local/var/macports/build/_Users_raf_macports_ports_sysutils_rawhide/rawhide/work/compwrap/cc/opt/local/bin/clang-mp-11
  -O3 -g -Wall -pedantic -DETCDIR=\"/opt/local/etc\"
  -DRAWHIDE_NAME=\"rawhide\" -DRAWHIDE_PROG_NAME=\"rh\"
  -DRAWHIDE_VERSION=\"3.1\" -DRAWHIDE_DATE=\"20221011\"  -DHAVE_PCRE2=1
  -DHAVE_ACL=1 -DHAVE_POSIX_ACL=1 -DHAVE_MACOS_ACL=1 -DHAVE_EA=1
  -DHAVE_MACOS_EA=1 -I/opt/local/include -o rh rhcmds.o rh.o rhparse.o
  rhdir.o rhdata.o rhstr.o rherr.o -L/opt/local/lib -lpcre2-8

So it looks like I need legacysupport's CFLAGS and LDFLAGS and they're not
getting through. It's odd that I only saw linker errors, and no compiler
warnings without the CFLAGS getting through. Never mind.

I'm currently setting the CFLAGS and LDFLAGS macros myself in the (non-GNU)
Makefile, made up of a list of other *_CFLAGS and *_LDFLAGS macros.

So if I use different macro names (e.g. 

Re: Portfile question for 10.6.8

2023-06-06 Thread Ken Cunningham
it looks like the legacy support library is not being included in the link.

This is common when only scripts are used, as there are many flags that might 
not be considered.

If you run the build on 10.6 using some extra verbosity flags like "-d" it will 
show you all the ENVVARs and LDFLAGS etc that macports sets. You should see the 
ones your script needs to account for in that list to get the proper 
legacysupport library on the link line.

K



> On Jun 6, 2023, at 7:44 AM, raf via macports-users 
>  wrote:
> 
> On Tue, Jun 06, 2023 at 11:52:26PM +1000, raf  wrote:
> 
>> Hi, I'm writing a Portfile, and I have two macOS
>> systems to test it on: 10.6.8 and 10.14.6. Both have
>> macports-2.8.1.
>> 
>> I'm having trouble getting it working on macos-10.6.8.
>> It doesn't know where to download the tarball from.
>> 
>> This is the Portfile (minus blank lines):
>> 
>>  # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; 
>> c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
>>  PortSystem  1.0
>>  PortGroup   legacysupport 1.0
>>  #PortGroup   github 1.0
>>  PortGroup   makefile 1.0
>>  # Need openat(), unlinkat(), fdopendir()
>>  legacysupport.newest_darwin_requires_legacy 13
>>  namerawhide
>>  version 3.1
>>  #github.setup raforg rawhide 3.1 v
>>  #github.tarball_from releases
>>  revision0
>>  categories  sysutils
>>  platforms   darwin
>>  license GPL-3+
>>  maintainers raf.org:raf
>>  description (rh) find files using pretty C expressions
>>  long_description(rh) An alternative to find(1) that is more fun to use
>>  homepagehttps://raf.org/rawhide/
>>  master_sites${homepage}download/
>>  checksums   rmd160 230300b186a02dc5f2406b15f26a2d3e640b3a51 \
>>  sha256 
>> f495311262b44d3b55ba301f8367c65fbfc075f09d6fce4018a5e5e0588cc6fa \
>>  size 272193
>>  depends_lib port:pcre2 port:libmagic
>>  # Only a script, not a real configure.
>>  use_configure   yes
>>  destroot.destdirPREFIX=${destroot}${prefix}
>>  configure.args  --macports
>>  build.targetrh
>>  livecheck.type  regex
>>  livecheck.url   ${master_sites}
>>  livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}
>> 
>> It works on 10.14.6, but on 10.6.8, it guesses a bunch of download locations:
>> 
>>> sudo port install rawhide
>>  Portfile changed since last build; discarding previous state.
>>  --->  Computing dependencies for rawhide
>>  --->  Fetching distfiles for rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://distfiles.macports.org/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> https://raf.org/rawhide/download/
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://aarnet.au.distfiles.macports.org/pub/macports/distfiles/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://jog.id.distfiles.macports.org/macports/distfiles/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://kmq.jp.distfiles.macports.org/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://mirror.fcix.net/macports/distfiles/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://cjj.kr.distfiles.macports.org/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://ywg.ca.distfiles.macports.org/mirror/macports/distfiles/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://ykf.ca.distfiles.macports.org/MacPorts/mpdistfiles/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://pek.cn.distfiles.macports.org/macports/distfiles/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://fra.de.distfiles.macports.org/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://ema.uk.distfiles.macports.org/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://cph.dk.distfiles.macports.org/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://fco.it.distfiles.macports.org/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://mse.uk.distfiles.macports.org/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://nue.de.distfiles.macports.org/rawhide
>>  --->  Attempting to fetch rawhide-3.1.tar.gz from 
>> http://atl.us.distfiles.macports.org/rawhide
>>  Error: Failed to fetch rawhide: The requested URL returned error: 404
>>  Error: See 
>> /opt/local/var/macports/logs/_Users_raf_macports_ports_sysutils_rawhide/rawhide/main.log
>>  for details.
>>  Error: Follow https://guide.macports.org/#project.tickets if you believe 
>> there is a bug.
>>  Error: Processing of port rawhide failed
>> 
>> I don't know why it tried distfiles.macports.org/rawhide first,
>> or why it didn't find https://raf.org/rawhide/download/rawhide-3.1.tar.gz
>> 
>> I then tried 

Re: Portfile question for 10.6.8

2023-06-06 Thread raf via macports-users
On Tue, Jun 06, 2023 at 11:52:26PM +1000, raf  wrote:

> Hi, I'm writing a Portfile, and I have two macOS
> systems to test it on: 10.6.8 and 10.14.6. Both have
> macports-2.8.1.
> 
> I'm having trouble getting it working on macos-10.6.8.
> It doesn't know where to download the tarball from.
> 
> This is the Portfile (minus blank lines):
> 
>   # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; 
> c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
>   PortSystem  1.0
>   PortGroup   legacysupport 1.0
>   #PortGroup   github 1.0
>   PortGroup   makefile 1.0
>   # Need openat(), unlinkat(), fdopendir()
>   legacysupport.newest_darwin_requires_legacy 13
>   namerawhide
>   version 3.1
>   #github.setup raforg rawhide 3.1 v
>   #github.tarball_from releases
>   revision0
>   categories  sysutils
>   platforms   darwin
>   license GPL-3+
>   maintainers raf.org:raf
>   description (rh) find files using pretty C expressions
>   long_description(rh) An alternative to find(1) that is more fun to use
>   homepagehttps://raf.org/rawhide/
>   master_sites${homepage}download/
>   checksums   rmd160 230300b186a02dc5f2406b15f26a2d3e640b3a51 \
>   sha256 
> f495311262b44d3b55ba301f8367c65fbfc075f09d6fce4018a5e5e0588cc6fa \
>   size 272193
>   depends_lib port:pcre2 port:libmagic
>   # Only a script, not a real configure.
>   use_configure   yes
>   destroot.destdirPREFIX=${destroot}${prefix}
>   configure.args  --macports
>   build.targetrh
>   livecheck.type  regex
>   livecheck.url   ${master_sites}
>   livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}
> 
> It works on 10.14.6, but on 10.6.8, it guesses a bunch of download locations:
> 
>   > sudo port install rawhide
>   Portfile changed since last build; discarding previous state.
>   --->  Computing dependencies for rawhide
>   --->  Fetching distfiles for rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://distfiles.macports.org/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> https://raf.org/rawhide/download/
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://aarnet.au.distfiles.macports.org/pub/macports/distfiles/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://jog.id.distfiles.macports.org/macports/distfiles/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://kmq.jp.distfiles.macports.org/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://mirror.fcix.net/macports/distfiles/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://cjj.kr.distfiles.macports.org/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://ywg.ca.distfiles.macports.org/mirror/macports/distfiles/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://ykf.ca.distfiles.macports.org/MacPorts/mpdistfiles/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://pek.cn.distfiles.macports.org/macports/distfiles/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://fra.de.distfiles.macports.org/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://ema.uk.distfiles.macports.org/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://cph.dk.distfiles.macports.org/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://fco.it.distfiles.macports.org/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://mse.uk.distfiles.macports.org/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://nue.de.distfiles.macports.org/rawhide
>   --->  Attempting to fetch rawhide-3.1.tar.gz from 
> http://atl.us.distfiles.macports.org/rawhide
>   Error: Failed to fetch rawhide: The requested URL returned error: 404
>   Error: See 
> /opt/local/var/macports/logs/_Users_raf_macports_ports_sysutils_rawhide/rawhide/main.log
>  for details.
>   Error: Follow https://guide.macports.org/#project.tickets if you believe 
> there is a bug.
>   Error: Processing of port rawhide failed
> 
> I don't know why it tried distfiles.macports.org/rawhide first,
> or why it didn't find https://raf.org/rawhide/download/rawhide-3.1.tar.gz
> 
> I then tried using "PortGroup github 1.0" (and commenting out name and 
> version and
> uncommenting github.setup and github.tarball_from), but it behaved the same 
> way.
> 
> Any suggestions? Mind you, I'm expecting possible trouble compiling it on 
> 10.6.8
> when it does successfully download, but the legacysupport port group is 
> supposed to
> help (copied from bfs which uses it to access the same syscalls).
> 
> Ah, it's probably just TLS 1.0 not being supported by my website or github.
> 
> Maybe it'll work if the tarball ever makes it to 
> 

Portfile question for 10.6.8

2023-06-06 Thread raf via macports-users
Hi, I'm writing a Portfile, and I have two macOS
systems to test it on: 10.6.8 and 10.14.6. Both have
macports-2.8.1.

I'm having trouble getting it working on macos-10.6.8.
It doesn't know where to download the tarball from.

This is the Portfile (minus blank lines):

  # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; 
c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
  PortSystem  1.0
  PortGroup   legacysupport 1.0
  #PortGroup   github 1.0
  PortGroup   makefile 1.0
  # Need openat(), unlinkat(), fdopendir()
  legacysupport.newest_darwin_requires_legacy 13
  namerawhide
  version 3.1
  #github.setup raforg rawhide 3.1 v
  #github.tarball_from releases
  revision0
  categories  sysutils
  platforms   darwin
  license GPL-3+
  maintainers raf.org:raf
  description (rh) find files using pretty C expressions
  long_description(rh) An alternative to find(1) that is more fun to use
  homepagehttps://raf.org/rawhide/
  master_sites${homepage}download/
  checksums   rmd160 230300b186a02dc5f2406b15f26a2d3e640b3a51 \
  sha256 
f495311262b44d3b55ba301f8367c65fbfc075f09d6fce4018a5e5e0588cc6fa \
  size 272193
  depends_lib port:pcre2 port:libmagic
  # Only a script, not a real configure.
  use_configure   yes
  destroot.destdirPREFIX=${destroot}${prefix}
  configure.args  --macports
  build.targetrh
  livecheck.type  regex
  livecheck.url   ${master_sites}
  livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}

It works on 10.14.6, but on 10.6.8, it guesses a bunch of download locations:

  > sudo port install rawhide
  Portfile changed since last build; discarding previous state.
  --->  Computing dependencies for rawhide
  --->  Fetching distfiles for rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://distfiles.macports.org/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
https://raf.org/rawhide/download/
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://aarnet.au.distfiles.macports.org/pub/macports/distfiles/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://jog.id.distfiles.macports.org/macports/distfiles/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://kmq.jp.distfiles.macports.org/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://mirror.fcix.net/macports/distfiles/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://cjj.kr.distfiles.macports.org/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://ywg.ca.distfiles.macports.org/mirror/macports/distfiles/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://ykf.ca.distfiles.macports.org/MacPorts/mpdistfiles/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://pek.cn.distfiles.macports.org/macports/distfiles/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://fra.de.distfiles.macports.org/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://ema.uk.distfiles.macports.org/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://cph.dk.distfiles.macports.org/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://fco.it.distfiles.macports.org/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://mse.uk.distfiles.macports.org/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://nue.de.distfiles.macports.org/rawhide
  --->  Attempting to fetch rawhide-3.1.tar.gz from 
http://atl.us.distfiles.macports.org/rawhide
  Error: Failed to fetch rawhide: The requested URL returned error: 404
  Error: See 
/opt/local/var/macports/logs/_Users_raf_macports_ports_sysutils_rawhide/rawhide/main.log
 for details.
  Error: Follow https://guide.macports.org/#project.tickets if you believe 
there is a bug.
  Error: Processing of port rawhide failed

I don't know why it tried distfiles.macports.org/rawhide first,
or why it didn't find https://raf.org/rawhide/download/rawhide-3.1.tar.gz

I then tried using "PortGroup github 1.0" (and commenting out name and version 
and
uncommenting github.setup and github.tarball_from), but it behaved the same way.

Any suggestions? Mind you, I'm expecting possible trouble compiling it on 10.6.8
when it does successfully download, but the legacysupport port group is 
supposed to
help (copied from bfs which uses it to access the same syscalls).

Ah, it's probably just TLS 1.0 not being supported by my website or github.

Maybe it'll work if the tarball ever makes it to http://distfiles.macports.org.
How does that happen?

Assuming it will happen eventually, how can I tell it to use a local copy of the
distfile for the moment, just for the purpose of testing the compilation on 
10.6.8?
Maybe I need to set up a temporarily non-https website to download it from.