I’m attempting to change the golang compiler( launch 1.17.7) to accumulate info situated in resource code directory site of bundles which are imported by existing job, and also collect the info under the origin directory site( i.e. the major plan directory site) of the component.
What I do is that I include a flag - s
to permit the go compiler( gc) to discard info in each plan resource directory site. I attain it.
And afterwards I attempt to accumulate these info. In the runBuild
feature which is the entrance of the gc sending off collection jobs, I attempt to include the complying with code to accumulate info unloaded in each plan’s resource code directory site to the major plan’s directory site after b.Do( ctx, a)
Line448 and also b.Do( ctx, a)
Line459 which is the actual feature to do the collection jobs. I believe all imported bundles will certainly be put together after b.Do( ctx, a)
completed. Yet the accumulate fallen short.
b.Do( ctx, a).
var main_path string.
for _, p:= array pkgs {
if p.Name == "major" {
main_path = p.Dir// obtain the major plan's course.
}
}
// accumulate info under each pkg.Dir and also relocate documents from pkg.Dir to.
accumulate( pkgs, main_path).
Take the complying with job as an instance
pkg_export # the major plan.
|-- main.go.
|-- mypkg # the mypkg plan-- imported by main.go.
|-- utils.go.
In my experiment, utilizing command go develop -a -gcflags= all=- s.
, each plan can appropriately discard info in each plan’s resource code directory site, yet the accumulate feature can not accumulate info from each plan’s resource directory site to the main_path
In the instance job, it resembles:
pkg_export # the major plan.
|-- main.go.
|-- info1.txt.
|-- mypkg # the mypkg plan-- imported by main.go.
|-- utils.go.
|-- info2.txt.
the info2.txt
under mypkg
directory site is not combined right into the info1.txt
under pkg_export
directory site after accumulate( pkgs, main_path)
feature telephone call.
the info2.txt
under mypkg
directory site is not combined right into the info1.txt
under pkg_export
directory site after accumulate( pkgs, main_path)
feature telephone call.
My concerns are:
- Is my code placed in the ideal location? My objective is to accumulate info when every dependence of the component is put together and also info is created. Does all dependence collection surface after
b.Do( ctx, a)
Line 547 and alsob.Do( ctx, a)
Line 536? - Do I make use of the proper area
p.Dir
of theload.Package
struct? - Is the collection procedure parallel? If so, does the similarity trigger the failing of combining info?
An instance job remains in Lslightly/pkg _ export (github.com)
The reconstruct of gc is to make use of ./ clean.bash
and after that ./ make.bash
under src
directory site of golang’s resource code and also the brand-new go compiler will certainly be created.
I actually value any kind of aids and also concepts. Many thanks!