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

fix --workdir #830

Merged
merged 1 commit into from
Jul 28, 2023
Merged

fix --workdir #830

merged 1 commit into from
Jul 28, 2023

Conversation

deitch
Copy link
Contributor

@deitch deitch commented Jul 27, 2023

Fixes #787

It was ignoring --workdir.

@deitch deitch requested a review from a team as a code owner July 27, 2023 14:54
@deitch deitch requested review from jonjohnsonjr and removed request for a team July 27, 2023 14:54
@deitch
Copy link
Contributor Author

deitch commented Jul 28, 2023

It is interesting that it is complaining about a race condition in go test -race, specifically here:

      /Users/adeitcher/Documents/Development/go/src/github.com/chainguard-dev/apko/internal/cli/build.go:266 +0x264

That line is part of:

	for _, arch := range archs {
...
		errg.Go(func() error {
...
			pkgs[arch] = installed    // <--- the line with the race condition

I guess it is theoretically possibly if the same arch appears twice in archs, but we already ensure it is unique in types.ParseArchitectures(archstrs). So while it is theoretically possible, it never can happen.

I guess we can put a lock on it, just to ensure this doesn't happen. 🤷‍♂️

@deitch
Copy link
Contributor Author

deitch commented Jul 28, 2023

That should fix it.

@deitch deitch enabled auto-merge July 28, 2023 06:47
Signed-off-by: Avi Deitcher <[email protected]>
@deitch
Copy link
Contributor Author

deitch commented Jul 28, 2023

It is happening now.

@deitch deitch merged commit 764deec into chainguard-dev:main Jul 28, 2023
19 checks passed
@deitch deitch deleted the update-workdir branch July 28, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

apko build ignores --workdir flag
3 participants