GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||
GeezerVison is showing github.com — fix: keep the working directory after `gopy pkg` & `gopy exe` by b-long · Pull Request #416 · go-python/gopy Conversation
Member
Closes: #414
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsGenPyPkgSetup chdirs into the output directory, and neither command
changed back, so a caller running gopy in-process (as main_test.go does)
was left in the output directory, or in no directory at all once that
was removed: every later build then failed with
getwd: no such file or directory
TestPkg builds _examples/simple with gopy pkg and runs its test.py.
gopy exe printed `go build -o py<pkg>` but ran `go build -mod=mod` alone: the -o and -tags it appended went to an unused slice, so the executable was named after the directory and built without the requested tags. It now runs the command it prints, adding Windows' .exe suffix. The build that only writes <pkg>_go.h for the second build.py run was a c-shared link of a .c file compiled against the placeholder header, which macOS and Windows refuse when it calls functions (such as the static _gopy_clear_go_tls) it can't link to yet. It is now a c-archive, which writes the header without linking, both in gopy exe and in the Makefile it generates. The BuildMode constants other than ModeGen were untyped strings; they are now typed, and runBuild is passed bind.ModeBuild. TestExe checks that gopy exe writes setup.py and the executable. The generator keeps its state in package variables and gopy changes the process's working directory, so main_test.go ran every gopy command in-process and in sequence. TestMain now builds the gopy binary once and the tests run it as a separate process, which lets them call t.Parallel(). `make cover` collects coverage from those gopy processes too: the test binaries and gopy write raw coverage data to covdata/, which is merged into coverage.out. codecov.yml counts Go's "partial" lines as hits, as `go tool cover` does. Also ignore Python bytecode caches, and remove the one that was committed under _examples/funcs. - Pin goimports to v0.29.0 instead of @latest, so the tool TestGofmt checks against doesn't change from one run to the next. - Drop the apt-get step: none of the packages it installed are used. - Disable Windows Defender real-time scanning, which slows every compile, link and pip install on windows-latest. - Give the job a 20-minute timeout, rather than GitHub's 6h default. - Cancel a pull request's previous run when it is pushed to again, and let the matrix fail fast.
b-long
force-pushed
the
split/2-fix-exe-pkg
branch
from
6a08e53 to
2a2884e
Compare
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
b-long
added a commit
that referenced
this pull request
Master's main_test.go now builds the gopy binary once in TestMain and has tests run it through runGopy, so they can call t.Parallel() (#416). Running gopy in-process is unsafe there, because the generator keeps its state in package variables. Move TestComplexGILStress to runGopy and t.Parallel(), like TestGilString, and drop its bind.ResetPackages(), which only cleaned up the in-process run.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Thegopy pkg and gopy exe commands change (and do not restore) the working directory
Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |