Skip to content

run-make-support: run might not accurately preserve the behavior of RUN in tools.mk #123832

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

Closed
jieyouxu opened this issue Apr 11, 2024 · 1 comment
Assignees
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jieyouxu
Copy link
Member

jieyouxu commented Apr 11, 2024

RUN in tools.mk has different environments depending on the platform. Audit run_make_support::run to make sure run correctly preserves the semantics of RUN in tools.mk:

# This is the name of the binary we will generate and run; use this
# e.g. for `$(CC) -o $(RUN_BINFILE)`.
RUN_BINFILE = $(TMPDIR)/$(1)

# Invoke the generated binary on the remote machine if compiletest was
# configured to use a remote test device, otherwise run it on the current host.
ifdef REMOTE_TEST_CLIENT
# FIXME: if a test requires additional files, this will need to be changed to
# also push them (by changing the 0 to the number of additional files, and
# providing the path of the additional files as the last arguments).
EXECUTE = $(REMOTE_TEST_CLIENT) run 0 $(RUN_BINFILE)
else
EXECUTE = $(RUN_BINFILE)
endif

TARGET_RPATH_ENV = \
    $(LD_LIB_PATH_ENVVAR)="$(TMPDIR):$(TARGET_RPATH_DIR):$($(LD_LIB_PATH_ENVVAR))"

# trimmed
ifeq ($(UNAME),Darwin)
    RUN = $(TARGET_RPATH_ENV) $(EXECUTE)
else
    ifdef IS_WINDOWS
        RUN = PATH="$(PATH):$(TARGET_RPATH_DIR)" $(EXECUTE)
    else
        RUN = $(TARGET_RPATH_ENV) $(EXECUTE)
    endif
endif
@jieyouxu jieyouxu added A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Apr 11, 2024
@jieyouxu jieyouxu self-assigned this Apr 11, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 11, 2024
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 11, 2024
@jieyouxu jieyouxu moved this to In progress in Oxidizing run-make tests Jun 6, 2024
@jieyouxu jieyouxu added the A-run-make Area: port run-make Makefiles to rmake.rs label Jun 9, 2024
@jieyouxu
Copy link
Member Author

jieyouxu commented Oct 9, 2024

So far the run() behaviors seem to work fine.

@jieyouxu jieyouxu closed this as completed Oct 9, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Oxidizing run-make tests Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants