Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/nmigen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ba64eb2037de
Choose a base ref
...
head repository: m-labs/nmigen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 744154ebb551
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jul 7, 2019

  1. build.run: only use os.path on the target OS.

    Before this commit, BuildPlan.add_file would use os.path.normpath,
    which would be the wrong thing for cross-builds.
    whitequark committed Jul 7, 2019
    Copy the full SHA
    744154e View commit details
Showing with 3 additions and 2 deletions.
  1. +3 −2 nmigen/build/run.py
5 changes: 3 additions & 2 deletions nmigen/build/run.py
Original file line number Diff line number Diff line change
@@ -30,8 +30,6 @@ def add_file(self, filename, content):
forward slashes (``/``).
"""
assert isinstance(filename, str) and filename not in self.files
# Just to make sure we don't accidentally overwrite anything.
assert not os.path.normpath(filename).startswith("..")
self.files[filename] = content

def archive(self, file):
@@ -60,6 +58,9 @@ def execute_local(self, root="build", run_script=True):
os.chdir(root)

for filename, content in self.files.items():
filename = os.path.normpath(filename)
# Just to make sure we don't accidentally overwrite anything outside of build root.
assert not filename.startswith("..")
dirname = os.path.dirname(filename)
if dirname:
os.makedirs(dirname, exist_ok=True)