Opened 3 years ago

Closed 2 years ago

#62753 closed defect (fixed)

Portindex: can't read "bazel.build_opts": sysctl not available (when faking platform on linux)

Reported by: arjunsalyan (Arjun Salyan) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: mojca (Mojca Miklavec), jmroot (Joshua Root), ryandesign (Ryan Carsten Schmidt), cjones051073 (Chris Jones), mascguy (Christopher Nielsen)
Port:

Description (last modified by arjunsalyan (Arjun Salyan))

I am generating the PortIndex on linux using the following command

portindex -p macosx_19_i386

But for certain ports, I am getting issues related to sysctl

Warning: Failed to open old entry for python/py-tensorflow, making a new one
Adding port python/py-tensorflow
Failed to parse file python/py-tensorflow/Portfile with subport 'py37-tensorflow': can't read "bazel.build_opts": sysctl not available
Failed to parse file python/py-tensorflow/Portfile with subport 'py38-tensorflow': can't read "bazel.build_opts": sysctl not available
Failed to parse file python/py-tensorflow/Portfile with subport 'py39-tensorflow': can't read "bazel.build_opts": sysctl not available

Another type of errors encountered are:

Failed to parse file math/pari/Portfile: sysctl not available

I am running MacPorts using a Docker container on Ubuntu 20.0.4. The build was done using latest source code from [macports-base](https://github.com/macports/macports-base/tree/85d5e10e1fbfc30ad7f7214f2d0b277023213820) repo.

Change History (24)

comment:1 Changed 3 years ago by arjunsalyan (Arjun Salyan)

Description: modified (diff)

comment:2 Changed 3 years ago by mojca (Mojca Miklavec)

Cc: jmroot ryandesign added

comment:3 Changed 3 years ago by mojca (Mojca Miklavec)

I have no clue yet, but there were some changes related to major OS version to cater for the changes related to versioning in Big Sur, and maybe that broke PortIndex.

I suspect that PortIndex breaks (in the case of py-tensorflow) on this code:

set min_darwin 16
if { ${os.major} < ${min_darwin} } {
    known_fail yes
    ...
}

Can you just check whether removing these lines helps removing the error?

It would probably help if Joshua or someone else looks into this.

comment:4 in reply to:  3 Changed 3 years ago by arjunsalyan (Arjun Salyan)

Replying to mojca:

I have no clue yet, but there were some changes related to major OS version to cater for the changes related to versioning in Big Sur, and maybe that broke PortIndex.

I suspect that PortIndex breaks (in the case of py-tensorflow) on this code:

set min_darwin 16
if { ${os.major} < ${min_darwin} } {
    known_fail yes
    ...
}

Can you just check whether removing these lines helps removing the error?

It did not help, the error remained exactly the same. I am wondering if the problem is with docker, I have read that sysctl is not available in a Container- we might need a workaround in that case.

comment:5 Changed 3 years ago by jmroot (Joshua Root)

I assume the issue is with the bazel portgroup. I'll leave fixing it to its author. In general you can't assume that sysctl will always succeed; you have to handle errors.

comment:6 Changed 3 years ago by mojca (Mojca Miklavec)

math/pari contains the following PortGroups:

PortSystem          1.0
PortGroup           muniversal 1.0
PortGroup           compiler_blacklist_versions 1.0
PortGroup           xcode_workaround 1.0

So I guess that at least the request to fix the muniversal PortGroup goes to you, Joshua ;)

[a1d0243c19fb2b3b3951c68b6d5a61e4abd35d06/macports-ports]

Last edited 3 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:7 Changed 3 years ago by mojca (Mojca Miklavec)

Cc: cjones051073 added

comment:8 in reply to:  5 Changed 3 years ago by cjones051073 (Chris Jones)

Replying to jmroot:

I assume the issue is with the bazel portgroup. I'll leave fixing it to its author. In general you can't assume that sysctl will always succeed; you have to handle errors.

what exactly is the bazel PG doing wrong ?

comment:9 Changed 3 years ago by cjones051073 (Chris Jones)

the use of sysctl has been there for some time, I don't see what the change to the min darwin requirement would havemwith the issue here ?

comment:10 Changed 3 years ago by cjones051073 (Chris Jones)

I will though update the bazel PG to catch errors from the sysctl cal.

comment:11 Changed 3 years ago by cjones051073 (Chris Jones)

Last edited 3 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:12 in reply to:  11 Changed 3 years ago by arjunsalyan (Arjun Salyan)

Replying to cjones051073:

[7d94e4a5dc17a0aaaf43669650b53909127ec5af/macports-ports]

Can you test if that helps ?

Thank you for your prompt response to this, but this did not solve the issue. Error is still the same. We are faking the platform as macosx_19_i386, so I think the PortIndex command still considers the platform as darwin https://github.com/macports/macports-base/blob/a0172d6655263e9de47e05dd33da0651c1b93ced/src/port/portindex.tcl#L206 .

These are the only ports failing:

  • devel/icu58
  • graphics/povray
  • math/pari
  • python/py-tensorflow
  • python/py-tensorflow-addons
  • python/py-tensorflow-probability
  • python/py-tensorflow1
  • security/cyrus-sasl2
Last edited 3 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:13 Changed 3 years ago by cjones051073 (Chris Jones)

ah yes, of course. OK, guess I will have to look into catching the errors as well ;)

comment:14 Changed 3 years ago by cjones051073 (Chris Jones)

can you update and try again ?

comment:15 in reply to:  14 Changed 3 years ago by arjunsalyan (Arjun Salyan)

Replying to cjones051073:

can you update and try again ?

It is now solved for the tensorflow ports which said can't read "bazel.build_opts", thank you!

Four ports still fail, but that seems to be a issue not related to Bazel portgroup:

Failed to parse file devel/icu58/Portfile: sysctl not available
Failed to parse file graphics/povray/Portfile: sysctl not available
Failed to parse file math/pari/Portfile: sysctl not available
Failed to parse file security/cyrus-sasl2/Portfile: sysctl not available

comment:16 Changed 3 years ago by cjones051073 (Chris Jones)

yep, those other ports will need their own fixes.

comment:17 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

That'll be the muniversal portgroup then.

comment:18 Changed 2 years ago by jmroot (Joshua Root)

Component: baseports

comment:19 Changed 2 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:20 Changed 2 years ago by jmroot (Joshua Root)

In ba96dcc5e5d2ea7999e6350829dbbc57cb09ee4f/macports-ports (master):

muniversal pg: catch sysctl errors

See: #62753

comment:21 Changed 2 years ago by jmroot (Joshua Root)

In 5f24ce2d0161db6548d589335d34cc52fa1723c8/macports-ports (master):

octave pg: catch sysctl errors

See: #62753

comment:22 Changed 2 years ago by jmroot (Joshua Root)

Are any ports still failing to parse?

comment:23 Changed 2 years ago by arjunsalyan (Arjun Salyan)

Nope, all ports are getting parsed now. Thank you

Total number of ports parsed:	0 
Ports successfully parsed:	0 
Ports failed:			0 
Up-to-date ports skipped:	30144

comment:24 Changed 2 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.