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

[email protected]_py310: attempt to fix pyside runtime error with post i… #630

Closed
wants to merge 1 commit into from

Conversation

ipatch
Copy link
Collaborator

@ipatch ipatch commented Nov 9, 2024

…nstall step

brew style freecad/freecad/[NAME_OF_FORMULA_FILE] 

output from running above command should output something similiar to the below

1 file inspected, no offenses detected
  • Have you ensured your commit passed audit checks, ie.
brew audit freecad/freecad/[NAME_OF_FORMULA_FILE] --online --new-formula

Not all PRs require passing these checks ie. adding [no ci] in the commit message will prevent the CI from running but PRs that change formula files generally should run through the CI checks that way new bottles are built and uploaded to the repository thus not having to build all formula from source but rather installing from a bottle (significantly faster 🐰 ... 🐢)

For more information about this template file learn more

@ipatch ipatch self-assigned this Nov 10, 2024
@ipatch ipatch added enhancement useful issues that provide useful information labels Nov 10, 2024
@ipatch
Copy link
Collaborator Author

ipatch commented Nov 10, 2024

this one has been a battle (to say the least), so from what i can tell forks of a repo can not use secrets stored in a upstream repo, thus generating a token classic or PAT that is stored in this repo ie. freecad/homebrew-freecad can not be used to say get a list of self-hosted runners accessible by the repo.

github actions do provide a token ie. a GITHUB_TOKEN that is generated for each workflow run, and this token has permissive permissions to access certain aspects of the repo. though the token ie. the GITHUB_TOKEN can not be used to make authenticated API requests to the github api. thus making it difficult next to impossible (from what i can tell) to fork this repo create PR and then have the workflow run ie. test.yml to get a list of self-hosted runners, and apply / store a env var in the GITHUB_ENV for the workflow.

the only work around i have managed to get going is to directly create a new branch in the upstream ie. freecad/homebrew-freecad of the same name, and this branch can access the token stored in the github secrets for the repo, and thus make the necessary api requests to status self-hosted runners stored in the repo. 😵‍💫

@ipatch
Copy link
Collaborator Author

ipatch commented Nov 10, 2024

the current issue i'm running into using the self-hosted runner ie. ubuntu 22.04 is below, which i find odd because it appears to a logic error related the associated ruby file ...fun

==> Using Homebrew/homebrew-test-bot fadb62c (Merge pull request #1298 from Homebrew/dependabot/github_actions/ruby/setup-ruby-1.201.0)
==> Using Homebrew/brew 4.4.4-76-g40f4ab2546 (Merge pull request #18748 from alebcay/linux-amd-cpus)
==> Using Homebrew/homebrew-core d068a6dfa1a (Merge pull request #197194 from Homebrew/bump-cyphernetes-0.14.0)
==> Testing FreeCAD/homebrew-freecad 4ee2cfd (Merge 94046f9e04f8008cbb471cd8501468f8b10c62f2 into 4e3710c6a03cb0e71e66613f7493dbbe7391bc7b):
==> Running FormulaeDetect#detect_formulae!
==> git -C /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/freecad/homebrew-freecad fetch origin +refs/heads/master
    url               https://github.com/FreeCAD/homebrew-freecad/pull/630/checks
    tap origin/master 4e3710c (disable step in workflow [no ci])
    HEAD              4ee2cfd (Merge 94046f9e04f8008cbb471cd8501468f8b10c62f2 into 4e3710c6a03cb0e71e66613f7493dbbe7391bc7b)
    diff_start_sha1   4e3710c6a03cb0e71e66613f7493dbbe7391bc7b
    diff_end_sha1     4ee2cfd97b04798aae217390a827c6c747b99fea
    testing_formulae  freecad/freecad/[email protected]_py310
    added_formulae    (none)
    modified_formulae freecad/freecad/[email protected]_py310
    deleted_formulae  (none)
    formulae_to_fetch (none)
==> Running Formulae#run!
Error: undefined method `map' for nil
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:819:in `pull_request_labels'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/test_formulae.rb:124:in `download_artifacts_from_previous_run!'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/tests/formulae.rb:30:in `block in run!'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/kernel.rb:539:in `with_env'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/tests/formulae.rb:24:in `run!'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/test_runner.rb:225:in `run_tests'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/test_runner.rb:67:in `block in run!'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/test_runner.rb:55:in `each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/test_runner.rb:55:in `run!'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/test_bot.rb:147:in `run!'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/cmd/test-bot.rb:124:in `run'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:94:in `<main>'
If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/homebrew/homebrew-test-bot/issues/new
Error: Process completed with exit code 1.

@ipatch
Copy link
Collaborator Author

ipatch commented Nov 10, 2024

i think the next logical step is open another PR but from my fork of this repo, and see if the self-hosted runner presents the same error message. my hunch makes me think that since this is a branch of the same repo that logic in the above mentioned ruby files can not handle this edge case of using test-bot with a repo and a branch of the same repo as opposed to using a repo fork ie. ipatch/homebrew-freecad instead of freecad/homebrew-freecad for the branch PR. 🧐

@ipatch
Copy link
Collaborator Author

ipatch commented Nov 10, 2024

#634

@ipatch
Copy link
Collaborator Author

ipatch commented Nov 10, 2024

it appears my assumption stated in the above comment ie.

i think the next logical step is open another PR but from my fork of this repo, and see if the self-hosted runner presents the same error message. my hunch makes me think that since this is a branch of the same repo that logic in the above mentioned ruby files can not handle this edge case of using test-bot with a repo and a branch of the same repo as opposed to using a repo fork ie. ipatch/homebrew-freecad instead of freecad/homebrew-freecad for the branch PR. 🧐

using the traditional test-bot workflow the run on the self-hosted runner will reach the below step,

Run # Check if the runner name is vmmojave or vmcatalina and add the flag if true
==> Using Homebrew/homebrew-test-bot fadb62c (Merge pull request #1298 from Homebrew/dependabot/github_actions/ruby/setup-ruby-1.201.0)
==> Using Homebrew/brew 4.4.4-76-g40f4ab2546 (Merge pull request #18748 from alebcay/linux-amd-cpus)
==> Using Homebrew/homebrew-core d068a6dfa1a (Merge pull request #197194 from Homebrew/bump-cyphernetes-0.14.0)
==> Testing FreeCAD/homebrew-freecad 40490e3 (Merge 017bb9306e166a8a41e14d6a7690577c35035da2 into 11c87c98025fd9551a19fd9762861fb937be2fcc):
==> Running FormulaeDetect#detect_formulae!
==> git -C /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/freecad/homebrew-freecad fetch origin +refs/heads/master
    url               https://github.com/FreeCAD/homebrew-freecad/pull/634/checks
    tap origin/master 11c87c9 ([no ci] let certain steps continue to run even if they fail)
    HEAD              40490e3 (Merge 017bb9306e166a8a41e14d6a7690577c35035da2 into 11c87c98025fd9551a19fd9762861fb937be2fcc)
    diff_start_sha1   11c87c98025fd9551a19fd9762861fb937be2fcc
    diff_end_sha1     40490e3e63657dc56301ffc028bb7f087acea549
    testing_formulae  freecad/freecad/[email protected]_py310
    added_formulae    (none)
    modified_formulae freecad/freecad/[email protected]_py310
    deleted_formulae  (none)
    formulae_to_fetch (none)
==> Running Formulae#run!
==> Running Formulae#formula!(freecad/freecad/[email protected]_py310)

thus the default logic in homebrew has not been setup to handle a use case where a branch of the same repo is used to create a PR and update the main / master branch the changes in the PR.

@ipatch
Copy link
Collaborator Author

ipatch commented Nov 10, 2024

the original intent behind this PR is to hopefully resolve the issue with the proxy pyside module referencing the main PySide2 module. as the post_install step was creating absolute symlinks, and for reasons I do not completely understand that both the freecad and freecadcmd symlinks could not acess the necessary paths in the site-packages dir, but if the symlinks were relative then additional paths were added to the site-packages allowing the freecad executable access the necessary paths for loading the PySide module.

and in the process i setup a self-hosted runner on an additional macbook running ubuntu 22.04. this runner was setup to hopefully troubleshoot the ongoing issue with CI build failures with the github ubuntu runners related to the missing GL/glu.h header when building freecad that was only appearing when building freecad via the CI. so that said, browsing the upstream homebrew/brew repo there is are some undocumented environment variables that seem to allow self-hosted runners to skip certain steps when running through the test-bot CI process. hopefully setting the below env var will allow test-bot to install all the necessary packages / formula for freecad on the self-hosted runner and not uninstall them after the job has completed or failed. the reason for this is that building freecad from a fresh homebrew setup takes an extended period of time ~ over an hour to download and install all the necessary packages to even begin the process of installing freecad. so if i can skip that or "cache" that process hopefully i can begin / expedite the process troubleshooting the build error with the ubuntu runner.


above mentioned undocumented environment variable

GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED

https://github.com/ipatch/homebrew-test-bot/blob/a0e1fd93b558040938c53f76ec6f2c04905dca32/lib/tests/cleanup_after.rb#L8

and in the process of troubleshooting GL/glu.h build error i've setup a proxy / test formula for troubleshooting the GL/glu.h error, and seemed to successfully setup a cmake project to manually find the necessary header file, it just needs to be applied to the freecad formula, and patch file will more than likely be required for the freecad source.

https://gist.github.com/ipatch/8517a5914d56c45b0ebc4dd4df5160c4

https://github.com/ipatch/homebrew-us-05/blob/f8ce1c337808ccd4bc7e5198b6e57f821182ecb7/Formula/hello_world_opengl.rb#L1

@ipatch
Copy link
Collaborator Author

ipatch commented Nov 10, 2024

it looks like test-bot may still attempt to clean regardless if env var is set.

https://github.com/Homebrew/homebrew-test-bot/blob/fadb62cbd13117614daccab9683cf8896d4fa927/lib/test_bot.rb#L26C4-L32

@ipatch ipatch closed this Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement useful issues that provide useful information
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant