Skip to content

sweet/harnesses: sweet fails when building esbuild a second time with the same configuration #74185

Open
@yukatan1701

Description

@yukatan1701

I used the following configuration for the esbuild benchmark:

# config.toml
[[config]]
  name = "myconfig"
  goroot = "/home/yukatan/golang"

Then run:

$ ./sweet run -run esbuild -shell -work-dir `pwd`/tmp config.toml

It worked fine. However, when I tried to run this again, I got the following error:

[sweet] Work directory: /home/yukatan/benchmarks/sweet/tmp
[sweet] Benchmarks: esbuild (10 runs)
[sweet] Setting up benchmark: esbuild
[shell] mkdir -p /home/yukatan/benchmarks/sweet/results/esbuild
[shell] mkdir -p /home/yukatan/benchmarks/sweet/tmp/esbuild/myconfig/bin
[shell] mkdir -p /home/yukatan/benchmarks/sweet/tmp/esbuild/src
[shell] mkdir -p /home/yukatan/benchmarks/sweet/tmp/esbuild/myconfig/tmp
[shell] ln -s /home/yukatan/benchmarks/sweet/tmp/esbuild/src /home/yukatan/benchmarks/sweet/tmp/esbuild/myconfig/bin/esbuild-src
[sweet] error: build esbuild for myconfig: symlink /home/yukatan/benchmarks/sweet/tmp/esbuild/src /home/yukatan/benchmarks/sweet/tmp/esbuild/myconfig/bin/esbuild-src: file exists

The symlink() function (harnesses/common.go) causes this error. It calls os.Symlink -> symlinkat but this syscall returns the error if the destination file exists. Unlike ln -s, symlink() doesn't handle this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolProposalIssues describing a requested change to a Go tool or command-line program.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions